/* Main Quiz Container */
.advanced-quiz-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Quiz Intro Screen */
.quiz-intro {
    padding: 40px 20px;
    text-align: center;
}

.quiz-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.quiz-meta-item {
    background: #f0f4ff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1rem;
}

.quiz-meta-item span {
    font-weight: bold;
    color: #236496;
}

.start-quiz-btn {
    padding: 15px 40px;
    background: #4a6bff;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.start-quiz-btn:hover {
    background: #3a5bff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 107, 255, 0.3);
}

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

/* Quiz Content (initially hidden) */
.quiz-content {
    display: none;
}

/* Quiz Header */
.quiz-header {
    background: #236496;
    color: white;
    padding: 10px;
    text-align: center;
}

.quiz-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f0f4ff;
    border-bottom: 1px solid #ddd;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timer {
    font-size: 1.2rem;
    font-weight: bold;
}

.timer.warning {
    color: #ff9800;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.progress-container {
    flex-grow: 1;
    margin: 0 20px;
}

.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #4a6bff;
    transition: width 0.3s ease;
}

.question-counter {
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}

/* Quiz Body */
.quiz-body {
    display: flex;
    min-height: 500px;
}

.questions-container {
    flex: 1;
    padding: 10px;
}

.question-container {
    display: none;
}

.question-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.question {
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-weight: 600;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.option {
    padding: 2px 5px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option:hover {
    background: #e9ecef;
}

.option.selected {
    border-color: #4a6bff;
    background: #e3e8ff;
}

.option-letter {
    width: 30px;
    height: 30px;
    background: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: #4a6bff;
    color: white;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.nav-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #6c757d;
    color: white;
}

.btn-next {
    background: #4a6bff;
    color: white;
}

.btn-submit {
    background: #28a745;
    color: white;
}

.nav-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Question Navigation */
.question-navigation {
    width: 300px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 1px solid #eee;
}

.nav-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 10px;
}

.nav-item {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    background: #e0e0e0;
}

.nav-item.answered {
    background: #4caf50;
    color: white;
}

.nav-item.unanswered {
    background: #cc0000;
    color: white;
}

.nav-item.current {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px #4a6bff;
}

/* Results */
.result-container {
    display: none;
    padding: 30px;
    animation: fadeIn 1s ease;
}

.score-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#4a6bff 0% 70%, #e0e0e0 70% 100%);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-inner {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.score-text {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.stat {
    padding: 15px;
    border-radius: 8px;
    min-width: 120px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.correct-stat {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.incorrect-stat {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.unanswered-stat {
    background: rgba(158, 158, 158, 0.1);
    color: #9e9e9e;
}

.score-stat {
    background: rgba(74, 107, 255, 0.1);
    color: #4a6bff;
}

.answers-review {
    margin-top: 30px;
}

.answer-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

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

.answer-item.unanswered {
    border-left: 5px solid #9e9e9e;
}

.question-text {
    font-weight: 600;
    margin-bottom: 10px;
}

.user-answer, .correct-answer {
    margin: 8px 0;
}

.correct-answer {
    color: #4caf50;
    font-weight: 600;
}

.explanation {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

.retake-btn {
    margin-top: 25px;
    padding: 12px 25px;
    width: 100%;
    background: #4a6bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.retake-btn:hover {
    background: #3a5bff;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
    .quiz-body {
        flex-direction: column;
    }
    
    .question-navigation {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
    }
}

@media (max-width: 600px) {
    .quiz-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-container {
        width: 100%;
        margin: 10px 0;
    }
    
    .questions-container {
        padding: 20px;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .quiz-meta {
        flex-direction: column;
        gap: 15px;
    }
}