/* ROOT VARIABLES */
:root {
    --primary: #1a5f7a;
    --primary-light: #2d8ca8;
    --accent: #d4a574;
    --accent-glow: rgba(212, 165, 116, 0.3);
    --bg-main: #f8f5f1;
    --bg-card: #ffffff;
    --text-dark: #2c2c2c;
    --text-medium: #5a5a5a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --correct: #4caf50;
    --incorrect: #f44336;
}

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

/* BODY */
body {
    font-family: 'Karla', sans-serif;
    background: linear-gradient(135deg, #f8f5f1 0%, #e8e4dc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* HEADER */
header {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.3);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, #c99b6b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

/* MAIN CONTENT */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 3rem 2rem;
}

.content-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 3rem;
    max-width: 950px;
    width: 100%;
    box-shadow: var(--shadow);
    position: relative;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 24px 24px 0 0;
}

/* HEADERS */
.topic-header,
.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0ece6;
}

.topic-title,
.quiz-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.topic-subtitle,
.quiz-subtitle {
    font-size: 1rem;
    color: var(--text-medium);
}

/* BUTTONS */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-button {
    background: white;
    border: 2px solid #e8e4dc;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
}

.nav-button:hover {
    border-color: var(--primary);
    transform: translateX(6px);
    box-shadow: 0 8px 20px rgba(26, 95, 122, 0.15);
}

.button-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

/* LESSON SECTION */
#lessonSection {
    display: none;
    margin-top: 2rem;
    text-align: center;
}

iframe {
    border-radius: 16px;
}

/* AUDIO QUIZ SPECIFIC STYLES */
.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #f8f5f1;
    border-radius: 12px;
}

.progress-text {
    font-weight: 600;
    color: var(--primary);
}

.score {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.audio-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.audio-button {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 24px rgba(26, 95, 122, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(26, 95, 122, 0.4);
}

.audio-button:active {
    transform: scale(0.95);
}

.audio-instruction {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-medium);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-button {
    background: white;
    border: 3px solid #e8e4dc;
    padding: 2rem 1rem;
    border-radius: 16px;
    font-size: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-button:hover:not(.correct):not(.incorrect):not(.disabled) {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(26, 95, 122, 0.15);
}

.option-button.correct {
    background: var(--correct);
    border-color: var(--correct);
    color: white;
}

.option-button.incorrect {
    background: var(--incorrect);
    border-color: var(--incorrect);
    color: white;
}

.option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-section {
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-message {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 12px;
    display: inline-block;
}

.feedback-message.correct {
    background: rgba(76, 175, 80, 0.1);
    color: var(--correct);
}

.feedback-message.incorrect {
    background: rgba(244, 67, 54, 0.1);
    color: var(--incorrect);
}

.primary-button {
    background: var(--primary);
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    color: white;
    width: 100%;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.primary-button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 95, 122, 0.25);
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.completion-screen {
    display: none;
    text-align: center;
    padding: 2rem 0;
}

.completion-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.completion-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.final-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    main {
        padding: 2rem 1rem;
    }

    .content-card {
        padding: 2rem 1.5rem;
    }

    .topic-title,
    .quiz-title {
        font-size: 1.8rem;
    }

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

    .audio-button {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .nav-button:hover {
        transform: translateX(3px);
    }
}
