/* עיצוב מינימליסטי נקי ומודרני - סימולטור לשכת עורכי הדין */

:root {
    --primary-blue: #1976d2;
    --primary-light: #42a5f5;
    --text-dark: #1a1a1a;
    --text-medium: #424242;
    --text-light: #757575;
    --background-light: #fafafa;
    --white: #ffffff;
    --border-light: #e0e0e0;
    --border-medium: #bdbdbd;
    --success-green: #4caf50;
    --error-red: #f44336;
    --warning-orange: #ff9800;
    --focus-blue: #2196f3;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.12);
    
    /* Mobile-first gradient colors */
    --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

/* Base Typography */
body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: rtl;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
}

/* Headers */
h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin: 40px 0 16px;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-medium);
    text-align: center;
    margin-bottom: 48px;
    font-weight: 400;
}

/* Cards */
.main-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    margin: 20px 0;
    overflow: hidden;
}

.card-header {
    padding: 32px;
    background: var(--gradient-blue);
    color: var(--white);
    text-align: center;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 8px;
}

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

.card-content {
    padding: 32px;
}

/* Exam Selection */
.exam-selection {
    text-align: center;
    margin-bottom: 40px;
}

.exam-selection h3 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 24px;
}

/* Exam Buttons - Modern Design */
.exam-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.exam-btn {
    background: var(--gradient-blue);
    color: white;
    border: none;
    padding: 25px 20px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-height: 80px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.exam-btn:hover, .exam-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    outline: 2px solid var(--focus-blue);
    outline-offset: 2px;
}

.exam-btn:active {
    transform: translateY(-1px);
}

