/* ============================================
   ABA Mastery - Professional Study App Styles
   A product of Bradley Virtual Solutions, LLC
   ============================================ */

:root {
    /* Light Mode Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --header-height: 120px;
    --nav-height: 70px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ============================================
   Base Styles
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Loading Screen
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-screen p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */

.app-header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-section {
    margin-right: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.user-info .btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.guest-mode-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.icon-btn {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

#auth-btn {
    transition: all 0.2s ease;
}

#auth-btn:hover {
    transform: scale(1.05);
}

/* Profile Dropdown */
.profile-dropdown-container {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 20px);
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
    transform: translateX(0);
}

/* Responsive positioning for smaller screens */
@media (max-width: 1024px) {
    .profile-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 40px);
        max-width: 320px;
    }
}

/* For medium screens, keep centered but adjust width */
@media (max-width: 768px) {
    .profile-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 60px);
        max-width: 300px;
    }
}

/* For mobile screens (like 385px width), position from right edge */
@media (max-width: 480px) {
    .profile-dropdown {
        right: 10px;
        left: auto;
        transform: none;
        width: calc(100vw - 20px);
        max-width: 350px;
    }
}

/* For very small screens, position from left edge */
@media (max-width: 360px) {
    .profile-dropdown {
        right: auto;
        left: 10px;
        transform: none;
        width: calc(100vw - 20px);
    }
}

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

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-divider {
    height: 1px;
    background: var(--bg-tertiary);
    margin: 0 8px;
}

.profile-stats {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-menu {
    padding: 8px;
}

.profile-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}

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

.menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.profile-footer {
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    margin-top: 4px;
}

.profile-signout-btn {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
}

.profile-signout-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.profile-signout-btn.signed-in {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-weight: 600;
}

.profile-signout-btn.signed-in:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

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

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

.nav-menu {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    z-index: 90;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    justify-content: space-around;
    padding: 8px;
}

/* Mobile Navigation */
.nav-mobile {
    display: none;
    flex-direction: column;
}

.nav-primary {
    display: flex;
    justify-content: space-around;
    padding: 8px;
}

.nav-secondary {
    position: relative;
}

