/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* Typography */
.title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    text-align: center;
    color: rgba(255,255,255,0.9);
    margin-bottom: 3rem;
}

h2 {
    font-size: 2.5rem;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Level Selection */
.level-selection {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.level-button {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-align: left;
}

.level-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.level-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.level-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.level-example {
    font-family: 'Noto Sans Hebrew', Arial, sans-serif;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
}

/* Level 2 Setup */
.setup-content {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.setup-content h2 {
    color: #333;
    text-shadow: none;
    margin-bottom: 2rem;
}

.option-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.option-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.primary-button, .secondary-button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary-button {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.secondary-button {
    background: #667eea;
    color: white;
    border: 2px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.secondary-button:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Game Border */
.game-border {
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

/* Quiz Interface */
.quiz-header {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

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

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #333;
    margin-bottom: 1rem;
}

.back-button {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Menu Buttons */
.menu-buttons {
    text-align: center;
    margin: 2rem 0;
}

.about-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.about-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    margin: 2rem;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #333;
}

.modal h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.modal-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #555;
    font-size: 1rem;
}

.modal-text p:last-child {
    margin-bottom: 0;
}

/* Copyright */
.copyright {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.question-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.question-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.hebrew-display {
    font-family: 'Noto Sans Hebrew', Arial, sans-serif;
    font-size: 4rem;
    color: #667eea;
    font-weight: 600;
    line-height: 1.2;
    direction: rtl;
    unicode-bidi: bidi-override;
}

/* Answer Buttons */
.answers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.answer-button {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.answer-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-button.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.answer-button.correct {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

.answer-button.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

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

/* Text Input for Level 2 */
.text-input {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

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

/* Feedback */
.feedback {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.feedback.correct {
    background: #e8f5e8;
    color: #1b5e20;
    border: 2px solid #2e7d32;
}

.feedback.incorrect {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
}

/* Pronunciation Note */
.pronunciation-note {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Results Screen */
.results-summary {
    text-align: center;
    margin-bottom: 3rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
}

.score-label {
    font-size: 1rem;
    color: #666;
}

.performance-message {
    font-size: 1.3rem;
    color: white;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.results-breakdown {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.result-question {
    font-size: 1.2rem;
    color: #333;
    direction: ltr;
    text-align: left;
}

.result-question .hebrew {
    font-family: 'Noto Sans Hebrew', Arial, sans-serif;
    direction: rtl;
    unicode-bidi: isolate;
}

.result-status {
    font-weight: 500;
}

.result-status.correct {
    color: #2e7d32;
}

.result-status.incorrect {
    color: #f44336;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .hebrew-display {
        font-size: 3rem;
    }
    
    .answers-container {
        grid-template-columns: 1fr;
    }
    
    .level-button {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .primary-button, .secondary-button {
        width: 100%;
    }
}

/* Hebrew Text Support */
.hebrew {
    font-family: 'Noto Sans Hebrew', Arial, sans-serif;
    direction: rtl;
    unicode-bidi: bidi-override;
}

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

/* Focus styles for keyboard navigation */
button:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
