


/* ------------QUIZ UI------------- */

#quiz-container {
    width: 100%;
    max-width: 800px;
    min-width: 320px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; 
    padding: 0 10px;
}

#correct-meter { 
    background: var(--gradient-green); 
}
#incorrect-meter { 
    background: var(--gradient-red); 
}
#pending-meter { 
    background: var(--gradient-yellow); 
}

.utility-btn .btn-icon {
    display: none;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
.utility-btn .btn-text {
    display: inline;
}

#question-area {
   background: transparent;
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.question-text-container {
    background: var(--white-translucent-light); 
    border-radius: 6px; 
    border: 1px solid var(--white-translucent-light); 
    box-shadow: var(--shadow-subtle); 
    padding: 12px 16px; 
    box-sizing: border-box;

    /* --- CONSTANT 4-LINE HEIGHT LOGIC --- */
    --line-height-base: 1.45;                             /* Captures the line-height scale */
    --font-size-base: 1.1rem;                             /* Captures the text size scale */
    
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    
    /* Height calculation: (Font Size * Line Height * 4 Lines) + Top Padding + Bottom Padding */
    height: calc((var(--font-size-base) * var(--line-height-base) * 4) + 24px); 
    min-height: calc((var(--font-size-base) * var(--line-height-base) * 4) + 24px);
    max-height: calc((var(--font-size-base) * var(--line-height-base) * 4) + 24px);
    overflow-y: auto; 
}

    #question-text {
    color: var(--white);
    font-size: 1.1rem;
    line-height: 1.45;
    margin: 4px;
}

#question-image {
   display: none; 
   max-width: 100%; 
   cursor: pointer; 
   margin-top: 12px;
   border-radius: 4px;
}

#question-area.active-question-inline {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    width: 100%;
    box-sizing: border-box;
}

#question-area .question-text-container {
    grid-column: span 12; /* Keeps it from shrinking horizontally */
    width: 100%;          /* Forces it to stretch to the bounds of #quiz-container */
    box-sizing: border-box;
}



/* Consistently styled full text modal card */
.multi-modal-custom-card.question-modal-card {
    background: var(--dark-charcoal); 
    border: 1px solid var(--white-translucent-inline);
}

#modal-full-question-text {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--white);
}

#options-container {
    counter-reset: option-counter;
    margin-bottom: 15px;
}

#pause-btn {
    background: var(--gradient-red, var(--coral-red));
    padding: 10px 20px; 
    font-size: 0.9rem; 
    font-family: monospace;
    font-weight: 800;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

#pause-btn span {
    display: flex;
    align-items: center;
    gap: 8px; 
}

#prev-btn {
    background:var(--gradient-yellow)
}

#next-btn {
    background:var(--gradient-green);
}

.header-row {
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    display: none;
}
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.75em;
    text-transform: uppercase;
}

.progress-track {
    flex-grow: 1;
    display: flex;
    gap: 4px;
    height: 6px;
    min-width: 80px;
}
.progress-track .progress-seg {
    flex: 1;
    background: var(--medium-charcoal);
    border-radius: 3px;
}
.progress-track .progress-seg.active {
    background: var(--gradient-blue);
}
.progress-track .progress-seg.review-active {
    background: var(--amber-yellow) !important;
}
.stat-box {
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 800;
    color: var(--white);
    min-width: 40px;
    justify-content: center;
}
.quiz-progress-stats {
    display: flex;
    gap: 8px;
}


