/**
 * Practice Questions v2 Styles
 * Modern, responsive interface for practice questions
 */

/* ============================================
   Practice Page Layout
   ============================================ */

.practice-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f7fa;
}

.practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.practice-header__logo img {
    height: 60px;
}

.practice-header__filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.practice-filter-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.practice-filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.practice-filter-btn--active {
    background: white;
    color: #368BC1;
    border-color: white;
    font-weight: 600;
}

.practice-header__actions {
    display: flex;
    gap: 1rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   Main App Container
   ============================================ */

.practice-app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.practice-main {
    display: flex;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem;
    box-sizing: border-box;
    overflow: visible;
}

/* ============================================
   Loading Indicator
   ============================================ */

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 9999;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #368BC1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Question List Sidebar
   ============================================ */

.practice-sidebar {
    flex: 0 0 280px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* ============================================
   Question Content Area
   ============================================ */

.practice-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.question {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 900px;
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.question__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    overflow: visible;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    gap: 1rem;
}

.question__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.question__category-container {
    flex: 1;
    min-width: 0;
}

.question__meta h2 {
    display: block;
    margin: 0;
    color: #368BC1;
    font-size: 1.5rem;
    word-wrap: break-word;
}

.question__position-container {
    flex-shrink: 0;
    white-space: nowrap;
}

.question__id {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.question__position-container {
    display: flex;
    align-items: center;
    color: #495057;
    font-size: 1rem;
    font-weight: 700;
    margin-left: auto;
    margin-right: 1rem;
    height: 48px;
    gap: 0.5rem;
}

.question__position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    background: #368BC1;
    color: white;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
}

.save-toggle {
    position: relative;
    width: 70px;
    height: 28px;
    background: #ced4da;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

.save-toggle:hover {
    background: #adb5bd;
}

.save-toggle.is-saved,
.save-toggle.saved {
    background: #28a745;
}

.save-toggle.is-saved:hover,
.save-toggle.saved:hover {
    background: #218838;
}

/* The sliding knob */
.save-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.save-toggle.is-saved::before,
.save-toggle.saved::before {
    transform: translateX(42px);
}

/* Hide icon */
.save-toggle__icon {
    display: none;
}

/* Label text */
.save-toggle__label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    pointer-events: none;
    left: 32px;
    color: #368BC1;
}

.save-toggle.is-saved .save-toggle__label,
.save-toggle.saved .save-toggle__label {
    left: 6px;
    color: #fff;
}

.save-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Swipe hint for mobile */
.question__swipe-hint {
    display: none;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin: 0.25rem 0;
    width: 100%;
}

@media (max-width: 640px) {
    .question__swipe-hint {
        display: block;
    }
}

/* Actions container (save + note buttons) */
.question__actions {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    overflow: visible;
}

/* Tooltips - now using global /css/components/tooltips.css */
/* Disabled state for tooltips */
[data-tooltip]:disabled::before,
[data-tooltip]:disabled::after {
    display: none;
}

.question__note-container {
    position: relative;
}

.question__report-container {
    position: relative;
}

/* Note Toggle */
.note-toggle {
    position: relative;
    width: 70px;
    height: 28px;
    background: #368BC1;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.note-toggle:hover {
    background: #2a6d96;
}

.note-toggle.has-note {
    background: #ffc107;
}

.note-toggle.has-note:hover {
    background: #e0a800;
}

.note-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.note-toggle__icon {
    color: white;
    display: block;
}

.note-toggle__label {
    display: none;
}

/* Note Editor (expandable textarea) */
.note-editor {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 400px;
    max-width: calc(100vw - 2rem);
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-editor__title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.note-editor__textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.note-editor__textarea:focus {
    outline: none;
    border-color: #368BC1;
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.1);
}

.note-editor__textarea:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.note-editor__buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.note-editor__button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-editor__button--save {
    background: #368BC1;
    color: white;
}

.note-editor__button--save:hover:not(:disabled) {
    background: #2a6d96;
}

.note-editor__button--cancel {
    background: #6c757d;
    color: white;
}

.note-editor__button--cancel:hover:not(:disabled) {
    background: #545b62;
}

.note-editor__button--delete {
    background: #dc3545;
    color: white;
    margin-left: auto;
}

.note-editor__button--delete:hover:not(:disabled) {
    background: #c82333;
}

.note-editor__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Report Toggle */
.report-toggle {
    position: relative;
    width: 70px;
    height: 28px;
    background: #dc3545;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.report-toggle:hover {
    background: #c82333;
}

.report-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.report-toggle__icon {
    color: white;
    display: block;
}

/* Report Form (expandable dropdown) */
.report-form {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 400px;
    max-width: calc(100vw - 2rem);
    padding: 1.25rem;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: slideDown 0.3s ease;
}

.report-form__title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.report-form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.report-form__select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.report-form__select:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.report-form__select:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.report-form__textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.report-form__textarea:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.report-form__textarea:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.report-form__buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.report-form__button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-form__button--submit {
    background: #dc3545;
    color: white;
    flex: 1;
}

.report-form__button--submit:hover:not(:disabled) {
    background: #c82333;
}

.report-form__button--cancel {
    background: #6c757d;
    color: white;
}

.report-form__button--cancel:hover:not(:disabled) {
    background: #545b62;
}

.report-form__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Question Body
   ============================================ */

.question__body-wrapper {
    margin-bottom: 2rem;
}

.question__body {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.question__text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #212529;
    flex: 1;
}

.question__image {
    margin: 1rem 0;
    text-align: center;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.question__image img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                z-index 0s;
    position: relative;
    z-index: 1;
    object-fit: contain;
}

.question__image img:hover {
    transform: scale(1.02);
}

/* Zoom indicator overlay */
.question__image::after {
    content: '';
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.question__image:hover::after {
    opacity: 1;
}

/* ============================================
   Image Lightbox Modal
   ============================================ */

.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.image-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-lightbox-overlay.active .image-lightbox-content {
    transform: scale(1);
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
    object-fit: contain;
}

.image-lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.image-lightbox-hint {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    white-space: nowrap;
}

/* Mobile adjustments for lightbox */
@media (max-width: 768px) {
    .image-lightbox-overlay {
        padding: 0;
    }

    .image-lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100%;
        height: 100%;
    }

    .image-lightbox-content img {
        max-width: 100%;
        max-height: calc(100vh - 80px);
        border-radius: 0;
    }

    .image-lightbox-close {
        position: fixed;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.6);
        z-index: 100001;
    }

    .image-lightbox-hint {
        position: fixed;
        bottom: 20px;
        font-size: 13px;
    }

    /* Hide zoom indicator on mobile - it will open on tap */
    .question__image::after {
        opacity: 0.6;
    }
}

.question__annex {
    margin: 1rem 0;
}

.question__annex img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   Answers
   ============================================ */

.question__answers {
    margin-bottom: 2rem;
}

.question__answers .btn {
    display: block;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--theme {
    background: #368BC1 !important;
    color: white !important;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(54, 139, 193, 0.3);
}

.btn--theme:hover:not(:disabled) {
    background: #2a6d96 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(54, 139, 193, 0.3);
}

.btn--theme:active:not(:disabled) {
    transform: translateY(0);
}

.btn--theme:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.answer {
    display: flex;
    align-items: flex-center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer:hover {
    background: #e9ecef;
    border-color: #368BC1;
}

.answer__input {
    flex: 0 0 auto;
    margin: 0.25rem 0 0 0;
}

.answer__letter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 0.75rem;
    background: #e9ecef;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    transition: all 0.2s ease;
}

.answer:hover .answer__letter {
    background: #368BC1;
    color: #fff;
}

.answer:has(.answer__input:checked) .answer__letter {
    background: #368BC1;
    color: #fff;
}

.answer--correct .answer__letter {
    background: #28a745;
    color: #fff;
}

.answer--incorrect .answer__letter {
    background: #dc3545;
    color: #fff;
}

.answer__text {
    flex: 1;
}

.answer:has(.answer__input:checked) .answer__text {
    font-weight: 600;
    color: #368BC1;
}

.answer.correct,
.answer--correct {
    background: #d4edda;
    border-color: #28a745;
}

.answer.incorrect,
.answer--incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.answer.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   Explanation
   ============================================ */

.question__explanation {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-left: 5px solid #ffc107;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.15);
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.question__explanation::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #ffc107;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>');
    background-size: 18px;
    background-repeat: no-repeat;
    background-position: center;
}

.question__explanation h3 {
    margin: 0 0 1rem 0;
    color: #856404;
    font-size: 1.2rem;
    font-weight: 700;
    padding-left: 2.5rem;
}

.question__explanation-content p,
.question__explanation-content div {
    color: #212529;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.question__explanation-content ul,
.question__explanation-content ol {
    margin: 0.75rem 0 0.75rem 1.5rem;
    color: #212529;
}

.question__explanation-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.question__explanation-content strong {
    color: #856404;
    font-weight: 700;
}

.question__explanation-note {
    color: #6c757d;
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.6;
    margin: 0;
}

/* Explanation loading state (AI generation) */
.question__explanation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 1rem;
}

.question__explanation-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: explanationSpin 1s linear infinite;
}

@keyframes explanationSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.question__explanation-loading-text {
    color: #667eea;
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
}

/* Slide-down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 2000px;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .question__explanation {
        padding: 1rem;
        margin: 1rem 0;
    }

    .question__explanation h3 {
        font-size: 1.1rem;
        padding-left: 2rem;
    }

    .question__explanation-content p,
    .question__explanation-content div {
        font-size: 0.95rem;
    }

    .question__explanation::before {
        width: 28px;
        height: 28px;
        background-size: 16px;
        top: -10px;
        left: 15px;
    }

    /* Modal mobile styles */
    .modal-overlay {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        padding: 1.25rem;
        width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
        margin: 1rem auto;
        box-sizing: border-box;
        max-height: none;
    }

    .modal-content h2,
    .modal-title {
        font-size: 1.25rem;
    }

    .modal-actions {
        flex-direction: column;
        margin-top: 1rem;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Navigation
   ============================================ */

.question__navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.question__goto {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.question__goto-input {
    width: 100px;
    padding: 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.question__goto-input:focus {
    outline: none;
    border-color: #368BC1;
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.1);
}

.question__goto-input:hover {
    border-color: #368BC1;
}

/* Remove number input spinners */
.question__goto-input::-webkit-outer-spin-button,
.question__goto-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.question__goto-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.question__navigation button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: #368BC1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.question__navigation button:hover:not(:disabled) {
    background: #2a6d99;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.question__navigation button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Override btn--secondary gray color for navigation Previous button - keep it blue */
.question__navigation > .btn--secondary,
.question__navigation .btn--nav-prev {
    background: #368BC1 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(54, 139, 193, 0.3) !important;
}

.question__navigation > .btn--secondary:hover:not(:disabled),
.question__navigation .btn--nav-prev:hover:not(:disabled) {
    background: #2a6d99 !important;
    box-shadow: 0 4px 8px rgba(54, 139, 193, 0.4) !important;
}

/* Previous button arrow styling (exclude GO button in goto container) */
.question__navigation > .btn--secondary::before {
    content: '←';
    font-size: 1.25rem;
    font-weight: 700;
    transition: transform 0.2s ease;
    display: inline-block;
}

.question__navigation > .btn--secondary:hover:not(:disabled)::before {
    transform: translateX(-3px);
}

/* Next button arrow styling */
.question__navigation .btn--primary::after {
    content: '→';
    font-size: 1.25rem;
    font-weight: 700;
    transition: transform 0.2s ease;
    display: inline-block;
}

.question__navigation .btn--primary:hover:not(:disabled)::after {
    transform: translateX(3px);
}

/* ============================================
   Progress Bar
   ============================================ */

.question__progress-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
}

.progress-bar__track {
    width: 100%;
    height: 50px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar__fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    min-width: 0;
}

.progress-bar__text {
    color: #212529;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

.progress-bar__text--left {
    left: 1rem;
}

.progress-bar__text--right {
    right: 1rem;
}

.progress-bar__text--center {
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================
   Loading Skeleton
   ============================================ */

.skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton__header {
    height: 60px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.skeleton__text {
    height: 20px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton__answers {
    margin-top: 2rem;
}

.skeleton__answer {
    height: 60px;
    background: #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #368BC1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet: Subject name appears above other header elements, position on left */
@media (min-width: 768px) and (max-width: 1024px) {
    .question__header {
        flex-wrap: wrap;
    }

    .question__meta {
        flex-basis: 100%;
        order: -1;
        margin-bottom: 0.75rem;
    }

    .question__meta h2 {
        font-size: 1.25rem;
    }

    .question__position-container {
        order: 0;
        margin-left: 0;
        margin-right: auto;
    }

    .question__actions {
        order: 1;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .practice-header__actions {
        display: none;
    }

    .practice-main {
        flex-direction: column;
        padding: 1rem;
    }

    .practice-sidebar {
        flex: 0 0 auto;
        max-height: none;
        margin-bottom: 1rem;
    }

    .question {
        padding: 0.75rem 1rem;
    }

    .question__navigation {
        flex-direction: column;
    }

    /* Hide Previous/Next buttons on mobile - using swipe gestures instead */
    .question__navigation > .btn--secondary,
    .question__navigation > .btn--primary {
        display: none;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
    }

    /* Ensure all buttons have minimum 44px height for touch targets */
    .question__navigation button,
    .btn,
    .practice-filter-btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }

    .question__goto-input {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .practice-header {
        padding: 0.75rem 1rem;
    }

    .practice-header__logo img {
        height: 40px;
    }

    .question {
        padding: 0.75rem 1rem;
    }

    .answer {
        padding: 0.75rem 1rem;
    }

    .question__meta {
        align-items: flex-start;
    }
}

/* ============================================
   Embedded Practice (within main layout)
   ============================================ */

.practice-app-wrapper {
    min-height: calc(100vh - 100px);
    padding: 0rem;
}

.practice-app-wrapper .practice-main {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
}

.practice-app-wrapper .practice-content {
    flex: 1;
    background: transparent;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.practice-app-wrapper .practice-content .question {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.practice-app-wrapper .practice-sidebar {
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
}

.practice-app-wrapper .loading-indicator {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.practice-app-wrapper .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #368BC1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Progress Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
    pointer-events: auto !important;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-content h2,
.modal-title {
    margin: 0 0 1rem 0;
    color: #dc3545;
    font-size: 1.5rem;
}

.modal-content p,
.modal-body {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-content strong {
    color: #dc3545;
    font-weight: 700;
}

.modal-content__question {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-actions .btn--secondary {
    background: #6c757d;
    color: white;
}

.modal-actions .btn--secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.modal-actions .btn--danger {
    background: #dc3545;
    color: white;
}

.modal-actions .btn--danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Saved Practice Session Indicator */
.practice-session-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #368BC1;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.practice-session-exit {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.practice-session-exit:hover {
    background: #dc3545;
    color: white;
}

/* Enhanced Saved Practice Session Styling */
.practice-header--saved-session {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.practice-session-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    color: #d68910;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid #f39c12;
}

.practice-session-indicator::before {
    content: '⭐';
    font-size: 1.25rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.practice-content--saved-session {
    background: linear-gradient(to bottom, rgba(241, 196, 15, 0.05) 0%, transparent 100%);
}

.question-card--saved-session {
    border-left: 4px solid #f39c12;
    box-shadow: 0 2px 12px rgba(243, 156, 18, 0.1);
}

.saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.75rem;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}
.saved-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #f1c40f;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.75rem;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}
/* ============================================
   Annex PDF Modal
   ============================================ */

/* Annex button styling */
.question__annex {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.question__annex-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.question__annex-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Modal overlay */
.annex-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.annex-modal-overlay--visible {
    opacity: 1;
}

/* Modal container */
.annex-modal {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 95%;
    height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.annex-modal-overlay--visible .annex-modal {
    transform: scale(1);
}

/* Modal header */
.annex-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: white;
    z-index: 1;
}

.annex-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.annex-modal-title svg {
    width: 28px;
    height: 28px;
    stroke: #368BC1;
    flex-shrink: 0;
}

.annex-modal-question {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: baseline;
    min-width: 0;
}

.annex-modal-question-id {
    font-size: 1rem;
    font-weight: 700;
    color: #368BC1;
    flex-shrink: 0;
}

.annex-modal-question-text {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
    flex: 1;
}

/* Close button */
.annex-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.annex-modal-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

/* Modal body with PDF iframe */
.annex-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

/* Loading spinner */
.annex-modal-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    z-index: 10;
}

.annex-modal-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top-color: #368BC1;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.annex-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .annex-modal-overlay {
        padding: 1rem;
    }

    .annex-modal {
        width: 100%;
        height: 95vh;
        border-radius: 8px;
    }

    .annex-modal-header {
        padding: 1rem;
    }

    .annex-modal-title {
        gap: 0.5rem;
    }

    .annex-modal-title svg {
        width: 24px;
        height: 24px;
    }

    .annex-modal-question-id {
        font-size: 0.9rem;
    }

    .annex-modal-question-text {
        font-size: 0.85rem;
    }

    .annex-modal-close {
        margin-left: 0.5rem;
    }

    .question__annex-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Mobile Optimization (≤640px) */
@media (max-width: 640px) {
    .content {
        padding: 5rem 0 0;
    }

    .practice-main {
        padding: 0;
        gap: 0;
    }

    .question {
        border-radius: 0;
        box-shadow: none;
        padding: 1rem;
    }

    /* Pre-rendered questions for smooth transitions */
    #question-view {
        overflow-x: hidden;
        overflow-y: visible;
        position: relative;
        min-height: 100vh;
    }

    .question-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        opacity: 1;
        pointer-events: none;
        transform: translateX(0);
        will-change: transform, opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .question__goto-input {
        min-width: 200px;
    }

    /* Hide prev/next buttons on mobile - use swipe instead */
    .btn--nav-prev,
    .btn--nav-next {
        display: none !important;
    }

    /* Center the Go To input on mobile */
    .question__navigation {
        justify-content: center;
    }

    /* Swipeable content container - carousel effect */
    .question {
        overflow: hidden;
    }

    .question__swipeable-content {
        transition: transform 0.3s ease, opacity 0.3s ease;
        will-change: transform, opacity;
    }

    .question__id {
        display: none;
    }

    .question-container.active {
        position: absolute;
        opacity: 1;
        pointer-events: auto;
        z-index: 2;
    }

    .question-container.dragging {
        transition: none;
    }

    .question-container.next-question {
        z-index: 1;
    }

    .question-container.prev-question {
        z-index: 1;
    }

    .question {
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .question.swipe-left-enter {
        animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .question.swipe-right-enter {
        animation: slideInFromLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .question.swipe-left-exit {
        animation: slideOutToLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
    }

    .question.swipe-right-exit {
        animation: slideOutToRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
    }

    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideInFromLeft {
        from {
            transform: translateX(-100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOutToLeft {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(-100%);
            opacity: 0;
        }
    }

    @keyframes slideOutToRight {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }

    .question__header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .question__actions {
        flex-basis: 100%;
        justify-content: center;
    }

    .question__meta {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
    }

    .question__category-container {
        flex: 1;
        min-width: 0;
    }

    .question__position-container * {
        font-size: 0;
    }

    .question__position-container {
        font-size: 0.9rem;
        flex-shrink: 0;
        align-items: flex-start;
        height: auto;
    }

    .question__meta h2 {
        font-size: 1rem;
    }
    
    .question__position-badge {
        min-width: 20px;
        height: 20px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 500;
    }

    .note-editor {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 360%;
        max-width: 1000px;
        animation: none;
    }

    .report-form {
        position: fixed;
        top: 43%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        max-width: 1000px;
        animation: none;
    }

    /* Modal mobile styles for small screens */
    .modal-overlay {
        padding: 0.5rem;
        align-items: center;
        overflow-y: auto;
    }

    .modal-content {
        padding: 2rem;
        width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
        box-sizing: border-box;
        transform: none !important;
    }

    .modal-overlay.show .modal-content {
        transform: none !important;
    }

    .modal-content h2,
    .modal-title {
        font-size: 1.25rem !important;
        margin: 0 0 0.75rem 0 !important;
    }

    .modal-content p,
    .modal-body {
        font-size: 1rem !important;
        margin: 0 0 1rem 0 !important;
        line-height: 1.5 !important;
    }

    .modal-actions {
        margin-top: 1rem !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .answer__text {
        font-size: 1rem;
    }

    .question__text {
        font-size: 1rem;
    }



    .modal-actions .btn {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .modal-actions .btn--secondary,
    .modal-actions .btn--danger {
        display: block !important;
    }

    .question__position-container {
        margin-right: 0;
    }
}

/* Print hiding */
@media print {
    .annex-modal-overlay {
        display: none;
    }
}

/* ============================================
   Swipe Tooltip (mobile only)
   ============================================ */

.swipe-tooltip {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: swipe-tooltip-bounce 2s ease-in-out infinite;
}

.swipe-tooltip.visible {
    display: block;
}

.swipe-tooltip__content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.swipe-tooltip__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    flex-shrink: 0;
}

.swipe-tooltip__icon svg {
    width: 20px;
    height: 20px;
    animation: swipe-icon-move 1.5s ease-in-out infinite;
}

.swipe-tooltip__text {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.swipe-tooltip__dismiss {
    background: #368BC1;
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.swipe-tooltip__dismiss:hover {
    background: #2a6d96;
}

@keyframes swipe-tooltip-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

@keyframes swipe-icon-move {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* Only show on mobile */
@media (min-width: 641px) {
    .swipe-tooltip {
        display: none !important;
    }
}

/* ============================================
   Show Explanation Button (after correct answer)
   ============================================ */

.show-explanation-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 8px !important;
    color: #0369a1 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
    transform: none !important;
    box-shadow: none !important;
}

.show-explanation-btn:hover {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #0369a1 !important;
    transform: none !important;
    box-shadow: none !important;
}

.show-explanation-btn:active {
    background: #bfdbfe !important;
}

.show-explanation-btn svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.show-explanation-btn span {
    vertical-align: middle;
}

.show-explanation-btn--active {
    background: #e0f2fe !important;
    border-color: #38bdf8 !important;
    color: #0c4a6e !important;
}

.show-explanation-btn--active:hover {
    background: #bae6fd !important;
    border-color: #38bdf8 !important;
}

/* ============================================
   Compact Filter Bar (Mode Indicator)
   ============================================ */

.practice-filter-bar {
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #368BC1;
    min-height: 0;
    border-radius: 6px;
}

.practice-filter-bar:empty {
    display: none;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.filter-bar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.filter-bar__back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.filter-bar__back svg {
    stroke: currentColor;
}

.filter-bar__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--badge-color, #6366f1);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.filter-bar__badge--saved {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
}

.filter-bar__icon {
    font-size: 0.9rem;
    line-height: 1;
}

.filter-bar__clear {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-bar__clear:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.filter-bar__exit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(220, 53, 69, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
}

.filter-bar__exit:hover {
    background: #dc3545;
}

/* Session indicator variant */
.filter-bar--session {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.filter-bar--session .filter-bar__badge {
    background: transparent;
    color: white;
    padding-left: 0;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .filter-bar {
        padding: 0.2rem;
    }

    .filter-bar__badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .filter-bar__clear {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .filter-bar__back {
        width: 24px;
        height: 24px;
    }

    .filter-bar__back svg {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   Deck Toggle Button
   ============================================ */

.question__deck-container {
    position: relative;
}

.deck-toggle {
    position: relative;
    width: 70px;
    height: 28px;
    background: #17a2b8;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.deck-toggle:hover {
    background: #138496;
}

.deck-toggle--has-decks {
    background: #28a745;
}

.deck-toggle--has-decks:hover {
    background: #218838;
}

.deck-toggle__icon {
    color: white;
    display: block;
}

.deck-toggle__icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.deck-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Deck Selection Modal
   ============================================ */

.deck-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.deck-modal.active {
    opacity: 1;
    visibility: visible;
}

.deck-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.deck-modal__container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.deck-modal.active .deck-modal__container {
    transform: translateY(0);
}

.deck-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.deck-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.deck-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.deck-modal__close:hover {
    background: #f8f9fa;
    color: #212529;
}

.deck-modal__close svg {
    width: 20px;
    height: 20px;
}

.deck-modal__body {
    flex: 1;
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.deck-modal__empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.deck-modal__empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.deck-modal__empty p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.deck-modal__empty a {
    color: #368BC1;
    text-decoration: none;
}

.deck-modal__empty a:hover {
    text-decoration: underline;
}

.deck-modal__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.deck-modal__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-modal__item:hover {
    background: #e9ecef;
}

.deck-modal__item--selected {
    background: #e8f4fc;
    border-color: #368BC1;
}

.deck-modal__checkbox {
    width: 18px;
    height: 18px;
    accent-color: #368BC1;
    cursor: pointer;
}

.deck-modal__item-content {
    flex: 1;
    min-width: 0;
}

.deck-modal__item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.15rem;
}

.deck-modal__item-count {
    font-size: 0.8rem;
    color: #6c757d;
}

.deck-modal__footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .deck-modal__container {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ============================================================================
   DARK MODE STYLES
   ============================================================================ */

/* Force dark mode */

/* Practice Page Layout */
html.dark-mode .practice-page {
    background: #13161b !important;
}

/* Practice Header */
html.dark-mode .practice-header {
    background: transparent !important;
}

html.dark-mode .practice-filter-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f3f4f6 !important;
    border-color: transparent !important;
}

html.dark-mode .practice-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

html.dark-mode .practice-filter-btn--active {
    background: #4a9ed4 !important;
    color: #ffffff !important;
    border-color: #4a9ed4 !important;
}

/* Loading Indicator */
html.dark-mode .loading-indicator {
    background: #1a1d23 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    color: #f3f4f6 !important;
}

html.dark-mode .spinner {
    border-color: #363c47 !important;
    border-top-color: #4a9ed4 !important;
}

/* Question List Sidebar */
html.dark-mode .practice-sidebar {
    background: #1a1d23 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Question Content Area */
html.dark-mode .question {
    background: #1a1d23 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode .question__header {
    border-bottom-color: #363c47 !important;
}

html.dark-mode .question__meta h2 {
    color: #4a9ed4 !important;
}

html.dark-mode .question__position-container {
    color: #f3f4f6 !important;
}

html.dark-mode .question__swipe-hint {
    color: #6b7280 !important;
}

/* Save Toggle */
html.dark-mode .save-toggle {
    background: #363c47 !important;
}

html.dark-mode .save-toggle:hover {
    background: #4a5568 !important;
}

html.dark-mode .save-toggle.is-saved,
html.dark-mode .save-toggle.saved {
    background: #22c55e !important;
}

html.dark-mode .save-toggle.is-saved:hover,
html.dark-mode .save-toggle.saved:hover {
    background: #16a34a !important;
}

html.dark-mode .save-toggle__label {
    color: #4a9ed4 !important;
}

html.dark-mode .save-toggle.is-saved .save-toggle__label,
html.dark-mode .save-toggle.saved .save-toggle__label {
    color: #fff !important;
}

/* Note Editor */
html.dark-mode .note-editor {
    background: #1a1d23 !important;
    border-color: #363c47 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark-mode .note-editor__title {
    color: #f3f4f6 !important;
}

html.dark-mode .note-editor__textarea {
    background: #22262e !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .note-editor__textarea:focus {
    border-color: #4a9ed4 !important;
    box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2) !important;
}

html.dark-mode .note-editor__textarea:disabled {
    background: #2a2f38 !important;
}

/* Report Form */
html.dark-mode .report-form {
    background: #1a1d23 !important;
    border-color: #363c47 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark-mode .report-form__title {
    color: #f3f4f6 !important;
}

html.dark-mode .report-form__label {
    color: #9ca3af !important;
}

html.dark-mode .report-form__select {
    background: #22262e !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .report-form__select:focus {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

html.dark-mode .report-form__textarea {
    background: #22262e !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .report-form__textarea:focus {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

/* Question Body */
html.dark-mode .question__text {
    color: #f3f4f6 !important;
}

html.dark-mode .question__image img {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Zoom indicator in dark mode - lighter background for better visibility */
html.dark-mode .question__image::after {
    background: rgba(255, 255, 255, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f3f4f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

/* Answers */
html.dark-mode .answer {
    background: #22262e !important;
    border-color: #363c47 !important;
}

html.dark-mode .answer:hover {
    background: #2a2f38 !important;
    border-color: #4a9ed4 !important;
}

html.dark-mode .answer__text {
    color: #f3f4f6 !important;
}

html.dark-mode .answer:has(.answer__input:checked) .answer__text {
    color: #4a9ed4 !important;
}

html.dark-mode .answer__letter {
    background: #363c47 !important;
    color: #9ca3af !important;
}

html.dark-mode .answer:hover .answer__letter {
    background: #4a9ed4 !important;
    color: #fff !important;
}

html.dark-mode .answer:has(.answer__input:checked) .answer__letter {
    background: #4a9ed4 !important;
    color: #fff !important;
}

html.dark-mode .answer--correct .answer__letter {
    background: #22c55e !important;
    color: #fff !important;
}

html.dark-mode .answer--incorrect .answer__letter {
    background: #ef4444 !important;
    color: #fff !important;
}

html.dark-mode .answer.correct,
html.dark-mode .answer--correct {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: #22c55e !important;
}

html.dark-mode .answer.incorrect,
html.dark-mode .answer--incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
}

/* Explanation */
html.dark-mode .question__explanation {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
    border-left-color: #fbbf24 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

html.dark-mode .question__explanation::before {
    background: #fbbf24 !important;
}

html.dark-mode .question__explanation h3 {
    color: #fcd34d !important;
}

html.dark-mode .question__explanation-content p,
html.dark-mode .question__explanation-content div {
    color: #f3f4f6 !important;
}

html.dark-mode .question__explanation-content ul,
html.dark-mode .question__explanation-content ol {
    color: #f3f4f6 !important;
}

html.dark-mode .question__explanation-content strong {
    color: #fcd34d !important;
}

html.dark-mode .question__explanation-note {
    color: #9ca3af !important;
}

html.dark-mode .question__explanation-spinner {
    border-color: #363c47 !important;
    border-top-color: #fbbf24 !important;
}

html.dark-mode .question__explanation-loading-text {
    color: #fcd34d !important;
}

/* Navigation */
html.dark-mode .question__navigation {
    border-top-color: #363c47 !important;
}

html.dark-mode .question__goto-input {
    background: #22262e !important;
    border-color: #363c47 !important;
    color: #f3f4f6 !important;
}

html.dark-mode .question__goto-input:focus {
    border-color: #4a9ed4 !important;
    box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2) !important;
}

html.dark-mode .question__goto-input:hover {
    border-color: #4a9ed4 !important;
}

/* Override navigation Previous button - keep it blue in dark mode too */
html.dark-mode .question__navigation > .btn--secondary,
html.dark-mode .question__navigation .btn--nav-prev {
    background: #368BC1 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(54, 139, 193, 0.3) !important;
}

/* Answer/Submit button - keep it blue in dark mode */
html.dark-mode .btn--theme {
    background: #368BC1 !important;
    color: white !important;
}

html.dark-mode .btn--theme:hover:not(:disabled) {
    background: #2a6d96 !important;
}

html.dark-mode .question__navigation > .btn--secondary:hover:not(:disabled),
html.dark-mode .question__navigation .btn--nav-prev:hover:not(:disabled) {
    background: #2a6d99 !important;
    box-shadow: 0 4px 8px rgba(54, 139, 193, 0.4) !important;
}

/* Progress Bar */
html.dark-mode .progress-bar__track {
    background: #363c47 !important;
}

html.dark-mode .progress-bar__text {
    color: #f3f4f6 !important;
}

/* For unanswered questions in dark mode, keep text dark since fill is light */
html.dark-mode .progress-bar--unanswered .progress-bar__text {
    color: #374151 !important;
}

/* Loading Skeleton */
html.dark-mode .skeleton__header,
html.dark-mode .skeleton__text,
html.dark-mode .skeleton__answer {
    background: #363c47 !important;
}

/* Toast Notifications */
html.dark-mode .toast {
    background: #1a1d23 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    color: #f3f4f6 !important;
}

/* Embedded Practice */
html.dark-mode .practice-app-wrapper .practice-sidebar {
    background: #1a1d23 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode .practice-app-wrapper .loading-indicator {
    color: #9ca3af !important;
}

/* Progress Modal */
html.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

html.dark-mode .modal-content {
    background: #1a1d23 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .modal-content h2,
html.dark-mode .modal-title {
    color: #f87171 !important;
}

html.dark-mode .modal-content p,
html.dark-mode .modal-body {
    color: #d1d5db !important;
}

html.dark-mode .modal-content strong {
    color: #f87171 !important;
}

html.dark-mode .modal-content__question {
    background: #22262e !important;
    color: #9ca3af !important;
}

/* Annex Modal */
html.dark-mode .annex-modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

html.dark-mode .annex-modal {
    background: #1a1d23 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .annex-modal-header {
    background: #1a1d23 !important;
    border-bottom-color: #363c47 !important;
}

html.dark-mode .annex-modal-title svg {
    stroke: #4a9ed4 !important;
}

html.dark-mode .annex-modal-question-id {
    color: #4a9ed4 !important;
}

html.dark-mode .annex-modal-question-text {
    color: #9ca3af !important;
}

html.dark-mode .annex-modal-close {
    color: #9ca3af !important;
}

html.dark-mode .annex-modal-close:hover {
    background: #22262e !important;
    color: #f3f4f6 !important;
}

html.dark-mode .annex-modal-body {
    background: #22262e !important;
}

html.dark-mode .annex-modal-loader {
    background: #22262e !important;
}

html.dark-mode .annex-modal-spinner {
    border-color: #363c47 !important;
    border-top-color: #4a9ed4 !important;
}

/* Swipe Tooltip */
html.dark-mode .swipe-tooltip__content {
    background: rgba(26, 29, 35, 0.95) !important;
}

/* Show Explanation Button */
html.dark-mode .show-explanation-btn {
    background: rgba(74, 158, 212, 0.1) !important;
    border-color: rgba(74, 158, 212, 0.3) !important;
    color: #4a9ed4 !important;
}

html.dark-mode .show-explanation-btn:hover {
    background: rgba(74, 158, 212, 0.2) !important;
    border-color: rgba(74, 158, 212, 0.5) !important;
    color: #4a9ed4 !important;
}

html.dark-mode .show-explanation-btn--active {
    background: rgba(74, 158, 212, 0.15) !important;
    border-color: #4a9ed4 !important;
    color: #4a9ed4 !important;
}

/* Compact Filter Bar */
html.dark-mode .practice-filter-bar {
    background: #4a9ed4 !important;
}

/* Deck Modal */
html.dark-mode .deck-modal__backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}

html.dark-mode .deck-modal__container {
    background: #1a1d23 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .deck-modal__header {
    border-bottom-color: #363c47 !important;
}

html.dark-mode .deck-modal__title {
    color: #f3f4f6 !important;
}

html.dark-mode .deck-modal__close {
    color: #9ca3af !important;
}

html.dark-mode .deck-modal__close:hover {
    background: #22262e !important;
    color: #f3f4f6 !important;
}

html.dark-mode .deck-modal__empty {
    color: #9ca3af !important;
}

html.dark-mode .deck-modal__empty a {
    color: #4a9ed4 !important;
}

html.dark-mode .deck-modal__item {
    background: #22262e !important;
    border-color: transparent !important;
}

html.dark-mode .deck-modal__item:hover {
    background: #2a2f38 !important;
}

html.dark-mode .deck-modal__item--selected {
    background: rgba(74, 158, 212, 0.15) !important;
    border-color: #4a9ed4 !important;
}

html.dark-mode .deck-modal__item-name {
    color: #f3f4f6 !important;
}

html.dark-mode .deck-modal__item-count {
    color: #9ca3af !important;
}

html.dark-mode .deck-modal__footer {
    border-top-color: #363c47 !important;
}

/* ============================================================================
   AUTO DARK MODE (System Preference)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    /* Practice Page Layout */
    html.dark-mode-auto .practice-page {
        background: #13161b !important;
    }

    /* Practice Header */
    html.dark-mode-auto .practice-header {
        background: transparent !important;
    }

    html.dark-mode-auto .practice-filter-btn {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #f3f4f6 !important;
        border-color: transparent !important;
    }

    html.dark-mode-auto .practice-filter-btn:hover {
        background: rgba(255, 255, 255, 0.2) !important;
    }

    html.dark-mode-auto .practice-filter-btn--active {
        background: #4a9ed4 !important;
        color: #ffffff !important;
        border-color: #4a9ed4 !important;
    }

    /* Loading Indicator */
    html.dark-mode-auto .loading-indicator {
        background: #1a1d23 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .spinner {
        border-color: #363c47 !important;
        border-top-color: #4a9ed4 !important;
    }

    /* Question List Sidebar */
    html.dark-mode-auto .practice-sidebar {
        background: #1a1d23 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    /* Question Content Area */
    html.dark-mode-auto .question {
        background: #1a1d23 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    html.dark-mode-auto .question__header {
        border-bottom-color: #363c47 !important;
    }

    html.dark-mode-auto .question__meta h2 {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .question__position-container {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .question__swipe-hint {
        color: #6b7280 !important;
    }

    /* Save Toggle */
    html.dark-mode-auto .save-toggle {
        background: #363c47 !important;
    }

    html.dark-mode-auto .save-toggle:hover {
        background: #4a5568 !important;
    }

    html.dark-mode-auto .save-toggle.is-saved,
    html.dark-mode-auto .save-toggle.saved {
        background: #22c55e !important;
    }

    html.dark-mode-auto .save-toggle__label {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .save-toggle.is-saved .save-toggle__label,
    html.dark-mode-auto .save-toggle.saved .save-toggle__label {
        color: #fff !important;
    }

    /* Note Editor */
    html.dark-mode-auto .note-editor {
        background: #1a1d23 !important;
        border-color: #363c47 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }

    html.dark-mode-auto .note-editor__title {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .note-editor__textarea {
        background: #22262e !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .note-editor__textarea:focus {
        border-color: #4a9ed4 !important;
        box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2) !important;
    }

    /* Report Form */
    html.dark-mode-auto .report-form {
        background: #1a1d23 !important;
        border-color: #363c47 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }

    html.dark-mode-auto .report-form__title {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .report-form__label {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .report-form__select {
        background: #22262e !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .report-form__textarea {
        background: #22262e !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    /* Question Body */
    html.dark-mode-auto .question__text {
        color: #f3f4f6 !important;
    }

    /* Answers */
    html.dark-mode-auto .answer {
        background: #22262e !important;
        border-color: #363c47 !important;
    }

    html.dark-mode-auto .answer:hover {
        background: #2a2f38 !important;
        border-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .answer__text {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .answer:has(.answer__input:checked) .answer__text {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .answer__letter {
        background: #363c47 !important;
        color: #9ca3af !important;
    }

    html.dark-mode-auto .answer:hover .answer__letter {
        background: #4a9ed4 !important;
        color: #fff !important;
    }

    html.dark-mode-auto .answer:has(.answer__input:checked) .answer__letter {
        background: #4a9ed4 !important;
        color: #fff !important;
    }

    html.dark-mode-auto .answer--correct .answer__letter {
        background: #22c55e !important;
        color: #fff !important;
    }

    html.dark-mode-auto .answer--incorrect .answer__letter {
        background: #ef4444 !important;
        color: #fff !important;
    }

    html.dark-mode-auto .answer.correct,
    html.dark-mode-auto .answer--correct {
        background: rgba(34, 197, 94, 0.15) !important;
        border-color: #22c55e !important;
    }

    html.dark-mode-auto .answer.incorrect,
    html.dark-mode-auto .answer--incorrect {
        background: rgba(239, 68, 68, 0.15) !important;
        border-color: #ef4444 !important;
    }

    /* Explanation */
    html.dark-mode-auto .question__explanation {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
        border-left-color: #fbbf24 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

    html.dark-mode-auto .question__explanation::before {
        background: #fbbf24 !important;
    }

    html.dark-mode-auto .question__explanation h3 {
        color: #fcd34d !important;
    }

    html.dark-mode-auto .question__explanation-content p,
    html.dark-mode-auto .question__explanation-content div {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .question__explanation-content strong {
        color: #fcd34d !important;
    }

    html.dark-mode-auto .question__explanation-note {
        color: #9ca3af !important;
    }

    /* Navigation */
    html.dark-mode-auto .question__navigation {
        border-top-color: #363c47 !important;
    }

    html.dark-mode-auto .question__goto-input {
        background: #22262e !important;
        border-color: #363c47 !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .question__goto-input:focus {
        border-color: #4a9ed4 !important;
        box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2) !important;
    }

    /* Override navigation Previous button - keep it blue in dark mode too */
    html.dark-mode-auto .question__navigation > .btn--secondary,
    html.dark-mode-auto .question__navigation .btn--nav-prev {
        background: #368BC1 !important;
        color: white !important;
        box-shadow: 0 2px 4px rgba(54, 139, 193, 0.3) !important;
    }

    html.dark-mode-auto .question__navigation > .btn--secondary:hover:not(:disabled),
    html.dark-mode-auto .question__navigation .btn--nav-prev:hover:not(:disabled) {
        background: #2a6d99 !important;
        box-shadow: 0 4px 8px rgba(54, 139, 193, 0.4) !important;
    }

    /* Answer/Submit button - keep it blue in dark mode */
    html.dark-mode-auto .btn--theme {
        background: #368BC1 !important;
        color: white !important;
    }

    html.dark-mode-auto .btn--theme:hover:not(:disabled) {
        background: #2a6d96 !important;
    }

    /* Progress Bar */
    html.dark-mode-auto .progress-bar__track {
        background: #363c47 !important;
    }

    html.dark-mode-auto .progress-bar__text {
        color: #f3f4f6 !important;
    }

    /* For unanswered questions in dark mode, keep text dark since fill is light */
    html.dark-mode-auto .progress-bar--unanswered .progress-bar__text {
        color: #374151 !important;
    }

    /* Loading Skeleton */
    html.dark-mode-auto .skeleton__header,
    html.dark-mode-auto .skeleton__text,
    html.dark-mode-auto .skeleton__answer {
        background: #363c47 !important;
    }

    /* Toast Notifications */
    html.dark-mode-auto .toast {
        background: #1a1d23 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
        color: #f3f4f6 !important;
    }

    /* Embedded Practice */
    html.dark-mode-auto .practice-app-wrapper .practice-sidebar {
        background: #1a1d23 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    html.dark-mode-auto .practice-app-wrapper .loading-indicator {
        color: #9ca3af !important;
    }

    /* Progress Modal */
    html.dark-mode-auto .modal-overlay {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    html.dark-mode-auto .modal-content {
        background: #1a1d23 !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    }

    html.dark-mode-auto .modal-content h2,
    html.dark-mode-auto .modal-title {
        color: #f87171 !important;
    }

    html.dark-mode-auto .modal-content p,
    html.dark-mode-auto .modal-body {
        color: #d1d5db !important;
    }

    html.dark-mode-auto .modal-content strong {
        color: #f87171 !important;
    }

    html.dark-mode-auto .modal-content__question {
        background: #22262e !important;
        color: #9ca3af !important;
    }

    /* Annex Modal */
    html.dark-mode-auto .annex-modal-overlay {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    html.dark-mode-auto .annex-modal {
        background: #1a1d23 !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    }

    html.dark-mode-auto .annex-modal-header {
        background: #1a1d23 !important;
        border-bottom-color: #363c47 !important;
    }

    html.dark-mode-auto .annex-modal-title svg {
        stroke: #4a9ed4 !important;
    }

    html.dark-mode-auto .annex-modal-question-id {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .annex-modal-question-text {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .annex-modal-close {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .annex-modal-close:hover {
        background: #22262e !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .annex-modal-body {
        background: #22262e !important;
    }

    html.dark-mode-auto .annex-modal-loader {
        background: #22262e !important;
    }

    html.dark-mode-auto .annex-modal-spinner {
        border-color: #363c47 !important;
        border-top-color: #4a9ed4 !important;
    }

    /* Show Explanation Button */
    html.dark-mode-auto .show-explanation-btn {
        background: rgba(74, 158, 212, 0.1) !important;
        border-color: rgba(74, 158, 212, 0.3) !important;
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .show-explanation-btn:hover {
        background: rgba(74, 158, 212, 0.2) !important;
        border-color: rgba(74, 158, 212, 0.5) !important;
        color: #4a9ed4 !important;
    }

    /* Compact Filter Bar */
    html.dark-mode-auto .practice-filter-bar {
        background: #4a9ed4 !important;
    }

    /* Deck Modal */
    html.dark-mode-auto .deck-modal__backdrop {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    html.dark-mode-auto .deck-modal__container {
        background: #1a1d23 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    }

    html.dark-mode-auto .deck-modal__header {
        border-bottom-color: #363c47 !important;
    }

    html.dark-mode-auto .deck-modal__title {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .deck-modal__close {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .deck-modal__close:hover {
        background: #22262e !important;
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .deck-modal__empty {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .deck-modal__empty a {
        color: #4a9ed4 !important;
    }

    html.dark-mode-auto .deck-modal__item {
        background: #22262e !important;
        border-color: transparent !important;
    }

    html.dark-mode-auto .deck-modal__item:hover {
        background: #2a2f38 !important;
    }

    html.dark-mode-auto .deck-modal__item--selected {
        background: rgba(74, 158, 212, 0.15) !important;
        border-color: #4a9ed4 !important;
    }

    html.dark-mode-auto .deck-modal__item-name {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .deck-modal__item-count {
        color: #9ca3af !important;
    }

    html.dark-mode-auto .deck-modal__footer {
        border-top-color: #363c47 !important;
    }
}