.exam-btn.mahuti {
    background: var(--gradient-pink);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.exam-btn.mahuti:hover, .exam-btn.mahuti:focus {
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.exam-btn small {
    font-size: 14px;
    opacity: 0.9;
    font-weight: normal;
    margin-top: 5px;
}

/* Quiz Container */
.quiz-container {
    display: none;
}

.quiz-container.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: var(--background-light) !important;
    min-height: 100vh !important;
    width: 100% !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Quiz Header */
.exam-header {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

.exam-title-section {
    text-align: center;
    margin-bottom: 16px;
}

.exam-title-section h2 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.exam-subtitle {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin: 0;
}

.exam-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.timer {
    background: var(--warning-orange);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.timer.warning {
    animation: pulse 1s infinite;
    background: var(--error-red) !important;
}

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

.question-counter {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.9rem;
}

.score {
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Questions */
.question {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.question-header {
    background: #f8f9fa;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.question h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

.question-content {
    padding: 24px;
}

/* Answers */
.answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: none;
}

.answer {
    background: var(--white);
    border: 2px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-dark);
    font-weight: 400;
    font-size: 1rem;
    position: relative;
    min-height: 44px;
    touch-action: manipulation;
}

.answer::before {
    content: attr(data-number);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--border-medium);
    border-radius: 50%;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.875rem;
    margin-left: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.answer:hover {
    background: #f5f5f5;
    border-color: var(--primary-blue);
}

.answer:hover::before {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.answer.selected {
    background: #e3f2fd;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 500;
}

.answer.selected::before {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.answer.correct {
    background: #e8f5e8;
    border-color: var(--success-green);
    color: var(--success-green);
    font-weight: 500;
}

.answer.correct::before {
    background: var(--success-green);
    border-color: var(--success-green);
    color: var(--white);
    content: "✓";
}

.answer.incorrect {
    background: #ffebee;
    border-color: var(--error-red);
    color: var(--error-red);
    font-weight: 500;
}

.answer.incorrect::before {
    background: var(--error-red);
    border-color: var(--error-red);
    color: var(--white);
    content: "✗";
}

/* Buttons */
.buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    min-height: 44px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    touch-action: manipulation;
}

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

.btn-primary:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-medium);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: var(--text-medium);
}

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

.btn-success:hover {
    background: #388e3c;
    transform: translateY(-1px);
}

.btn:focus {
    outline: 2px solid var(--focus-blue);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Explanation */
.explanation {
    background: #f8f9fa;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    display: none;
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
}

.explanation.show {
    display: block;
}

.explanation::before {
    content: "� מקורות:";
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Results */
.results {
    display: none;
    text-align: center;
}

.results.show {
    display: block;
}

.results-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-medium);
    max-width: 600px;
    margin: 0 auto;
}

.results h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.final-score {
    font-size: 4rem;
    font-weight: 700;
    margin: 24px 0;
    line-height: 1;
}

.final-score.pass {
    color: var(--success-green);
}

.final-score.fail {
    color: var(--error-red);
}

.result-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
    text-align: right;
}

.result-details p {
    margin-bottom: 8px;
    color: var(--text-medium);
}

.result-details strong {
    color: var(--text-dark);
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Error Messages */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #f44336;
}

/* Accessibility Features */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 10001;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

/* Enhanced focus indicators - WCAG 2.0 requirement */
*:focus {
    outline: 2px solid var(--focus-blue);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Accessibility Widget */
.accessibility-widget {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
    font-family: 'Heebo', Arial, sans-serif;
}

.accessibility-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.accessibility-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.accessibility-btn:active {
    transform: scale(0.95);
}

.accessibility-btn:focus {
    outline: 3px solid #ffeb3b;
    outline-offset: 2px;
}

.accessibility-menu {
    position: absolute;
    left: 60px;
    top: -50px;
    background: white;
    border: 2px solid var(--primary-blue);
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    direction: rtl;
}

.accessibility-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 20px;
    z-index: 10000;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-banner.show {
    transform: translateY(0);
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    body {
        overflow-x: hidden !important;
    }
    
    .quiz-container.active {
        display: block !important;
        visibility: visible !important;
        background: #ffffff !important;
        min-height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    h1 {
        font-size: 1.75rem;
        margin: 24px 0 12px;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .card-header {
        padding: 24px 20px;
    }

    .card-content {
        padding: 20px;
    }

    .exam-buttons {
        gap: 16px;
    }

    .exam-btn {
        padding: 20px 16px;
        font-size: 16px;
        min-height: 70px;
    }

    .exam-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .exam-stats {
        flex-direction: column;
        gap: 8px;
    }

    .exam-stats > * {
        text-align: center;
    }

    .question-header {
        padding: 20px;
    }

    .question h3 {
        font-size: 1rem;
    }

    .question-content {
        padding: 20px;
    }

    .answer {
        padding: 16px;
        font-size: 0.95rem;
    }

    .answer::before {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        min-width: 100%;
        padding: 14px 20px;
    }

    .results-card {
        padding: 24px;
        margin: 0 16px;
    }

    .final-score {
        font-size: 3rem;
    }
    
    .accessibility-widget {
        left: 15px;
        top: 20px;
        transform: none;
    }

    .accessibility-btn {
        width: 45px;
        height: 45px;
    }
    
    .accessibility-menu {
        left: 60px;
        top: 0;
        min-width: 240px;
        max-width: calc(100vw - 80px);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .card-header,
    .card-content {
        padding: 16px;
    }

    .question-header,
    .question-content {
        padding: 16px;
    }

    .final-score {
        font-size: 2.5rem;
    }
    
    .accessibility-widget {
        left: 10px;
        top: 15px;
    }

    .accessibility-btn {
        width: 40px;
        height: 40px;
    }

    .accessibility-menu {
        left: 55px;
        min-width: 220px;
        max-width: calc(100vw - 70px);
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    :root {
        --background: #ffffff;
        --surface: #ffffff;
        --primary: #000000;
        --text-primary: #000000;
        --text-secondary: #000000;
        --border: #000000;
        --shadow: rgba(0, 0, 0, 0.8);
    }
    
    .answer {
        border: 2px solid #000000 !important;
    }
    
    .answer.selected {
        background: #ffff00 !important;
        color: #000000 !important;
    }
    
    .answer.correct {
        background: #00ff00 !important;
        color: #000000 !important;
    }
    
    .answer.incorrect {
        background: #ff0000 !important;
        color: #ffffff !important;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Accessibility Classes */
body.large-font {
    font-size: 120% !important;
}

body.large-font * {
    font-size: inherit !important;
}

body.high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast * {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.high-contrast .main-card,
body.high-contrast .accessibility-menu {
    background: #111 !important;
    border-color: #fff !important;
}

body.high-contrast .card-header {
    background: #333 !important;
}

body.high-contrast .accessibility-btn {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}

body.high-contrast .accessibility-btn:hover {
    background: #000 !important;
    color: #fff !important;
}

body.large-links a,
body.large-links button {
    font-size: 120% !important;
    padding: 12px 20px !important;
}

body.readable-font,
body.readable-font * {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
}

/* PWA Styles */
.install-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease;
}

.install-button:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
}

.install-button svg {
    animation: bounce 2s infinite;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Update Notification */
.update-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.update-notification.show {
    transform: translateY(0);
}

.update-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.update-content h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.update-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.update-buttons {
    display: flex;
    gap: 12px;
}

.update-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.update-buttons .btn-primary {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
}

.update-buttons .btn-primary:hover {
    background: rgba(255,255,255,0.3);
}

.update-buttons .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

.update-buttons .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff5722;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
    animation: slideInRight 0.5s ease;
}

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

/* PWA Media Queries */
@media (max-width: 768px) {
    .install-button {
        position: relative;
        top: auto;
        left: auto;
        margin: 10px;
        font-size: 12px;
        padding: 10px 14px;
    }
    
    .update-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .update-buttons {
        justify-content: center;
    }
    
    .offline-indicator {
        bottom: 80px;
        right: 10px;
        left: 10px;
        text-align: center;
        border-radius: 15px;
    }
}

/* PWA Standalone Mode */
@media (display-mode: standalone) {
    .install-button {
        display: none;
    }
    
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
}

/* PWA Window Controls Overlay */
@media (display-mode: window-controls-overlay) {
    .container {
        padding-top: env(titlebar-area-height);
    }
}

/* Keyboard Help Modal */
.keyboard-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.keyboard-help-modal.show {
    opacity: 1;
    visibility: visible;
}

.help-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

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

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px 20px;
    border-bottom: 1px solid #eee;
}

.help-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.help-body {
    padding: 25px 30px;
}

.shortcut-group {
    margin-bottom: 25px;
}

.shortcut-group:last-child {
    margin-bottom: 0;
}

.shortcut-group h4 {
    margin: 0 0 15px 0;
    color: var(--primary-blue);
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 5px;
}

.shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.shortcut:last-child {
    border-bottom: none;
}

.shortcut kbd {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-left: 10px;
}

.help-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    text-align: center;
}

.help-footer .btn {
    padding: 12px 30px;
    font-size: 16px;
}

/* High contrast mode for help modal */
body.high-contrast .help-content {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

body.high-contrast .help-header,
body.high-contrast .help-footer {
    border-color: #fff !important;
}

body.high-contrast .shortcut {
    border-color: #444 !important;
}

body.high-contrast .shortcut-group h4 {
    color: #fff !important;
    border-color: #fff !important;
}

body.high-contrast kbd {
    background: #333 !important;
    color: #fff !important;
    border-color: #fff !important;
}

/* Mobile responsive for help modal */
@media (max-width: 768px) {
    .help-content {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }
    
    .help-header,
    .help-body,
    .help-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .help-header h3 {
        font-size: 20px;
    }
    
    .shortcut {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .shortcut kbd {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Focus Mode Styles */
body.focus-mode {
    background: #1a1a1a !important;
    color: #ffffff !important;
}

body.focus-mode .container {
    background: #1a1a1a !important;
    max-width: none !important;
    padding: 20px !important;
}

body.focus-mode .main-card,
body.focus-mode .quiz-container {
    background: #2d2d2d !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}

body.focus-mode .card-header {
    background: #333333 !important;
    color: #ffffff !important;
}

body.focus-mode header h1,
body.focus-mode h2,
body.focus-mode h3 {
    color: #ffffff !important;
}

body.focus-mode .subtitle,
body.focus-mode p {
    color: #cccccc !important;
}

body.focus-mode .btn {
    background: #0d7377 !important;
    border-color: #0d7377 !important;
    color: white !important;
}

body.focus-mode .btn:hover {
    background: #14a085 !important;
    border-color: #14a085 !important;
}

body.focus-mode .exam-stats {
    background: #333333 !important;
    color: #ffffff !important;
}

/* Toggle Switch for Focus Mode */
.option-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.option-toggle:hover {
    background: rgba(25, 118, 210, 0.1);
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-blue);
}

input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

input[type="checkbox"] {
    display: none;
}

.toggle-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Exit Fullscreen Button */
.exit-fullscreen-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.exit-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Focus mode responsive */
@media (max-width: 768px) {
    body.focus-mode .container {
        padding: 10px !important;
    }
    
    .option-toggle {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .toggle-label {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .exit-fullscreen-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* High contrast mode overrides for focus elements */
body.high-contrast .option-toggle:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.high-contrast .toggle-slider {
    background: #333 !important;
    border: 1px solid #fff !important;
}

body.high-contrast input[type="checkbox"]:checked + .toggle-slider {
    background: #fff !important;
}

body.high-contrast input[type="checkbox"]:checked + .toggle-slider::before {
    background: #000 !important;
}

/* Auto-Save Indicator */
.save-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .save-indicator {
        top: 60px;
        right: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Enhanced exam options styling */
.exam-options {
    background: rgba(25, 118, 210, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(25, 118, 210, 0.1);
}

/* Exam stats enhancements for focus mode button */
.exam-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .exam-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .exam-stats > div,
    .exam-stats > button {
        flex: 1;
        min-width: 120px;
    }
}

/* Performance Section */
.performance-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.performance-insight {
    font-size: 1.1em;
    font-weight: 500;
    color: #334155;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #cbd5e1;
}

.review-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.review-btn, .export-btn {
    position: relative;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-btn:hover, .export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.export-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.export-btn:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.review-counter {
    background: #ef4444;
    color: white;
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

/* Review Mode Styles */
.review-mode-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.review-header h2 {
    color: #1f2937;
    margin: 0;
    font-size: 1.8em;
}

.review-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    color: #6b7280;
}

.exit-review-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.exit-review-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.review-question {
    background: #f9fafb;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.question-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    line-height: 1.6;
}

.answer-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.user-answer, .correct-answer {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid transparent;
}

.user-answer {
    background: #fef2f2;
    border-color: #fca5a5;
}

.correct-answer {
    background: #f0fdf4;
    border-color: #86efac;
}

.explanation {
    background: #eff6ff;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid #3b82f6;
    margin: 15px 0;
    font-style: italic;
}

.mastery-indicator {
    text-align: center;
    font-size: 1.1em;
    color: #f59e0b;
    margin: 15px 0;
}

.review-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.understood-btn, .need-review-btn, .next-review-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.understood-btn {
    background: #10b981;
    color: white;
}

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

.need-review-btn {
    background: #f59e0b;
    color: white;
}

.need-review-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.next-review-btn {
    background: #6366f1;
    color: white;
}

.next-review-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

/* Mobile responsiveness for review mode */
@media (max-width: 768px) {
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .answer-comparison {
        grid-template-columns: 1fr;
    }
    
    .review-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .review-section {
        flex-direction: column;
        align-items: center;
    }
}
