/* ========================================
   ANNEOKULU.COM - VIBRANT PRESCHOOL DESIGN
   Colorful, Playful, Child-Friendly Theme
   ======================================== */

/* --- RAINBOW COLOR PALETTE --- */
:root {
    /* Rainbow Colors */
    --rainbow-red: #FF6B9D;
    --rainbow-orange: #FFA06B;
    --rainbow-yellow: #FFD93D;
    --rainbow-green: #6BCF7F;
    --rainbow-blue: #4FACFE;
    --rainbow-purple: #C77DFF;
    --rainbow-pink: #FF9CEE;

    /* Compatibility Colors (Aydede Port) */
    --c-primary: #FF6B6B;
    --c-secondary: #4ECDC4;
    --c-purple: #6C5CE7;

    /* Gradients */
    --gradient-pink: linear-gradient(135deg, #FF9CEE 0%, #FF6B9D 100%);
    --gradient-orange: linear-gradient(135deg, #FFA06B 0%, #FF8C42 100%);
    --gradient-green: linear-gradient(135deg, #6BCF7F 0%, #4CAF50 100%);
    --gradient-blue: linear-gradient(135deg, #4FACFE 0%, #00C9FF 100%);
    --gradient-purple: linear-gradient(135deg, #C77DFF 0%, #9D4EDD 100%);
    --gradient-rainbow: linear-gradient(90deg, #FF6B9D, #FFA06B, #FFD93D, #6BCF7F, #4FACFE, #C77DFF);

    /* Backgrounds */
    --bg-sky: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    --bg-grass: linear-gradient(180deg, #90EE90 0%, #98FB98 100%);
    --bg-white: #FFFFFF;

    /* Text */
    --text-dark: #2D3436;
    --text-light: #FFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: 'Quicksand', 'Comic Sans MS', cursive, sans-serif;
    color: var(--text-dark);
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.hidden {
    display: none !important;
    visibility: hidden !important;
}

/* --- HEADER: RAINBOW SKY WITH CLOUDS --- */
.kid-header {
    position: relative;
    background: var(--gradient-rainbow);
    padding-top: 1rem;
    overflow: hidden;
    box-shadow: none;
    z-index: 100;
    animation: rainbowShift 10s ease-in-out infinite;
}

@keyframes rainbowShift {

    0%,
    100% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(10deg);
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0.5rem 1rem 3rem 1rem;
    /* Reduced horizontal padding to move logo left */
    position: relative;
    z-index: 2;
}

/* LOGO - Bouncing Animation */
/* LOGO - Updated to match Aydede dimensions */
.kid-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transform: translateY(-8px);
    /* Moved up slightly */
    transition: 0.3s;
}

.kid-logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 75px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    display: block;
}

/* NAVIGATION - Colorful Bubble Buttons */
.kid-nav-right {
    display: flex;
    gap: 0.5rem;
    /* Reduced gap from 1rem to 0.5rem */
    flex-wrap: wrap;
}

.kid-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #FFF;
    padding: 0.7rem 1.0rem;
    /* Compact padding */
    border-radius: 50px;
    font-family: 'Quicksand', cursive;
    font-weight: 800;
    font-size: 1rem;
    /* Slightly smaller font */
    color: var(--rainbow-purple);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: 3px solid var(--rainbow-pink);
}

.kid-nav-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.15), 0 12px 25px rgba(0, 0, 0, 0.2);
    background: var(--gradient-pink);
    color: #FFF;
    border-color: var(--rainbow-red);
}

.kid-nav-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

/* HEADER DECORATIONS - Floating Clouds & Stars */
.header-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.h-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    filter: blur(8px);
    animation: floatCloud 20s linear infinite;
}

.c1 {
    width: 150px;
    height: 60px;
    top: 15px;
    left: 5%;
}

.c2 {
    width: 200px;
    height: 80px;
    top: 25px;
    right: 10%;
    animation-duration: 25s;
    animation-direction: reverse;
}

@keyframes floatCloud {
    0% {
        transform: translateX(-100px);
    }

    100% {
        transform: translateX(100px);
    }
}

.h-star {
    position: absolute;
    animation: twinkle 2s infinite alternate;
}

.s1 {
    top: 20px;
    left: 20%;
}

.s2 {
    top: 40px;
    right: 30%;
    animation-delay: 1s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.8) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.3) rotate(180deg);
    }
}

/* WAVE EFFECT */
.header-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.header-wave svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.header-wave .shape-fill {
    fill: #FFFFFF;
}

/* --- MAIN CONTENT AREA --- */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 1.5rem 0 1.5rem;
}

