/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Заголовки */
header {
    text-align: center;
    margin-bottom: 40px;
}

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

header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
}

/* Сетка тем */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.theme-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.theme-card h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.theme-card p {
    color: #666;
    margin-bottom: 20px;
}

.theme-stats {
    margin-bottom: 20px;
}

.word-count {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    -webkit-appearance: none;
    -webkit-font-smoothing: antialiased;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white !important;
    text-shadow: none;
    -webkit-text-fill-color: white;
    -webkit-background-clip: padding-box;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    color: white !important;
    -webkit-text-fill-color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white !important;
    text-shadow: none;
    -webkit-text-fill-color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    color: white !important;
    -webkit-text-fill-color: white;
}

.btn-outline {
    background: transparent;
    color: #667eea !important;
    border: 2px solid #667eea;
    text-shadow: none;
    -webkit-text-fill-color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white !important;
    -webkit-text-fill-color: white;
}

/* Прогресс-бар */
.progress-bar {
    background: rgba(255,255,255,0.2);
    height: 8px;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
}

/* Карточка квиза */
.quiz-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.question h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.hebrew-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 15px;
    direction: rtl;
}

/* Варианты ответов */
.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333 !important;
    font-family: inherit;
    -webkit-appearance: none;
    -webkit-font-smoothing: antialiased;
    text-shadow: none;
    -webkit-text-fill-color: #333;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    color: #333 !important;
    -webkit-text-fill-color: #333;
}

/* Сообщения */
.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Действия квиза */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Результаты */
.results-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.results-card h2 {
    color: #333;
    margin-bottom: 30px;
}

.score-display {
    margin: 30px 0;
}

.score-number {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.score-details {
    font-size: 1.2rem;
    color: #666;
}

.score-badge {
    margin: 30px 0;
}

.badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
}

.badge.excellent {
    background: #d4edda;
    color: #155724;
}

.badge.good {
    background: #cce7ff;
    color: #004085;
}

.badge.average {
    background: #fff3cd;
    color: #856404;
}

.badge.poor {
    background: #f8d7da;
    color: #721c24;
}

.motivation {
    margin: 30px 0;
    font-size: 1.1rem;
    color: #666;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Подвал */
footer {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin-top: 40px;
}

/* Обзор ответов */
.answer-review {
    margin-top: 30px;
    text-align: left;
}

.answer-review h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.answers-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    background: #f9f9f9;
}

.answer-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.answer-item.correct {
    border-left: 4px solid #4CAF50;
}

.answer-item.incorrect {
    border-left: 4px solid #f44336;
}

.question-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 15px;
    font-size: 1.1rem;
    min-width: 25px;
}

.answer-content {
    flex: 1;
}

.hebrew-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    direction: rtl;
}

.answer-details {
    font-size: 0.9rem;
}

.correct-answer {
    color: #4CAF50;
    margin-bottom: 5px;
}

.user-answer {
    color: #666;
}

.user-answer .wrong {
    color: #f44336;
    font-weight: bold;
}

.answer-status {
    font-size: 1.5rem;
    margin-left: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-card {
        padding: 20px;
    }
    
    .quiz-card {
        padding: 25px;
    }
    
    .hebrew-word {
        font-size: 2rem;
    }
    
    .options {
        grid-template-columns: 1fr;
    }
    
    .quiz-actions,
    .results-actions {
        flex-direction: column;
    }
    
    .score-number {
        font-size: 3rem;
    }
    
    .answer-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .question-number {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .answer-status {
        margin-left: 0;
        margin-top: 10px;
        align-self: flex-end;
    }
    
    .hebrew-text {
        font-size: 1.1rem;
    }
    
    .answers-list {
        max-height: 300px;
        padding: 15px;
    }
}

/* Специальные стили для Safari и WebKit */
@supports (-webkit-appearance: none) {
    button, .btn, .option-btn, input[type="button"], input[type="submit"] {
        -webkit-appearance: none !important;
        -webkit-font-smoothing: antialiased;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        text-rendering: optimizeLegibility;
    }
    
    /* Принудительная установка цветов для кнопок */
    .btn-primary, .btn-primary:focus, .btn-primary:active {
        color: white !important;
        -webkit-text-fill-color: white !important;
        text-shadow: none !important;
    }
    
    .btn-secondary, .btn-secondary:focus, .btn-secondary:active {
        color: white !important;
        -webkit-text-fill-color: white !important;
        text-shadow: none !important;
    }
    
    .btn-outline, .btn-outline:focus {
        color: #667eea !important;
        -webkit-text-fill-color: #667eea !important;
    }
    
    .btn-outline:hover, .btn-outline:active {
        color: white !important;
        -webkit-text-fill-color: white !important;
    }
    
    .option-btn, .option-btn:focus, .option-btn:active, .option-btn:hover {
        color: #333 !important;
        -webkit-text-fill-color: #333 !important;
        text-shadow: none !important;
    }
} 