.nav-more-btn {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.nav-more-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.nav-more-btn.active {
    background: var(--primary-color);
    color: white;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-more-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.nav-dropdown.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.nav-dropdown .nav-item {
    width: 100%;
    padding: 12px 16px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-start;
    flex-direction: row;
    gap: 12px;
}

.nav-dropdown .nav-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

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

.nav-dropdown .nav-item.active {
    background: var(--primary-color);
    color: white;
}

/* Navigation Items */
.nav-item {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: var(--transition);
    flex: 1;
    max-width: 100px;
    min-height: 44px; /* Touch-friendly size */
    min-width: 44px;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet and Desktop */
@media (min-width: 769px) {
    .nav-desktop {
        display: flex;
    }
    
    .nav-mobile {
        display: none;
    }
    
    .nav-item {
        padding: 12px 16px;
    }
    
    .nav-icon {
        font-size: 24px;
    }
    
    .nav-label {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }
    
    .nav-mobile {
        display: flex;
    }
    
    .nav-item {
        padding: 10px 8px;
        min-height: 48px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-label {
        font-size: 10px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .nav-item {
        padding: 8px 6px;
        min-height: 50px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 9px;
    }
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none !important;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

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

.view-header {
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ============================================
   Home View
   ============================================ */

.welcome-section {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    text-align: center;
}

.welcome-section h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.quick-actions {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.quick-actions h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.action-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.action-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.action-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Study View
   ============================================ */

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.topics-grid {
    display: -ms-grid;  /* IE 10-11 */
    display: grid;
    -ms-grid-columns: 1fr 20px 1fr 20px 1fr;  /* IE fallback */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    grid-gap: 20px;  /* Chrome older versions */
    width: 100%;
    min-height: 200px;
    padding: 0;
}

/* Force display on all devices */
#topics-container {
    display: -ms-grid !important;  /* IE 10-11 */
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.topic-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    display: block;  /* Chrome fallback */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    min-width: 0;  /* Chrome grid overflow fix */
}

.topic-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.topic-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.topic-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

.topic-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* ============================================
   Practice View
   ============================================ */

.practice-setup {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.practice-setup h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-group select,
.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: -4px;
    font-style: italic;
}

.pass-fail-banner {
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
}

.pass-fail-banner.passed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.pass-fail-banner.failed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.pass-fail-detail {
    font-size: 16px;
    opacity: 0.9;
}

.exam-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 10px 0 20px;
}

.section-breakdown {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.section-breakdown h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.section-card {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.section-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.section-score {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 8px 0;
}

.section-detail {
    font-size: 14px;
    color: var(--text-secondary);
}

.results-score.passing {
    color: #10b981;
}

/* Quiz */
.practice-quiz {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.quiz-header {
    margin-bottom: 32px;
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 600;
}

.timer {
    color: var(--primary-color);
    font-size: 18px;
}

.quiz-progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.quiz-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.answers-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.answer-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 16px;
    color: var(--text-primary);
}

.answer-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.answer-option.correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.answer-option.incorrect {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.explanation {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    border-left: 4px solid var(--primary-color);
}

.explanation h4 {
    font-weight: 600;
    margin-bottom: 8px;
}

.quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
}

/* Results */
.practice-results {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.results-score {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 24px 0;
}

.results-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

/* ============================================
   Flashcards
   ============================================ */

.flashcard-container {
    max-width: 700px;
    margin: 0 auto;
}

.flashcard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.flashcard {
    background: transparent;
    perspective: 1000px;
    height: 400px;
    margin-bottom: 24px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard[data-flipped="true"] .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: var(--primary-color);
    color: white;
}

.flashcard-front p,
.flashcard-back p {
    font-size: 24px;
    line-height: 1.6;
}

.category-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
}

/* ============================================
   Progress View
   ============================================ */

.progress-dashboard {
    display: grid;
    gap: 24px;
}

.progress-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.progress-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

#category-breakdown {
    display: grid;
    gap: 16px;
}

.category-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
}

.category-progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

#recent-activity {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================
   Settings View
   ============================================ */

.settings-container {
    max-width: 600px;
}

.settings-group {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.settings-group h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.setting-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item input[type="number"] {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 100px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

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

/* ============================================
   Install Prompt
   ============================================ */

.install-prompt {
    position: fixed;
    bottom: 90px;
    left: 20px;
    right: 20px;
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    animation: slideUp 0.3s ease;
}

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

.install-content p {
    margin-bottom: 12px;
    font-weight: 500;
}

.install-actions {
    display: flex;
    gap: 12px;
}

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

@media (min-width: 768px) {
    .nav-menu {
        position: relative;
        box-shadow: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        bottom: auto;
    }
    
    .main-content {
        padding: 40px;
    }
    
    .install-prompt {
        bottom: 20px;
        left: auto;
        right: 20px;
        max-width: 400px;
    }
    
    /* Hide hamburger menu on desktop */
    #menu-toggle {
        display: none;
    }
}

/* Tablet specific fixes (iPad) */
@media (min-width: 768px) and (max-width: 1024px) {
    .topics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
    
    .topic-card {
        padding: 20px;
        min-height: 150px;
    }
    
    #topics-container {
        display: grid !important;
        min-height: 300px;
    }
}


/* iPad Pro and larger tablets */
@media (min-width: 1025px) and (max-width: 1366px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .header-content h1 {
        font-size: 18px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile menu behavior */
    .nav-menu {
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .nav-menu.mobile-open {
        transform: translateY(0);
    }
}


/* ============================================
   Enhanced Dashboard Styles
   For exam readiness tracking and analytics
   ============================================ */

.exam-readiness-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.readiness-score {
    font-size: 72px;
    font-weight: 800;
    margin: 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.readiness-label {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 500;
}

.readiness-status {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin-top: 12px;
    font-weight: 600;
}

.stats-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card-enhanced {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.stat-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value-large {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 8px 0;
}

.stat-label-enhanced {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-secondary);
}

.trend-up { color: #10b981; }
.trend-down { color: #ef4444; }

.recommendations-section, .weak-areas-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.recommendation-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.recommendation-card.priority { border-left-color: #ef4444; background: #fef2f2; }
.recommendation-card.warning { border-left-color: #f59e0b; background: #fffbeb; }
.recommendation-card.success { border-left-color: #10b981; background: #f0fdf4; }
.recommendation-card.achievement { border-left-color: #8b5cf6; background: #faf5ff; }

.recommendation-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.recommendation-message {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.recommendation-action {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.weak-area-card {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    margin-bottom: 12px;
}

.weak-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.weak-area-accuracy {
    font-size: 20px;
    font-weight: 700;
}

.accuracy-low { color: #ef4444; }
.accuracy-medium { color: #f59e0b; }
.accuracy-high { color: #10b981; }

.progress-bar-enhanced {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.study-plan-section, .bookmarks-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.mastered-topics-section {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #86efac;
    margin-bottom: 24px;
}

.mastered-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mastered-badge {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #065f46;
    border: 2px solid #86efac;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .exam-readiness-card {
    background: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
}

[data-theme="dark"] .mastered-topics-section {
    background: #064e3b;
    border-color: #059669;
}

/* ============================================
   Study Groups & Success Rates Styles
   ============================================ */

.study-groups-intro, .pass-rate-intro {
    text-align: center;
    margin-bottom: 32px;
}

.group-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.group-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.group-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.group-header h4 {
    margin: 0;
    font-size: 18px;
}

.group-type {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.group-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.group-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pass-rate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.pass-rate-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    text-align: center;
}

.pass-rate-card.overall {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.pass-rate-score {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.pass-rate-card.overall .pass-rate-score {
    color: white;
}

.pass-rate-score.excellent {
    color: #10b981;
}

.pass-rate-score.good {
    color: #3b82f6;
}

.pass-rate-score.fair {
    color: #f59e0b;
}

.app-usage-section, .rating-section, .submit-result-cta {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.usage-stat {
    text-align: center;
}

.usage-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.usage-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

.rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.star-rating {
    font-size: 32px;
}

.rating-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.rating-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.submit-result-cta {
    text-align: center;
}

.auth-check {
    text-align: center;
    padding: 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-top: 24px;
}

/* ============================================
   Spaced Repetition & Strategy Training Styles
   High-Impact Learning Features
   ============================================ */

.sr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.table-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
}

.table-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.table-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.table-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
}

.priority-badge.critical {
    background: #fee2e2;
    color: #991b1b;
}

.priority-badge.high {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================
   Success Rates - No Data State Styles
   ============================================ */

.no-data-state {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.no-data-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data-state h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.no-data-state p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

.placeholder-stats {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 12px;
    margin: 32px 0;
}

.placeholder-stats h4 {
    margin-bottom: 20px;
    font-size: 18px;
}

.tracking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.tracking-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--border-color);
}

.tracking-icon {
    font-size: 24px;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin: 32px 0;
}

.cta-section h4 {
    margin-bottom: 12px;
    font-size: 22px;
}

.cta-section p {
    color: white;
    opacity: 0.95;
    margin-bottom: 20px;
}

.coming-soon-note {
    margin-top: 32px;
    padding: 20px;
    background: #fffbeb;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.coming-soon-note p {
    margin: 8px 0;
    color: #92400e;
    font-size: 14px;
}

.loading-stats {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* ============================================
   Scenarios View
   ============================================ */

.scenarios-stats {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.scenarios-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scenario-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.scenario-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.scenario-number {
    font-weight: 700;
    font-size: 14px;
}

.scenario-category {
    flex: 1;
    font-size: 13px;
    text-transform: capitalize;
}

.scenario-difficulty {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.difficulty-beginner {
    background: rgba(34, 197, 94, 0.3) !important;
}

.difficulty-intermediate {
    background: rgba(234, 179, 8, 0.3) !important;
}

.difficulty-advanced {
    background: rgba(239, 68, 68, 0.3) !important;
}

.scenario-content {
    padding: 24px;
}

.scenario-text,
.scenario-question {
    margin-bottom: 16px;
    line-height: 1.6;
}

.scenario-options {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
    transition: all 0.2s ease;
}

.option:hover {
    background: var(--bg-tertiary);
}

.correct-option {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
    font-weight: 600;
}

.scenario-explanation {
    margin-top: 20px;
    padding: 16px;
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    line-height: 1.6;
}

.scenario-tasks,
.scenario-keywords {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
}

/* ============================================
   Case Studies View
   ============================================ */

.case-studies-stats {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.case-studies-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case-study-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.case-study-header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 20px 24px;
}

.case-study-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.case-study-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.case-study-citation {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.6;
}

.case-study-citation a {
    color: var(--primary-color);
    text-decoration: none;
}

.case-study-citation a:hover {
    text-decoration: underline;
}

.open-access-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.case-study-content {
    padding: 24px;
}

.case-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.case-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.case-section strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.case-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.case-section li {
    margin: 6px 0;
    line-height: 1.6;
}

.exam-relevance {
    background: rgba(37, 99, 235, 0.05);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
}

.loading-text,
.no-content {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px 20px;
}


/* ============================================
   Interactive Scenario Quiz
   ============================================ */

.scenario-text-box,
.scenario-question-box {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.scenario-text-box h3,
.scenario-question-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 18px;
}

.scenario-text-box p,
.scenario-question-box p {
    line-height: 1.7;
    font-size: 16px;
}

.option-button {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-button:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(4px);
}

.option-letter {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-color);
    min-width: 24px;
}

.option-text {
    flex: 1;
    line-height: 1.6;
}

.option-button.selected {
    border-width: 3px;
}

.option-button.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.option-button.correct .option-letter {
    color: #22c55e;
}

.option-button.correct::after {
    content: '✅';
    font-size: 20px;
    margin-left: auto;
}

.option-button.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.option-button.incorrect .option-letter {
    color: #ef4444;
}

.option-button.incorrect::after {
    content: '❌';
    font-size: 20px;
    margin-left: auto;
}

.feedback-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 24px 0;
    border-left: 4px solid var(--primary-color);
}

.feedback-correct {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.feedback-incorrect {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.feedback-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.feedback-correct .feedback-header {
    color: #22c55e;
}

.feedback-incorrect .feedback-header {
    color: #ef4444;
}

.feedback-correct-answer {
    background: rgba(34, 197, 94, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.feedback-explanation {
    line-height: 1.7;
    margin-bottom: 16px;
}

.feedback-task-list,
.feedback-keywords {
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.quiz-progress {
    font-weight: 600;
    font-size: 16px;
}

.quiz-category {
    display: flex;
    gap: 12px;
    align-items: center;
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-beginner {
    background: rgba(34, 197, 94, 0.2);
    color: #059669;
}

.difficulty-intermediate {
    background: rgba(234, 179, 8, 0.2);
    color: #ca8a04;
}

.difficulty-advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.quiz-navigation {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.results-message {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    font-size: 18px;
    font-weight: 600;
}

.pass-message {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.review-message {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}


/* ============================================================================
   PDF EXPORT BUTTON & NOTIFICATIONS
   ============================================================================ */

#export-progress-pdf, #export-study-data-pdf {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#export-progress-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#export-study-data-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

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

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


/* Hide header menu toggle on mobile - navigation already has More button */
@media (max-width: 768px) {
    .mobile-menu-toggle-hidden {
        display: none !important;
    }
}

/* Remove gap between header and navigation bar */
.nav-menu {
    margin-top: 0 !important;
}

.app-header + .nav-menu {
    margin-top: 0 !important;
}

/* Make key points text black in study modal on mobile */
@media (max-width: 768px) {
    /* Target all text in study modal to ensure key points are black */
    .study-topic-modal .study-modal-inner h3,
    .study-topic-modal .study-modal-inner ul,
    .study-topic-modal .study-modal-inner ul li {
        color: #000000 !important;
    }
    
    /* Also target direct children in modal */
    .study-topic-modal h3,
    .study-topic-modal ul,
    .study-topic-modal ul li {
        color: #000000 !important;
    }
}