.main-title {
    font-family: 'Quicksand', cursive;
    font-weight: 800;
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 2.5rem;
    background: var(--gradient-rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowPulse 3s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes rainbowPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.main-title span {
    color: var(--rainbow-red);
}

/* --- HERO GRID (3 Colorful Cards) --- */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    align-items: stretch;
    margin-bottom: 3rem;
}

/* HERO CARDS - 3D Effect with Bounce */
.hero-card {
    border-radius: 40px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #FFF;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 5px solid #FFF;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), inset 0 -8px 0 rgba(0, 0, 0, 0.1);
    min-height: 420px;
    text-align: center;
}

.hero-card:hover {
    transform: translateY(-15px) scale(1.05) rotate(2deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), inset 0 -8px 0 rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.card-header h2 {
    font-family: 'Quicksand', cursive;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

.card-content p {
    font-weight: 700;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* SPLIT COLUMN */
.hero-col-split {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

.hero-col-split .hero-card {
    flex: 1;
    min-height: 0;
}

/* CARD COLORS - Vibrant Gradients */
.card-story {
    background: var(--gradient-pink);
    border-color: var(--rainbow-pink);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 20px 40px rgba(255, 107, 157, 0.3), inset 0 -8px 0 rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 25px 50px rgba(255, 107, 157, 0.5), inset 0 -8px 0 rgba(0, 0, 0, 0.1);
    }
}

.card-coloring {
    background: var(--gradient-green);
    border-color: var(--rainbow-green);
}

.card-cartoon {
    background: url('panel-yonetim-2fa-secure/cartoonfon.webp') center/cover no-repeat,
        var(--gradient-orange);
    background-blend-mode: overlay;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
}

.card-craft {
    background: url('panel-yonetim-2fa-secure/printfon.webp') center/cover no-repeat,
        var(--gradient-purple);
    background-blend-mode: overlay;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
}

/* MINI GRID BADGE - Playful Style */
.mini-grid-badge {
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid var(--rainbow-yellow);
    border-radius: 25px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-family: 'Quicksand', cursive;
    font-size: 1.6rem;
    color: var(--rainbow-red);
    font-weight: 900;
    text-shadow: 2px 2px 0px #FFF;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

.craft-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* INPUTS - Colorful & Fun */
.input-group-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 1.5rem;
}

.hero-input,
.hero-textarea {
    width: 100%;
    background: #FFF;
    border: 3px solid var(--rainbow-yellow);
    border-radius: 25px;
    padding: 15px 20px;
    font-family: 'Quicksand', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    outline: none;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
}

.hero-input:focus,
.hero-textarea:focus {
    border-color: var(--rainbow-pink);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.3);
    transform: scale(1.02);
}

.hero-textarea {
    height: 80px;
    resize: none;
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
}

/* CAPTCHA */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.captcha-label {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFF;
}

.captcha-input {
    width: 80px !important;
    text-align: center;
}

/* BUTTONS - 3D Bouncy Style */
.btn-hero {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 50px;
    font-family: 'Quicksand', cursive;
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #FFF;
    transition: 0.2s;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.15), 0 10px 25px rgba(0, 0, 0, 0.2);
    color: var(--text-dark);
    margin-top: auto;
}

.btn-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.15), 0 15px 30px rgba(0, 0, 0, 0.25);
}

.btn-hero:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}

.btn-story {
    color: var(--rainbow-pink);
}

.btn-coloring {
    color: var(--rainbow-green);
}

