/* Swiggles Kids - Main Stylesheet */

/* Global Styles */
* {
    box-sizing: border-box;
}

/* Apply gradient background to the entire page */
body {
    margin: 0;
    padding: 0;
    font-family: 'Bubblegum Sans', cursive;
    background: linear-gradient(180deg, #74c0e3, #f6e5b1);
    min-height: 100vh;
    background-attachment: fixed;
    overflow-x: hidden;
    padding-top: 60px;
    /* Account for development banner */
}

img,
video,
.banner,
.main-header {
    max-width: 100%;
}

.header {
    position: relative;
    width: 100%;
    text-align: center;
    height: auto;
    overflow: visible;
}

/* Main Header Layout */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Logo */
.logo-container {
    max-width: 200px;
    flex-shrink: 0;
}

.logo-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Main Navigation Links */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.main-nav li {
    flex: 1 1 auto;
    text-align: center;
}

.main-nav a {
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff8b42, #ffca42);
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
    /* Accessibility improvements */
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.main-nav a:hover,
.main-nav a:focus {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffca42, #ff8b42);
}

.main-nav a:focus {
    outline-color: #fff;
}

/* Store Links */
.store-links {
    display: flex;
    gap: 10px;
}

.store-logo {
    height: 40px;
    transition: transform 0.3s ease;
    border-radius: 15px;
}

.store-logo:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 480px) {
    .character-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .main-header,
    .banner {
        padding: 0 10px;
    }

    .main-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
    }

    .main-nav a {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .store-links {
        margin-top: 10px;
    }

    .character-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-section,
    .book-image {
        width: 100%;
    }

    .model-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    model-viewer {
        width: 100%;
        max-width: 300px;
    }

    #toggle-audio {
        padding: 8px 16px;
        font-size: 14px;
    }

    .cta-title {
        font-size: 2rem;
    }

    .step-content h3 {
        font-size: 1.3rem;
    }

    .step-content p {
        font-size: 0.9rem;
    }

    .model-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    #toggle-audio {
        bottom: 10px;
        right: 0px;
    }
}

/* Animated Book Image */
.book-image {
    width: 300px;
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    animation: float 3s ease-in-out infinite;
}

/* Character Container with Grid Layout */
.character-container {
    position: absolute;
    top: 5%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    justify-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Character Animation */
.character {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    animation: bounce 2s ease-in-out infinite;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    text-align: center;
    animation-delay: calc(var(--index, 0) * 0.2s);
}

/* Enhanced Sparkles Animation */
.sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    animation: sparkle-animation 2s infinite;
}

.video-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.video-section video {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.additional-models {
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
}

.model-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-items: center;
}

.model-grid model-viewer {
    max-width: 300px;
    height: 200px;
}

.model-grid figure {
    margin: 0;
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.model-grid figure:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.model-grid .model-caption {
    margin-top: 10px;
    font-size: 1rem;
    color: #484a96;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Audio Controls */
#audio-controls {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Debug styling to make container visible */
    /* background: rgba(255, 0, 0, 0.1) !important; */
    /* padding: 5px !important; */
}

#toggle-music,
#toggle-audio {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #484a96;
    color: #FFFFFF;
    border: 2px solid #333333;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    max-width: calc(100vw - 40px);
    white-space: nowrap;
    /* Accessibility improvements */
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: all 0.3s ease;
}

#toggle-music {
    background: linear-gradient(135deg, #ff8b42, #ffca42);
    border-color: #ff8b42;
}

#toggle-music:hover,
#toggle-music:focus,
#toggle-audio:hover,
#toggle-audio:focus {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#toggle-music:hover,
#toggle-music:focus {
    background: linear-gradient(135deg, #ffca42, #ff8b42);
}

#toggle-audio:hover,
#toggle-audio:focus {
    background-color: #6a1b9a;
}

#toggle-music:focus,
#toggle-audio:focus {
    outline-color: #ff8b42;
}

figure {
    padding: 4px;
    margin: auto;
    width: 100%;
}

