/* עיצוב עמוד המבחן */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.quiz-header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #1f1ed9 0%, #c12a1a 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.quiz-header h1 {
    font-size: 2.7em;
    font-weight: 800;
    margin: 0px 20px 20px 20px;
    color: #fff;
}

.quiz-header p {
    font-size: 1.2em;
    opacity: 1;
    color: #fff;
}

/* בחירת קטגוריה */
.category-selection {
    margin-bottom: 40px;
}

.category-selection h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #333;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.category-option:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.category-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    flex: 1;
}

.category-random-image {
    width: auto;
    height: auto;
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
    padding: 0px;
    display: block;
    margin: 0 auto;
}

.category-option.selected .category-icon {
    color: white;
}

.category-option.selected .category-random-image {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.category-option span {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: auto;
    padding-top: 15px;
    flex-shrink: 0;
}

/* המבחן */
.quiz-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c12a1a, #1f1ed9);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #666;
}

.quiz-question {
    text-align: center;
    margin-bottom: 30px;
}

.question-image-container {
    margin-bottom: 20px;
}

.question-image {
    width: min(100%, 200px);
    height: auto;
    max-width: 200px;
    max-height: 200px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: none;
}

.question-text h3 {
    font-size: 1.7em;
    color: #000;
    margin: 0;
}

.quiz-answers {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    font-size: 1.1em;
    font-weight: 500;
}

.answer-description {
    font-size: 1.1em;
    color: #000;
    line-height: 1.5;
    font-weight: 500;
    text-align: center;
}

.answer-option:hover {
    border-color: #1f1ed9;
    background: #f8f9ff;
    transform: translateX(-5px);
}

.answer-option.selected {
    border-color: #1f1ed9;
    background: #1f1ed9;
    color: white;
}

.answer-option.selected .answer-description {
    color: white;
}

.answer-option.selected {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.answer-option.correct {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.answer-option.correct .answer-description {
    color: white;
}

.answer-option.incorrect {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.answer-option.incorrect .answer-description {
    color: white;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.quiz-controls-left {
    display: flex;
    align-items: center;
    order: 1;
}

.quiz-controls-center {
    display: flex;
    align-items: center;
    order: 2;
}

.quiz-controls-right {
    display: flex;
    gap: 10px;
    align-items: center;
    order: 3;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* תוצאות */
.quiz-results {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.score-details {
    text-align: right;
}

.score-details p {
    margin: 8px 0;
    font-size: 1.1em;
    color: #666;
}

.results-summary {
    margin-bottom: 30px;
}

.question-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.question-result.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.question-result.incorrect {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.question-result img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: contain;
}

.question-result-info {
    flex: 1;
}

.question-result-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.question-result-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* רספונסיביות */
@media (max-width: 768px) {
    .quiz-container {
        padding: 15px;
    }
    
    .quiz-header h1 {
        font-size: 2em;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .quiz-section {
        padding: 20px;
    }
    
    .question-image {
        width: min(100%, 150px);
        max-width: 150px;
        max-height: 150px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .quiz-controls-left,
    .quiz-controls-center,
    .quiz-controls-right {
        order: unset;
        justify-content: center;
    }
    
    .quiz-controls-center {
        margin: 10px 0;
    }
    
    .quiz-controls-right {
        flex-direction: column;
        gap: 10px;
    }
}
