:root {
    --primary-color: #800000;
    --primary-dark: #660000;
    --secondary-color: #990000;
    --accent-color: #b30000;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #4bb543;
    --error-color: #ff3333;
    --warning-color: #ffc107;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fb;
    color: var(--dark-color);
    height: 100vh;
    overflow: hidden;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-img {
    height: 40px;
    width: auto;
}

.quiz-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.quiz-nav a {
    text-decoration: none;
    color: var(--gray-color);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    padding: 0.5rem 0;
}

.quiz-nav a:hover {
    color: var(--primary-color);
}

.quiz-nav a.active {
    color: var(--primary-color);
}

.quiz-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.quiz-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem 3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Home Screen Styles */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.home-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

.stat-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Email Screen Styles */
.email-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.email-input-container {
    width: 100%;
    margin: 2rem 0;
}

#user-email {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#user-email:focus {
    outline: none;
    border-color: var(--accent-color);
}

.email-note {
    margin-top: 0.5rem;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.email-navigation {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 1rem;
}

/* Quiz Screen Styles */
.quiz-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.question-container {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.question-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option {
    padding: 1.2rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.option.selected {
    background-color: rgba(128, 0, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.option.correct {
    background-color: rgba(75, 181, 67, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.option.incorrect {
    background-color: rgba(255, 51, 51, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: rgba(128, 0, 0, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: white;
}

.btn-tertiary {
    background: none;
    border: none;
    color: var(--gray-color);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0.8rem 1.5rem;
}

.btn-tertiary:hover {
    color: var(--primary-color);
}

/* Review Screen Styles */
.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.review-question {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.review-question h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.review-option {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    position: relative;
}

.review-option.selected {
    background-color: rgba(128, 0, 0, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.review-option.correct {
    background-color: rgba(75, 181, 67, 0.1);
    color: var(--success-color);
}

.review-option.incorrect {
    background-color: rgba(255, 51, 51, 0.1);
    color: var(--error-color);
}

.review-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* Results Summary Screen Styles */
.results-summary-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.results-header {
    margin-bottom: 2.5rem;
}

.results-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.results-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
}

.score-display {
    margin-bottom: 2.5rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0%, var(--light-color) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background-color: white;
    border-radius: 50%;
}

.score-circle span {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

#summary-score-message {
    font-size: 1.2rem;
    color: var(--dark-color);
    font-weight: 500;
}

.results-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.detail-card {
    padding: 1.5rem 2rem;
    border-radius: 12px;
    min-width: 150px;
}

.detail-card.correct {
    background-color: rgba(75, 181, 67, 0.1);
    color: var(--success-color);
}

.detail-card.incorrect {
    background-color: rgba(255, 51, 51, 0.1);
    color: var(--error-color);
}

.detail-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.email-notification {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    color: var(--gray-color);
}

.email-notification i {
    font-size: 1.2rem;
}

#summary-user-email-display {
    font-weight: 500;
    color: var(--primary-color);
}

/* Detailed Results Screen Styles */
.detailed-results-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 80px; /* Space for the navigation button */
}

/* Answers Explanation Styles */
.answers-explanation {
    width: 100%;
    margin-bottom: 2rem;
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.explanation-item {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.explanation-question {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.explanation-user-answer {
    margin: 0.5rem 0;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.explanation-user-answer.correct {
    background-color: rgba(75, 181, 67, 0.1);
    color: var(--success-color);
}

.explanation-user-answer.incorrect {
    background-color: rgba(255, 51, 51, 0.1);
    color: var(--error-color);
}

.explanation-correct-answer {
    margin: 0.5rem 0;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    background-color: rgba(75, 181, 67, 0.1);
    color: var(--success-color);
    font-weight: 500;
}

.explanation-text {
    color: var(--gray-color);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.detailed-results-navigation {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 3rem;
    background-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-header {
        padding: 1rem 1.5rem;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .review-grid {
        grid-template-columns: 1fr;
    }
    
    .screen {
        padding: 1.5rem;
    }
    
    .quiz-navigation {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .quiz-navigation button {
        width: 100%;
    }
    
    .email-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .email-navigation button {
        width: 100%;
    }
    
    .review-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .review-navigation button {
        width: 100%;
    }
    
    .results-details {
        flex-direction: column;
        gap: 1rem;
    }

    .detailed-results-navigation {
        padding: 0 1.5rem;
    }
}