/* CSS Variables for theming */
:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: #f8f9fa;
    --bg-card: white;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: white;
    --border-color: #e0e0e0;
    --shadow: rgba(0,0,0,0.1);
    --shadow-hover: rgba(0,0,0,0.2);
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --bg-secondary: #0f0f0f;
    --bg-card: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-light: #e0e0e0;
    --border-color: #333333;
    --shadow: rgba(0,0,0,0.4);
    --shadow-hover: rgba(0,0,0,0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.rating-bar {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    background: #2c3e50;
    padding: 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    min-height: 60px;
}

.rating-tab {
    flex: 1;
    max-width: 250px;
    min-width: 0;
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 3px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.rating-tab:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.rating-tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-bottom: 3px solid #667eea;
}

.rating-tab.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.rating-tab.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.rating-tab .coming-soon {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    margin-top: 1px;
    font-style: italic;
    opacity: 0.8;
}

[data-theme="dark"] .rating-bar {
    background: #1a1a1a;
}

[data-theme="dark"] .rating-tab {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .rating-tab:not(.disabled):hover {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .rating-tab.active {
    color: white;
    border-bottom-color: #667eea;
}

.header {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.instruction-text {
    margin-top: 20px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.instruction-text p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.disclaimer {
    text-align: center;
    padding: 20px;
    margin: 30px auto 20px;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.disclaimer p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

[data-theme="dark"] .disclaimer {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 193, 7, 0.4);
}

.donation-section {
    text-align: center;
    padding: 25px;
    margin: 20px auto 30px;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.4);
}

.donation-section p {
    margin: 8px 0;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
}

.donation-section p:first-child {
    font-weight: 600;
    font-size: 1.1rem;
}

.donation-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.donation-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4092 100%);
}

[data-theme="dark"] .donation-section {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.area-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    height: 308px;
    min-height: 308px;
}

.area-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-hover);
    border-color: #667eea;
}

[data-theme="dark"] .area-card:hover {
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.supplemental-card {
    background: var(--bg-secondary);
    border: 3px solid #6c757d;
}

[data-theme="dark"] .supplemental-card {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border-color: #6c757d;
}

.supplemental-card:hover {
    border-color: #667eea;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.supplemental-card h3 {
    color: #495057;
}

[data-theme="dark"] .supplemental-card h3 {
    color: #e0e0e0;
}

[data-theme="dark"] .supplemental-card p {
    color: var(--text-secondary);
}

.supplemental-card .area-number {
    background: #6c757d;
    color: white;
}

.area-card h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

[data-theme="dark"] .area-card h3 {
    color: #e0e0e0;
}

.area-number {
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    flex-grow: 0;
    margin-right: 15px;
    min-width: 50px;
    max-width: 50px;
}

[data-theme="dark"] .area-number {
    background: #666666;
}

.area-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.area-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    margin-top: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px var(--shadow-hover);
    animation: modalSlideIn 0.3s ease;
    color: var(--text-primary);
    position: relative;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0 0 10px 0;
}

.modal-settings {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.modal-settings .settings-icon {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    position: relative !important;
    display: inline-block !important;
    top: auto !important;
    right: auto !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
}

.modal-settings .settings-icon:hover {
    background-color: var(--bg-secondary);
}

.modal-settings .settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    min-width: 180px;
}

.modal-settings .settings-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.modal-settings .settings-item:last-child {
    border-bottom: none;
}

.modal-settings .settings-item:hover {
    background-color: var(--bg-secondary);
}

/* Summary modal specific styling */
#summaryModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    max-width: 800px;
}

/* Area reset confirmation modal - higher z-index to appear above task selection */
#areaResetConfirmationModal {
    z-index: 3000;
}

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

.modal h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.modal p {
    margin-bottom: 20px;
    text-align: center;
    color: #666;
}

.filter-info {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid var(--border-color);
}

.filter-info p {
    margin: 10px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.filter-info strong {
    color: #667eea;
    font-size: 1.2rem;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

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

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

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    align-items: center;
}

.summary-actions .btn {
    min-width: 200px;
    flex: 1;
    max-width: 250px;
}

.summary-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.summary-actions .btn:disabled:hover {
    background: var(--bg-secondary);
    transform: none;
}

.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
}