.option-btn {
    display: block;
    width: 100%;
    background: var(--dark-charcoal);
    border: 1px solid var(--medium-charcoal);
    color: var(--white);
    padding: 12px 20px;
    margin: 5px 0;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    position: relative;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-subtle);
    white-space: normal;
}
.option-btn::before {
    counter-increment: option-counter;
    content: counter(option-counter, upper-alpha) ") ";
    font-weight: 450;
    margin-right: 12px;
}
.option-btn.correct {
    background: var(--gradient-green) !important;
    border-color: transparent;
}
.option-btn.correct .hint-icon:hover {
    color: var(--emerald-green);
}
.option-btn.incorrect {
    background: var(--gradient-red) !important;
    border-color: transparent;
}
.option-btn:disabled:not(.correct):not(.incorrect) {
    cursor: default;
    opacity: 0.6;
}
.option-btn:hover:not(.correct):not(.incorrect):not(:disabled) {
    background: var(--dark-gray);
    border-color: var(--badge-round-bg);
    transform: translateX(4px);
    box-shadow: var(--shadow-lift);
}
.option-btn:disabled .hint-icon {
    opacity: 1 !important;
    border-color: var(--white) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}
.hint-wrapper {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}
.hint-icon {
    width: 26px;
    height: 26px;
    background: transparent;
    color: var(--white);
    border: 1px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
    pointer-events: auto;
}
.hint-icon:hover + .hint-tooltip {
    opacity: 1;
    transform: translateY(0);
}
.hint-icon:hover {
    background: var(--white);
    color: var(--coral-red);
    transform: scale(1.1);
}
.hint-tooltip {
    position: absolute;
    bottom: 140%;
    right: -5px;
    background: var(--dark-gray);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--white-translucent-light);
    z-index: 100;
    border: 1px solid var(--medium-charcoal);
    transform: translateY(5px);
}
.hint-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-top-color: var(--dark-gray);
}

.nav-area {
    display: none;
    justify-content: space-between;
    gap: 20px;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.nav-btn, .utility-btn {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--white-translucent-light);
    text-transform: uppercase;
    color: var(--white);
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 var(--white-translucent-light), var(--shadow-subtle);
    white-space: nowrap;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px var(--shadow-subtle);
}
.utility-cluster {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
    gap: 10px;
    display: none;
}
.utility-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
    filter: grayscale(1); 
}
.nav-btn:hover:not(:disabled), .utility-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: inset 0 1px 0 var(--shadow-subtle), var(--shadow-lift);
}
.nav-btn:disabled, .utility-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: var(--medium-charcoal) !important;
}


#show-calculator-modal-btn {
    background:var(--gradient-bronze)  
}

#show-image-modal-btn {
    background:var(--gradient-blue)   
}

#show-formula-modal-btn {
    background:var(--gradient-purple)   
}

.option-btn:disabled .hint-wrapper,
.option-btn:disabled .hint-icon {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.option-btn:disabled {
    pointer-events: none; 
}

.hint-wrapper {
    pointer-events: auto !important;
}

.active-quiz-info-inline,
.active-question-inline {
    display: grid;
    grid-template-columns: repeat(12, 1fr); 
    align-items: center;
    gap: 12px;
    margin: 5px 0 5px 0;
    padding: 4px 6px;
    font-size: 0.85rem;
    color: var(----white-translucent-heavy);
    background: var(--shadow-subtle);
    border-radius: 6px;
    border: 1px solid var(--white-translucent-light);
    box-sizing: border-box;
}

.active-quiz-info-inline .item-username    { grid-column: span 12; text-align: center;}
.active-quiz-info-inline .item-category    { grid-column: span 12; text-align: center; }
.active-quiz-info-inline .item-question-no { grid-column: span 4; }
.active-quiz-info-inline .item-quiz-no     { grid-column: span 4; text-align: center; }
.active-quiz-info-inline .item-series-no   { grid-column: span 4; text-align: right; }

.active-quiz-info-inline .info-item {
    display: block;
    padding: 6px 10px;
    background: var(--white-translucent-light);
    border-radius: 4px;
    border: 1px solid var(--white-translucent-inline);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.active-quiz-info-inline .info-item strong {
    color: var(--gold);
    font-weight: 500;
    text-align: center !important;
}


@keyframes popIn {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(0.8); }
}
