/* style.css */

/* --- General Setup & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bubble-pink: #FF6B9D;
    --bubble-purple: #C06C84;
    --bubble-blue: #8B5DC1;
    --bubble-mint: #C06C84;
    --bubble-yellow: #F8B500;
    --cream: #FFF5E1;
    --dark-blue: #2C3A47;
    --gradient-rainbow: linear-gradient(45deg, #ff0066, #ffcc00, #33ff00, #00ffcc, #0066ff, #cc00ff);
}

body {
    font-family: 'Kalam', cursive;
    background: var(--cream);
    overflow-x: hidden;
    position: relative;
}

/* --- Typography Helpers --- */
.section-title, .form-title {
    font-family: 'Baloo 2', cursive;
    text-align: center;
    color: var(--dark-blue);
    margin-bottom: 20px;
}
.section-subtitle {
    font-family: 'Baloo 2', cursive;
    margin-bottom: 15px;
}
.section-title {
    font-size: clamp(2rem, 6vw, 3rem);
}
.about .section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}
.section-subtitle {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    color: var(--bubble-pink);
}
.about .section-subtitle {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--bubble-purple);
}

/* --- Loading Screen --- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-rainbow);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.loader-content { text-align: center; }
.loader-title { color: white; font-family: 'Baloo 2', cursive; margin-top: 20px; }
.loader-emoji { font-size: 4rem; animation: bounce 0.5s ease-in-out infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-20px); } }

/* --- Desktop Navigation --- */
.nav-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari compatibility */
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.nav-bubble {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--dark-blue);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-family: 'Kalam', cursive;
}
.nav-bubble:hover {
    background: rgba(0, 0, 0, 0.05);
    border-bottom-color: var(--bubble-blue);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    position: relative;
    background: linear-gradient(180deg, #F3E5F5 0%, #E1BEE7 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-container {
    width: 80%;
    max-width: 800px;
    height: 500px;
    perspective: 1000px;
}
.book-page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    padding: 60px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.hero-logo {
    display: block;
    max-width: 220px;
    width: 60%;
    height: auto;
    margin: 0 auto 15px;
}
.hero-title {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(2.2rem, 1.5rem + 5vw, 3.5rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--dark-blue);
    position: relative;
    display: inline-block;
}
.hero-word {
    display: inline-block;
}
.hero-title .hero-word > span {
    display: inline-block;
    animation: letterDance 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}
@keyframes letterDance { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-10px) rotate(-5deg); } 75% { transform: translateY(-10px) rotate(5deg); } }
.hero-subtitle {
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    color: var(--bubble-purple);
    margin: 20px 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.5s;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.magic-btn {
    display: inline-block;
    padding: 20px 50px;
    background: var(--bubble-blue);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 30px;
}
.magic-btn:hover {
    background: var(--bubble-purple);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- Section Styling --- */
.main-content {
    transition: transform 0.4s ease-in-out;
}
.about {
    padding: 100px 0;
    background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%);
}
.gallery-frame {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
article.painting-card {
    background: white;
    border: 15px solid #8B4513;
    border-radius: 10px;
    padding: 40px;
    margin: 20px auto;
    max-width: 800px;
    transform: rotate(-2deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}
article.painting-card:nth-child(even) { transform: rotate(2deg); }
article.painting-card::before {
    content: '🎨';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 3rem;
    transform: rotate(15deg);
}
article.painting-card p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
}
article.painting-card:nth-child(even) p {
    font-size: 1.1rem;
    color: #666;
}
.services {
    padding: 100px 0;
    background: linear-gradient(180deg, #FFF9C4 0%, #FFE082 100%);
}
.playground { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.service-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}
.block {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.block p { font-size: 1.1rem; color: #666; }
.block:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.block-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: inline-block;
    animation: wiggle 2s ease-in-out infinite;
}
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
.join {
    padding: 100px 0;
    background: linear-gradient(180deg, #FFE4E1 0%, #FFB6C1 100%);
    position: relative;
    overflow: hidden;
}
.adventure-path {
    position: absolute;
    width: 100%;
    height: 200px;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath d='M0,100 Q300,50 600,100 T1200,100 L1200,200 L0,200 Z' fill='%23FFF' opacity='0.3'/%3E%3C/svg%3E");
    background-size: cover;
}
.form-container { max-width: 600px; margin: 0 auto; position: relative; z-index: 10; padding: 0 20px; }
.treasure-form {
    background: white;
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
}
.treasure-form::before {
    content: '🗝️';
    position: absolute;
    top: -30px;
    right: 20px;
    font-size: 4rem;
    transform: rotate(-15deg);
    animation: swing 2s ease-in-out infinite;
}
@keyframes swing { 0%, 100% { transform: rotate(-15deg); } 50% { transform: rotate(15deg); } }
.join .form-title { font-size: clamp(1.8rem, 5vw, 2.5rem); margin-bottom: 30px; }
.input-group { margin-bottom: 25px; position: relative; }
.input-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--dark-blue);
    font-weight: 600;
    font-size: 1.1rem;
}
.magic-input, .magic-select, .magic-textarea {
    width: 100%;
    padding: 15px 20px;
    border: 3px solid transparent;
    border-radius: 15px;
    font-size: 1rem;
    font-family: 'Kalam', cursive;
    background: #F5F5F5;
    transition: all 0.3s;
}
.magic-input:focus { border-color: var(--bubble-pink); }
.magic-select:focus { border-color: var(--bubble-mint); }
.magic-textarea:focus { border-color: var(--bubble-purple); }
.magic-input:focus, .magic-select:focus, .magic-textarea:focus {
    outline: none;
    background: white;
    transform: scale(1.02);
}
.magic-textarea { resize: vertical; min-height: 120px; }
.submit-adventure {
    width: 100%;
    padding: 20px;
    background: var(--bubble-mint);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Baloo 2', cursive;
    cursor: pointer;
    transition: all 0.3s;
}
.submit-adventure:hover {
    background: var(--bubble-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.message-bubble { padding: 20px; margin: 20px 0; border-radius: 20px; text-align: center; font-size: 1.1rem; animation: bounceIn 0.5s ease; }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
.success-bubble { background: #C8E6C9; color: #2E7D32; border: 2px solid #4CAF50; }
.error-bubble { background: #FFCDD2; color: #C62828; border: 2px solid #F44336; }
.footer-cloud { padding: 60px 0; background: linear-gradient(180deg, #FDF2F8 0%, #F3E8FF 100%); text-align: center; }
.footer-content { color: var(--dark-blue); font-size: 1.1rem; }

/* --- Effects & Easter Eggs --- */
.particle { position: fixed; pointer-events: none; opacity: 0; z-index: 9998; }
.particle.active { animation: particleBurst 1s ease-out forwards; }
@keyframes particleBurst { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0); } }
.easter-egg { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); font-size: 10rem; z-index: 10001; animation: easterEggPop 2s ease forwards; pointer-events: none; }
@keyframes easterEggPop { 0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); } 50% { transform: translate(-50%, -50%) scale(1.2) rotate(180deg); } 100% { transform: translate(-50%, -50%) scale(0) rotate(360deg); } }

/* --- Mobile & Responsive Design --- */
.mobile-header { display: none; } /* Hidden on desktop */

@media (max-width: 768px) {
    body { padding-top: 60px; }
    .main-content { padding-top: 0; }
    a, button, input, select, textarea { min-height: 44px; }
    .particle { display: none; }

    /* --- Mobile Header --- */
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 60px;
        /* MODIFIED: Added glass effect */
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
        z-index: 1001;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
    }
    .mobile-logo {
        font-family: 'Baloo 2', cursive;
        font-size: 1.1rem;
        font-weight: 800;
        color: var(--dark-blue);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .mobile-logo-emoji { font-size: 1.3rem; }
    .mobile-menu-toggle {
        display: flex;
        background: transparent; border: none; font-size: 1.8rem;
        cursor: pointer; padding: 8px; color: var(--dark-blue);
        transition: all 0.3s; position: relative; width: 40px; height: 40px;
        align-items: center; justify-content: center;
    }
    .hamburger-icon { position: relative; width: 24px; height: 20px; }
    .hamburger-icon span {
        display: block; position: absolute; height: 3px; width: 100%;
        background: var(--dark-blue); border-radius: 3px; opacity: 1;
        left: 0; transform: rotate(0deg); transition: .25s ease-in-out;
    }
    .hamburger-icon span:nth-child(1) { top: 0px; }
    .hamburger-icon span:nth-child(2) { top: 8px; }
    .hamburger-icon span:nth-child(3) { top: 16px; }
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(1) { top: 8px; transform: rotate(135deg); }
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(2) { opacity: 0; left: -60px; }
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(3) { top: 8px; transform: rotate(-135deg); }

    /* --- Dropdown/Accordion Menu Styles --- */
    .nav-bubbles {
        position: fixed;
        top: 60px; /* Position below the header */
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        
        /* MODIFIED: Added glass effect */
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);

        box-shadow: 0 10px 15px -5px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(238, 238, 238, 0.5); /* Made border semi-transparent */

        /* Hide by default */
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        
        /* Smooth transition for accordion effect */
        transition: max-height 0.4s ease-in-out, visibility 0s 0.4s, opacity 0.3s ease-in-out;
    }
    .nav-bubbles.active {
        max-height: 500px; /* A large enough value to show all items */
        visibility: visible;
        opacity: 1;
        transition: max-height 0.4s ease-in-out, visibility 0s, opacity 0.3s ease-in-out;
    }
    .nav-bubble {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        font-weight: 500;
        border: none;
        border-left: 4px solid transparent;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(221, 221, 221, 0.5); /* Made border semi-transparent */
    }
    .nav-bubble:last-child {
        border-bottom: none;
    }
    .nav-bubble:hover, .nav-bubble:active {
        background: rgba(248, 249, 250, 0.7); /* Slightly transparent background on hover */
        border-left-color: var(--bubble-purple);
        padding-left: 20px;
        color: var(--bubble-purple);
    }
    .nav-bubble::before {
        content: '';
        margin-right: 12px;
        font-size: 1.2rem;
        display: inline-block;
        width: 20px;
        text-align: center;
    }
    .nav-bubble[href="#home"]::before { content: '🏠'; }
    .nav-bubble[href="#about"]::before { content: '✨'; }
    .nav-bubble[href="#services"]::before { content: '🎯'; }
    .nav-bubble[href="#join"]::before { content: '💼'; }

    /* --- Mobile Section Adjustments --- */
    .hero { margin-top: -60px; min-height: calc(100vh - 60px); padding: 80px 20px 20px 20px; }
    .book-container { width: 100%; height: auto; position: static; transform: none; max-width: none; }
    .book-page { position: relative; height: auto; padding: 40px 20px; min-height: 450px; }
    .hero-title { line-height: 1.2; text-align: center; margin-bottom: 25px; display: block; }
    .magic-btn { padding: 18px 40px; font-size: 1.1rem; }
    .about, .services, .join { padding: 60px 0; }
    .gallery-frame { padding: 0; }
    article.painting-card { margin: 20px 15px; padding: 25px; border-width: 10px; transform: none !important; }
    article.painting-card p { font-size: 1rem; line-height: 1.6; }
    article.painting-card::before { font-size: 2rem; top: -15px; right: -15px; }
    .playground { padding: 0 20px; }
    .service-blocks { gap: 20px; }
    .block { padding: 30px 20px; margin: 0; }
    .block:hover { transform: none; }
    .block p { font-size: 1rem; }
    .block-icon { font-size: 3rem; }
    .treasure-form { padding: 30px 20px; border-radius: 20px; }
    .treasure-form::before { font-size: 2.5rem; top: -20px; right: 10px; }
    .input-group { margin-bottom: 20px; }
    .input-group label { font-size: 1rem; }
    .magic-input, .magic-select, .magic-textarea { font-size: 16px; }
    .submit-adventure { padding: 18px; font-size: 1.1rem; }
    .footer-cloud { padding: 40px 20px; }
    .footer-content { font-size: 1rem; }
    .hero-title .hero-word > span, .block-icon, .treasure-form::before { animation: none; }
    .loader { background: var(--bubble-blue); animation: none; }
}
@media (max-width: 375px) {
    .mobile-logo { font-size: 1rem; gap: 3px; }
    .mobile-logo-emoji { font-size: 1.1rem; }
    .nav-bubble { font-size: 0.95rem; padding: 14px 20px; }
    .hero-logo { max-width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}