footer {
    background: #484a96;
    color: #FFF;
    padding: 20px;
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #ff8b42;
    margin: 0 10px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

footer h2 {
    margin: 0 0 10px;
    font-size: 1.8rem;
}

footer p {
    margin: 5px 0;
    font-size: 1rem;
}

footer a {
    color: #FFF;
    text-decoration: none;
}

footer a:hover {
    color: #000;
}

/* Section Styles */
.model-section {
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
    border-radius: 15px;
    position: relative;
}

.model-section[data-bg="1"] {
    background: #ffffffcc url('background2.webp') no-repeat center;
    background-size: cover;
}

.model-section[data-bg="2"] {
    background: #ffffffcc url('background1.webp') no-repeat center;
    background-size: cover;
}

.model-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    width: 100%;
    touch-action: pan-y;
    overflow: auto;
    user-select: none;
}

.model-caption {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #dff7fc;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
}

model-viewer {
    width: 100%;
    height: 500px;
    margin: 20px auto;
    border-radius: 15px;
    background-color: transparent;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    pointer-events: none;
    /* Performance optimizations */
    will-change: transform;
    transform: translateZ(0);
    /* Accessibility */
    outline: 2px solid transparent;
    transition: outline-color 0.3s ease;
}

model-viewer:focus {
    outline-color: #ff8b42;
}

model-viewer:active {
    cursor: grabbing;
}

.model-constrainer {
    max-width: 80%;
}

.text-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Swiggles Info Section */
.swiggles-info {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: linear-gradient(180deg, #fffcf0, #ffe5b4);
    border: 3px dashed #f6c90e;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Bubblegum Sans', cursive;
    text-align: center;
}

.swiggles-title {
    font-size: 2.5rem;
    color: #ff8b42;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    animation: fadeIn 2s ease;
}

.swiggles-description {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 30px;
    line-height: 1.8;
}

.swiggles-highlight {
    color: #f06292;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.swiggles-subtitle {
    font-size: 2rem;
    color: #6a1b9a;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.swiggles-features {
    list-style-type: none;
    padding: 0;
    text-align: left;
}

.swiggles-features li {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #444;
    background: rgba(255, 238, 183, 0.5);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swiggles-features li:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Call-to-Action Steps Section */
.cta-steps {
    padding: 10px 20px;
    background: linear-gradient(180deg, #f6e5b1, #ffe5f6);
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Bubblegum Sans', cursive;
    margin-top: 20px;
    height: auto;
    overflow: visible;
}

.cta-title {
    font-size: 2.5rem;
    color: #ff8b42;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    margin-top: 0px;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.step {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.step-image {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.step-model {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.step-content h3 {
    font-size: 1.5rem;
    color: #6a1b9a;
    margin-bottom: 10px;
}

.step-content p {
    font-size: 1rem;
    color: #444;
    line-height: 1.6;
}

/* Development Banner Styling */
.development-banner {
    background: linear-gradient(90deg, #f6c90e, #ff8b42);
    color: #ffffff;
    font-family: 'Bubblegum Sans', cursive;
    font-size: 1.5rem;
    text-align: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 1s ease-out;
    max-width: 100%;
    box-sizing: border-box;
}

.development-banner p {
    margin: 0;
    animation: textGlow 2s infinite alternate;
}

/* Hero Section */
.hero-section {
    margin-top: 20px;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    color: #ff8b42;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Bubblegum Sans', cursive;
}

/* Book Showcase */
.book-showcase {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.book-cover {
    max-width: 200px;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.book-cover:hover {
    transform: scale(1.05);
}

.book-info h3 {
    font-size: 1.8rem;
    color: #6a1b9a;
    margin-bottom: 15px;
}

.book-info p {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.6;
}

/* Responsive adjustments for book showcase */
@media (max-width: 768px) {
    .book-showcase {
        flex-direction: column;
        text-align: center;
    }

    .book-cover {
        max-width: 150px;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes sparkle-animation {
    0% {
        opacity: 0;
        transform: scale(0.5) translate(0, 0);
    }

    50% {
        opacity: 1;
        transform: scale(1.5) translate(50px, -50px);
    }

    100% {
        opacity: 0;
        transform: scale(0.5) translate(-50px, 50px);
    }
}

@keyframes float {
    0% {
        transform: translate(-50%, -10px);
    }

    50% {
        transform: translate(-50%, 10px);
    }

    100% {
        transform: translate(-50%, -10px);
    }
}

@keyframes sparkleMove {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 20px rgba(255, 200, 100, 0.5);
    }

    to {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 200, 100, 0.7);
    }
}

@keyframes sparkle-burst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2) rotate(180deg);
    }
}