/* --- FEATURE GRID --- */
.feature-grid-wrapper {
    max-width: 1200px;
    margin: 3rem auto 0 auto;
    padding: 0 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    border-radius: 35px;
    padding: 2.5rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 5px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.05) rotate(-2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.feature-card-content {
    text-align: center;
    z-index: 2;
}

.feature-card h3 {
    font-family: 'Quicksand', cursive;
    font-size: 2.2rem;
    font-weight: 800;
    color: #FFF;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.feature-card-red {
    background: var(--gradient-pink);
    border-color: var(--rainbow-red);
}

.feature-card-green {
    background: var(--gradient-green);
    border-color: var(--rainbow-green);
}

.feature-card-yellow {
    background: linear-gradient(135deg, #FFD93D 0%, #F9CA24 100%);
    border-color: var(--rainbow-orange);
}

/* --- GALLERY & CAROUSEL --- */
.gallery-wrapper {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.gallery-section {
    margin-bottom: 2rem;
}

.gallery-title {
    font-family: 'Quicksand', cursive;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* CAROUSEL */
.carousel-window {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 25px 0;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.carousel-track {
    display: flex;
    gap: 15px;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.carousel-item {
    flex: 0 0 300px;
    max-width: 300px;
    transition: 0.3s;
    border-radius: 30px;
    overflow: hidden;
    background: #FFF;
    border: 4px solid var(--rainbow-yellow);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.carousel-item:hover {
    transform: translateY(-15px) scale(1.05);
    z-index: 10;
    border-color: var(--rainbow-pink);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* STORY CARDS */
.story-card {
    background: #FFF;
    border-radius: 30px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--rainbow-blue);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    border: 6px solid var(--rainbow-pink);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    transform: translateY(-10px) rotate(2deg);
}

.card-img-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #FFE5F1 0%, #E0F6FF 100%);
    flex-shrink: 0;
    position: relative;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.card-img-wrapper img.obj-contain {
    object-fit: contain !important;
    background: #F8F9FA;
    padding: 10px;
}

.story-card:hover img {
    transform: scale(1.15) rotate(3deg);
}

.ranking-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 50px;
    height: 50px;
    background: var(--gradient-rainbow);
    color: #FFF;
    font-family: 'Quicksand', cursive;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    z-index: 5;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
    border: 3px solid #FFF;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.card-body {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: 'Quicksand', cursive;
    font-weight: 800;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    color: var(--rainbow-purple);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-views {
    font-size: 0.95rem;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}

/* LOADING SCREEN */
#view-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-container {
    text-align: center;
    background: #FFF;
    padding: 4rem;
    border-radius: 50px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 550px;
    border: 6px solid var(--rainbow-pink);
}

.countdown-circle {
    font-family: 'Quicksand', cursive;
    font-size: 6rem;
    background: var(--gradient-rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    font-weight: 800;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #F0F2F5;
    border-radius: 15px;
    margin-top: 2rem;
    overflow: hidden;
    border: 2px solid var(--rainbow-blue);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-rainbow);
    animation: loading 60s linear forwards;
}

@keyframes loading {
    to {
        width: 100%;
    }
}

/* --- RESPONSIVE DESIGN --- */
/* --- RESPONSIVE DESIGN (Unified Mobile Stack) --- */
@media (max-width: 900px) {

    /* --- HEADER (Mobile Scroll Fix) --- */
    .header-content {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1rem !important;
        padding-bottom: 0.5rem !important;
        overflow: hidden !important;
    }

    .kid-nav-right {
        width: 100vw !important;
        margin-left: -1rem !important;
        /* Compensate parent padding */
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 12px !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 15px !important;
        /* Hide scrollbar visual */
        scrollbar-width: none !important;
    }

    .kid-nav-right::-webkit-scrollbar {
        display: none !important;
    }

    .kid-nav-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* --- HERO & GRID --- */
    .hero-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
        gap: 2rem;
    }

    .hero-col-split {
        flex-direction: column;
        /* Keep split column vertical even on mobile, or row if preferred, but column is safer for stacking */
        gap: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .feature-card {
        min-height: 140px;
    }

    .main-title {
        font-size: 2.5rem;
    }

    .kid-nav-btn {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }

    .carousel-item {
        flex: 0 0 250px;
        max-width: 250px;
    }
}

/* =========================================
   STORY READING PAGE (MASAL OKUMA) STYLES
   ========================================= */

/* BACKGROUND & CONTAINER */
.story-page-body {
    background-color: #FFFFFF !important;
    /* Slightly distinct from pure white for reading mode context */
}

.full-page-book {
    max-width: 900px;
    margin: 3rem auto;
    background: #ffffff;
    padding: 3rem 4rem;
    border-radius: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* HEADER SECTION */
.book-header-clean {
    text-align: center;
    margin-bottom: 2.5rem;
}

.book-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.author-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

/* COVER IMAGE */
.story-cover-wrapper {
    width: 100%;
    margin-bottom: 3rem;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

.story-cover {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.story-cover:hover {
    transform: scale(1.02);
}

/* AUDIO GENERATION UI */
.btn-generate-audio {
    background: #FF6B6B;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(255, 107, 107, 0.4);
    background: #FF8787;
}

.player-container {
    background: #F0F2F5;
    border-radius: 30px;
    padding: 1.5rem 2rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
    min-height: 100px;
    /* Ensure space for transition */
    justify-content: center;
}

.player-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.play-btn-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--c-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.play-btn-large:hover {
    transform: translateY(-2px) scale(1.05);
    background: #ff5252;
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.5);
}

.play-btn-large svg {
    width: 32px;
    height: 32px;
}

.player-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    color: #2D3436;
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: #dfe6e9;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c-secondary), #2ecc71);
    width: 0%;
    border-radius: 10px;
    transition: width 0.1s linear;
}

/* STORY CONTENT TEXT */
.story-content-box {
    font-family: 'Nunito', sans-serif;
    font-size: 1.35rem;
    line-height: 2;
    color: #4a5568;
}

.story-paragraph {
    margin-bottom: 2rem;
}

.word {
    border-radius: 4px;
    padding: 0 2px;
    transition: background-color 0.2s, color 0.2s;
    cursor: default;
}

.word.active {
    background-color: #fff3cd;
    /* Soft yellow highlight */
    color: #d35400;
    font-weight: 700;
    box-shadow: 0 2px 0 rgba(211, 84, 0, 0.2);
}

/* META CARDS (Notes, Questions) */
.meta-grid-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px dashed #eee;
}

.meta-card {
    border-radius: 30px;
    padding: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.meta-card:hover {
    transform: translateY(-5px);
}

.card-blue {
    background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
}

.card-purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.card-green {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.full-span {
    grid-column: span 2;
}

.meta-card h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 2;
}

.meta-card p,
.meta-card ul {
    font-size: 1.1rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    opacity: 0.95;
}

.meta-card ul {
    list-style: none;
    padding: 0;
}

.meta-card li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.meta-card li::before {
    content: "â˜…";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
}

.card-icon {
    position: absolute;
    top: -15px;
    right: -15px;
    opacity: 0.15;
    transform: scale(4) rotate(10deg);
    z-index: 1;
    pointer-events: none;
}

/* RESPONSIVE FOR STORY */
@media (max-width: 768px) {
    .full-page-book {
        padding: 2rem 1.5rem;
        margin: 1.5rem 1rem;
        width: auto;
    }

    .book-title {
        font-size: 2.2rem;
    }

    .meta-grid-section {
        grid-template-columns: 1fr;
    }

    .full-span {
        grid-column: span 1;
    }

    .story-content-box {
        font-size: 1.2rem;
    }
}

/* STORY SCENE IMAGES */
.scene-image-wrapper {
    margin: 2rem 0 1.5rem 0;
    text-align: center;
}

.story-scene-img {
    max-width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
    max-height: 500px;
    object-fit: cover;
}

.story-scene-img:hover {
    transform: scale(1.01);
}

/* CAPTCHA BOX */
.captcha-container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.captcha-container:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}

.captcha-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: #FFF;
    font-weight: 600;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.captcha-input {
    width: 80px !important;
    text-align: center;
    font-size: 1.3rem !important;
    padding: 8px !important;
    height: auto !important;
    color: var(--c-primary) !important;
    font-weight: 800 !important;
}

/* --- CARTOON STYLE --- */
.cartoon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 Column per row */
    gap: 2rem;
    margin-bottom: 3rem;
}

.cartoon-card {
    background: #FFF;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 4px solid #fff;
    transition: transform 0.3s;
}

.cartoon-card:hover {
    transform: translateY(-5px);
    border-color: var(--c-purple);
}

.cartoon-cover {
    position: relative;
    width: 100%;
    /* Maintain 16:9 Aspect Ratio somewhat for cover */
    aspect-ratio: 16/9;
    cursor: pointer;
    background: #000;
}

.cartoon-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cartoon-cover.playing {
    cursor: default;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.2s;
}

.cartoon-cover:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

.cartoon-title {
    padding: 1.5rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    text-align: center;
    color: var(--c-text);
    background: #fdfdfd;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.page-link {
    padding: 10px 15px;
    background: #FFF;
    border-radius: 10px;
    text-decoration: none;
    color: var(--c-text);
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
}

.page-link:hover,
.page-link.active {
    background: var(--c-primary);
    color: #FFF;
    transform: translateY(-2px);
}

@media(max-width: 768px) {
    .cartoon-grid {
        grid-template-columns: 1fr;
        /* 1 col on mobile */
    }
}

/* Fix for view loading gap */
#view-loading.hidden {
    display: none !important;
}

#view-loading {
    margin: 20px 0;
}

/* Final Layout Fixes */
.main-wrapper {
    margin-top: 50px !important;
    /* Push down fro header */
    padding-top: 0 !important;
}

.gallery-wrapper {
    margin-top: 40px !important;
    /* Push gallery away from hero */
}

/* Colorful Progress Bar (120s) */
.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 25%, #fad0c4 50%, #a18cd1 75%, #fbc2eb 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: fillProgress 120s linear forwards, gradientMove 3s infinite linear !important;
}

@keyframes fillProgress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* --- MOBILE MENU SCROLL FIX --- */
/* --- MOBILE FIXES REMOVED (Replaced by main media query) --- */

/* Spinner for TTS */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: #FF6B6B;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Sticky Player */
.player-sticky-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px 30px 0 0;
    padding: 1.5rem 2rem;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: transform 0.3s ease;
    transform: translateY(110%);
    /* Hidden initially */
}

.player-sticky-wrapper.active {
    transform: translateY(0);
}

/* Desktop: Center player and match book width */
@media (min-width: 900px) {
    .player-sticky-wrapper {
        left: 50%;
        transform: translate(-50%, 110%);
        max-width: 900px;
    }

    .player-sticky-wrapper.active {
        transform: translate(-50%, 0);
    }
}

/* Ensure enough padding at bottom of body so player doesn't cover content */
.story-page-body {
    padding-bottom: 120px;
}