.quiz-card {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px var(--shadow-hover);
    color: var(--text-primary);
    position: relative;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.quiz-header h2 {
    margin: 0 0 0 25px;
}

#quizProgress {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.nav-arrow {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.nav-arrow:hover:not(:disabled) {
    background: var(--bg-card);
    border-color: #667eea;
    color: #667eea;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#showAnswerBtn {
    display: block;
    margin: 20px auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.question-content {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hint-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.hint-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.hint-header:hover {
    background-color: var(--bg-card);
}

.hint-icon {
    font-size: 1.1rem;
}

.hint-label {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.hint-toggle-icon {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.hint-section.expanded .hint-toggle-icon {
    transform: rotate(180deg);
}

.hint-content {
    display: none;
    padding: 16px;
    color: var(--text-primary);
    font-style: italic;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.hint-content.show {
    display: block;
}

.answer-section {
    background: var(--bg-secondary);
    border-left: 4px solid #28a745;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
    display: none;
}

.answer-section.show {
    display: block;
}

.answer-text {
    color: var(--text-primary);
    line-height: 1.6;
}

.acs-requirements {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
    margin-top: 15px;
}

.acs-requirements h4 {
    margin: 0 0 10px 0;
    color: #2196f3;
    font-size: 1rem;
}

.acs-requirement-item {
    background: var(--bg-card);
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.acs-code {
    font-weight: bold;
    color: #2196f3;
    font-family: monospace;
    font-size: 0.9rem;
}

.acs-description {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-top: 5px;
    line-height: 1.4;
}

.supplemental-requirement-item {
    background: var(--bg-secondary);
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left: 4px solid #6c757d;
}

.supplemental-requirement-item .acs-code {
    font-weight: bold;
    color: #6c757d;
    font-family: monospace;
    font-size: 0.9rem;
}

.feedback-section {
    display: none;
    text-align: center;
    margin-top: 30px;
}

.feedback-section.show {
    display: block;
}

.feedback-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}


.summary-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 30px var(--shadow);
}

.summary-header {
    margin-bottom: 30px;
}

.summary-header h2 {
    color: #667eea;
    margin: 0 0 10px 0;
}

#overallScore {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.category-results {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.category-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-score {
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
}

.score-excellent { background: #28a745; }
.score-good { background: #17a2b8; }
.score-fair { background: #ffc107; color: #212529; }
.score-poor { background: #dc3545; }

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px var(--shadow);
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-color: #dc3545;
    transform: scale(1.05);
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: white;
    border-radius: 15px;
    margin: 20px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .rating-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        min-height: 60px;
    }
    
    /* Hide desktop tabs on mobile */
    .desktop-rating-tabs {
        display: none !important;
    }
    
    /* Mobile dropdown selector */
    .mobile-rating-selector {
        display: block !important;
        position: relative;
        flex: 1;
        max-width: 200px;
    }
    
    .mobile-rating-display {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: white;
        font-weight: 500;
    }
    
    .mobile-rating-display:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: #667eea;
    }
    
    .dropdown-arrow {
        font-size: 0.8rem;
        transition: transform 0.2s ease;
    }
    
    .mobile-rating-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 12px var(--shadow);
        z-index: 1000;
        display: none;
        margin-top: 4px;
    }
    
    .mobile-rating-option {
        padding: 12px 16px;
        cursor: pointer;
        transition: background-color 0.2s ease;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-primary);
    }
    
    .mobile-rating-option:last-child {
        border-bottom: none;
    }
    
    .mobile-rating-option:hover:not(.disabled) {
        background: var(--bg-secondary);
    }
    
    .mobile-rating-option.active {
        background: #667eea;
        color: white;
    }
    
    .mobile-rating-option.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        color: var(--text-secondary);
    }
    
    .account-menu {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 300 !important;
        transform: none !important;
    }
    
    .account-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .account-dropdown {
        min-width: 200px;
        right: 0;
        /* Ensure dropdown stays within viewport on narrow screens */
        max-width: calc(100vw - 20px);
        /* Add left positioning as fallback */
        left: auto;
    }
    
    .dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .areas-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-card {
        margin: 2% auto;
        padding: 20px;
    }
    
    .feedback-buttons {
        flex-direction: column;
    }
    
    .summary-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

/* Status indicator styles */
.status-indicator {
    font-size: 1.8rem;
    margin-left: 15px;
    display: inline-block;
    transition: all 0.3s ease;
    line-height: 1;
}

/* Segmented status bar styles */
.status-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
    display: flex;
    position: relative;
}

.status-segment {
    height: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.status-segment.correct {
    background: #28a745;
}

.status-segment.partial {
    background: #ffc107;
}

.status-segment.incorrect {
    background: #dc3545;
}

.status-segment.unanswered {
    background: #6c757d;
    opacity: 0.6;
}

.status-segment.no-data {
    background: #6c757d;
    opacity: 0.6;
}

.segment-number {
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1;
    white-space: nowrap;
}

.area-card:hover .status-segment {
    opacity: 0.9;
}

/* Legacy status indicator styles - kept for supplemental knowledge */
.status-indicator.excellent {
    color: #28a745;
    text-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

.status-indicator.good {
    color: #17a2b8;
    text-shadow: 0 0 5px rgba(23, 162, 184, 0.3);
}

.status-indicator.fair {
    color: #ffc107;
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

.status-indicator.poor {
    color: #dc3545;
    text-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

.status-indicator.no-data {
    color: #6c757d;
    opacity: 0.6;
}

.status-text {
    font-weight: 600;
    color: #667eea;
}

/* Hover effects are now handled by .pie-chart:hover */

/* Task selection modal styles */
.task-selection-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.task-selection-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-secondary);
}

.task-selection-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-selection-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.task-selection-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

.task-selection-item input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.task-selection-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-selection-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: left;
}

.task-selection-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: left;
}

.task-selection-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 150px;
    justify-content: flex-end;
}

