/* Reset & Base Styles */
:root {
    --primary-color: #D4AF37;
    /* Soft Gold for Belle */
    --accent-color: #9370DB;
    /* Medium Purple for Rapunzel */
    --text-color: #4A4A4A;
    --bg-color: #FDF5E6;
    /* Old Lace - warm paper feel */
    --card-bg: #FFFFFF;
    --shadow: 0 10px 30px rgba(100, 80, 100, 0.08);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    background: linear-gradient(135deg, #fff5f8 0%, #f3e6ff 100%);
    /* Warmer Pink to Lavender */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    /* Prevent scroll from background elements */
}

/* Background Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(50px);
    opacity: 0.6;
    border-radius: 50%;
    animation: floatShape 20s infinite alternate;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #ffdde1;
    top: -50px;
    left: -50px;
    animation-duration: 25s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #eebdff;
    bottom: -100px;
    right: -100px;
    animation-duration: 30s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #fff9c4;
    /* Soft yellow */
    top: 40%;
    left: 80%;
    animation-duration: 22s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: #b9fbc0;
    /* Soft green */
    bottom: 20%;
    left: 10%;
    animation-duration: 28s;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(30px, 50px) rotate(10deg);
    }
}

/* Main Layout */
.content-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Sections */
section {
    width: 100%;
    text-align: center;
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: none;
    position: relative;
    overflow: hidden;
    /* For any decorative pseudo-elements */
}

/* Add a subtle top border/accent */
section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

section.active-section {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    color: #4A4A4A;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #4A4A4A;
    margin-bottom: 25px;
}

.subtitle {
    font-size: 1rem;
    margin-bottom: 2.5rem;
    color: #777;
    font-weight: 400;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c7a02c);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Quiz Styles */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    background: #FAFAFA;
    border: 1px solid #EEE;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #555;
    font-family: var(--font-body);
}

/* Mobile hover fix */
@media (hover: hover) {
    .quiz-option:hover {
        background: #FDF5E6;
        border-color: var(--primary-color);
        transform: translateX(4px);
    }
}

.quiz-option.correct {
    background: #F0FFF4;
    /* Light Green */
    border-color: #C6F6D5;
    color: #2F855A;
}

.quiz-option.wrong {
    background: #FFF5F5;
    /* Light Red */
    border-color: #FED7D7;
    color: #C53030;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* Progress Bar */
.quiz-progress {
    width: 100%;
    height: 4px;
    background: #F0F0F0;
    border-radius: 2px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Letter Styles */
.letter-content {
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #333;
    line-height: 1.8;
}

.letter-content p {
    margin-bottom: 1.2rem;
}

.signature {
    margin-top: 2.5rem;
    font-style: italic;
    font-weight: 700;
    text-align: right;
    color: var(--primary-color);
}

/* Pulse Animation for Button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }
}

.btn-primary {
    /* Existing styles preserved, just adding/overwriting specifics */
    animation: pulse 2s infinite ease-in-out;
}

.btn-primary:hover {
    animation: none;
    /* Stop pulse on hover/active */
    transform: translateY(-2px) scale(1.02);
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    h1 {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }

    h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.5;
    }

    section {
        padding: 25px 20px;
        width: 100%;
        margin: 0 auto 20px auto;
        border-radius: 20px;
        /* Keep it round */
    }

    .btn-primary {
        width: 100%;
        padding: 16px 20px;
        font-size: 1.2rem;
    }

    .quiz-option {
        padding: 15px;
        font-size: 1rem;
    }

    .letter-content {
        font-size: 1.1rem;
        line-height: 1.7;
    }

    /* Background shapes smaller on mobile */
    .shape-1 {
        width: 200px;
        height: 200px;
    }

    .shape-2 {
        width: 250px;
        height: 250px;
    }
}