/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    padding-bottom: 20%;
}

/* The Full-Screen Container */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    background-color: #f4f7f9;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* Allows scrolling if content exceeds screen height */
    padding: 20px;
}

/* The Main Card */
.study-card {
    background: white;
    width: 100%;
    max-width: 500px;
    min-height: 80%;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label.main-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #34495e;
}

/* Slider Styling */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex-grow: 1;
    cursor: pointer;
}

.slider-value {
    font-weight: bold;
    color: #3498db;
    font-size: 1.2rem;
    min-width: 40px;
}

/* Checkbox Grid Styling */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns for mobile */
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.option-item:active {
    background: #e2e6ea;
}

.option-item input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    margin-top: 20px;
    padding: 15px;
    display: none;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0percent 0.3s;
    width: 100%;
}

/* Confirm Button */
.btn-submit {
    display: block;
    margin-top: 10px;
    padding: 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0percent 0.3s;
    width: 100%;
}

.btn-submit:hover {
    background-color: #2980b9;
}

.btn-submit:active {
    transform: scale(0.98);
}

.option-btn {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 16px;
}

.option-btn:hover {
    background-color: #e0e0e0;
}

.correct {
    background-color: #d4edda !important;
    color: #155724;
    border-color: #c3e6cb;
}

.incorrect {
    background-color: #f8d7da !important;
    color: #721c24;
    border-color: #f5c6cb;
}

#quiz-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 400px;
    text-align: center;
}

#feedback {
    margin-top: 15px;
    font-weight: bold;
    min-height: 20px;
}

#quiz-status-bar {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-around; /* Spreads the 3 items evenly */
    padding: 15px 0;
    font-family: sans-serif;
    font-weight: bold;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #bdc3c7;
}

.text-success { color: #2ecc71; } /* Green */
.text-danger { color: #e74c3c; }  /* Red */


/* Desktop optimization: increase columns if screen is large */
@media (min-width: 600px) {
    .checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}