.task-selection-bar {
    width: 100px;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-shrink: 0;
}

.task-selection-segment {
    height: 100%;
    transition: all 0.3s ease;
}

.task-selection-segment.correct {
    background: #28a745;
}

.task-selection-segment.partial {
    background: #ffc107;
}

.task-selection-segment.incorrect {
    background: #dc3545;
}

.task-selection-segment.unanswered {
    background: #6c757d;
    opacity: 0.6;
}

.task-selection-segment.no-data {
    background: #6c757d;
    opacity: 0.6;
}

.task-selection-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: right;
    white-space: nowrap;
}

/* Settings dropdown menu */
.settings-menu {
    position: fixed;
    top: 45px;
    right: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 200px;
    z-index: 1001;
    display: none;
    overflow: hidden;
}

.settings-menu.show {
    display: block;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background-color: #f8f9fa;
}

.settings-icon-small {
    margin-right: 8px;
    font-size: 1rem;
}

.settings-item span:last-child {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Mobile text sizing */
@media (max-width: 768px) {
    * {
        font-size: 95% !important;
    }
    
    .quiz-header h2 {
        margin-left: 35px;
    }
    
    .task-selection-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-selection-info {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .task-selection-stats {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

/* Hide mobile elements on desktop */
.mobile-rating-selector {
    display: none;
}

/* Desktop rating tabs container */
.desktop-rating-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1;
    justify-content: center;
}

/* Account Menu Styles */
.account-menu {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
}

.account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
}

.account-icon:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: white;
}

.account-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow);
    min-width: 220px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.account-dropdown.show {
    display: block;
    animation: dropdownSlideIn 0.2s ease-out;
}

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

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

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item:hover span {
    pointer-events: none;
}

.dropdown-item span:first-child {
    font-size: 16px;
    width: 20px;
}

.dropdown-item span {
    pointer-events: none;
}

.dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    padding: 12px;
    margin-bottom: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    font-size: 14px;
}

.success-message {
    padding: 12px;
    margin-bottom: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    font-size: 14px;
}

/* Links in modals */
.modal-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.modal-content a:hover {
    text-decoration: underline;
    color: #5568d3;
}

/* Dark mode auth styles */
[data-theme="dark"] .error-message {
    background: #2d1a1f;
    color: #f8d7da;
    border-color: #5a1f27;
}

[data-theme="dark"] .success-message {
    background: #1a2d1f;
    color: #d4edda;
    border-color: #27523a;
}

[data-theme="dark"] .modal-content a {
    color: #9da9ff;
}

[data-theme="dark"] .modal-content a:hover {
    color: #b8c1ff;
}

[data-theme="dark"] .account-icon {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

[data-theme="dark"] .account-icon:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

/* Auth required overlay */
.auth-required-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 99;
    display: none;
}

.auth-required-overlay.show {
    display: block;
}

/* When overlay is active, keep header visible */
.auth-required-overlay ~ .rating-bar,
.auth-required-overlay ~ .container .header {
    position: relative;
    z-index: 100;
}

/* Blur the container content when auth is required */
body.auth-required .container .header {
    filter: none;
    pointer-events: auto;
    user-select: auto;
}

body.auth-required .container .areas-grid,
body.auth-required .container .disclaimer,
body.auth-required .container .donation-section {
    filter: blur(4px);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
}

body.auth-required .rating-bar {
    filter: none;
    pointer-events: auto;
}

/* ===== FAR Reference Styling ===== */

.far-reference {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    transition: color 0.2s ease;
}

.far-reference:hover {
    color: #1d4ed8;
    text-decoration-style: solid;
}

[data-theme="dark"] .far-reference {
    color: #60a5fa;
}

[data-theme="dark"] .far-reference:hover {
    color: #93c5fd;
}

/* ===== End FAR Reference Styling ===== */


