/* Import Quicksand font */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

/* Add any custom styles here */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

h1, h2, h3, .quicksand {
    font-family: 'Quicksand', sans-serif;
}

/* Add some padding to sections to account for fixed header */
section {
    scroll-margin-top: 4rem;
}

.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #9333EA;
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    right: 30px;
    bottom: 30px;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

@keyframes rotate-360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate-360 {
    animation: rotate-360 1s linear;
}

/* Card flip animation */
.card-container {
    perspective: 1000px;
    width: 287px;
    height: 383px;
    margin: auto;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    border-radius: 0.75rem;
    box-shadow: 
        0 0 0 5px #fff,
        0 0 0 6px #e2e8f0,
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-container.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-front img,
.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-back {
    transform: rotateY(180deg);
}

.card-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-container:hover .card-shine {
    opacity: 1;
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Gallery image hover effect */
.gallery-item {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

/* Character animation styles */
.character-container {
    position: relative;
    width: 300px;  /* Match original width */
    height: 530px; /* Match original height */
    margin: auto;
}

.character-head,
.character-body,
.character-eyes,
.character-mouth {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.character-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: gentleNod 4s ease-in-out infinite;
    transform-origin: bottom center;
}

.character-body {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

@keyframes gentleNod {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(2deg); }
}

/* Double blink animation */
.character-eyes {
    animation: doubleBlink 4s infinite;
}

@keyframes doubleBlink {
    0%, 94%, 96%, 98%, 100% { opacity: 1; }
    95%, 97% { opacity: 0; }
}

/* Periodic smile animation */
.character-mouth {
    animation: smile 5s ease-in-out infinite;
}

@keyframes smile {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Pop-up Container */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
}

.popup-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Close Button */
.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close-popup:hover {
    color: #333;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}
/* Highlight Invalid Fields */
.invalid-field {
    border: 2px solid red !important;
}

/* Hide Pop-up by Default */
.hidden {
    display: none;
}

/* Book showcase styles */
.book-container {
    perspective: 1000px;
    width: 287px;
    height: 383px;
    margin: auto;
    position: relative;
}

/* More Info Button */
.more-info-button {
    display: block; /* Make it a block element */
    width: 100%; /* Full width */
    padding: 12px 0; /* Vertical padding */
    text-align: center; /* Center the text */
    background-color: #6d28d9; /* Purple background */
    color: white; /* White text */
    font-size: 16px; /* Text size */
    font-weight: 600; /* Bold text */
    text-decoration: none; /* Remove underline */
    border: none; /* Remove border */
    border-radius: 0 0 12px 12px; /* Rounded bottom corners */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

.peek-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(147, 51, 234, 0.8);
    color: #9333EA;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 24px;
}

.peek-button:hover {
    background: rgba(147, 51, 234, 0.3);
    transform: scale(1.1);
}

.book-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-container.peeking .book-inner {
    transform: rotateY(180deg) scale(1.5);
    z-index: 50;
}

.book-front,
.book-peek {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.75rem;
    overflow: hidden;
}

.book-front {
    background: white;
    padding: 12px;
    box-shadow: 
        0 0 0 5px #fff,
        0 0 0 6px #e2e8f0,
        2px 4px 6px rgba(0, 0, 0, 0.1),
        -8px 8px 0 -3px #ceafff,
        -8px 8px 0 -2px #9333EA;
}

.book-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.book-peek {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #fff 0%, #f3f4f6 100%);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 100%;
    box-shadow: 
        0 0 0 5px #fff,
        0 0 0 6px #e2e8f0,
        2px 4px 6px rgba(0, 0, 0, 0.1);
}

/* Scrollbar styling for book-peek */
.book-peek::-webkit-scrollbar {
    width: 8px;
}

.book-peek::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.book-peek::-webkit-scrollbar-thumb {
    background: #ceafff;
    border-radius: 4px;
}

.book-peek::-webkit-scrollbar-thumb:hover {
    background: #9333EA;
}

.peek-label {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(147, 51, 234, 0.1);
    color: #9333EA;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

.book-container:hover .peek-label {
    opacity: 0.8;
}

/* Overlay for mobile book peek */
.book-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 40;
}

.book-container.peeking + .book-overlay,
.book-container.peeking ~ .book-overlay {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

/* Adjust book peek behavior for mobile */
@media (max-width: 768px) {
    .book-container.peeking .book-inner {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotateY(180deg) scale(1.2);
        z-index: 50;
    }
    
    .book-container.peeking {
        pointer-events: none;
    }
    
    .book-container.peeking .book-inner {
        pointer-events: auto;
    }
}

/* Page scroll progress indicator */
.page-progress {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(147, 51, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 100;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.page-progress.visible {
    transform: translateY(0);
}

/* Enhanced Footer Styles */
footer {
    background: linear-gradient(180deg, #fff 0%, #f3f4f6 100%);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(147, 51, 234, 0.2) 50%,
        transparent 100%
    );
}

.footer-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #9333EA;
    border-radius: 50%;
    opacity: 0.2;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-text {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer-heart {
    display: inline-block;
    color: #9333EA;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

document.addEventListener('DOMContentLoaded', function() {
    // Create progress indicator
    const progress = document.createElement('div');
    progress.className = 'page-progress';
    document.body.appendChild(progress);

    // Update progress on scroll
    function updateProgress() {
        const scrolled = window.scrollY;
        const total = document.documentElement.scrollHeight - window.innerHeight;
        const percentage = Math.round((scrolled / total) * 100);
        progress.textContent = `${percentage}%`;
        
        // Show/hide based on scroll position
        if (scrolled > 100) {
            progress.classList.add('visible');
        } else {
            progress.classList.remove('visible');
        }
    }

    // Add sparkles to footer
    const footer = document.querySelector('footer');
    for (let i = 0; i < 50; i++) {
        const sparkle = document.createElement('div');
        sparkle.className = 'footer-sparkle';
        sparkle.style.left = `${Math.random() * 100}%`;
        sparkle.style.top = `${Math.random() * 100}%`;
        footer.appendChild(sparkle);
    }

    window.addEventListener('scroll', updateProgress);
    updateProgress(); // Initial call
});

/* Preloader styles */
#preloader {
    transition: opacity 0.5s ease-in-out;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.mimi-loading-container {
    width: 150px;
    height: 150px;
    position: relative;
}

.mimi-loading-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: bounce 2s infinite ease-in-out;
}

.loading-text {
    font-size: 1.5rem;
    color: #9333EA;
    font-weight: 600;
}

/* Bouncing animation for Mimi */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Dots animation */
.loading-text .dot-1,
.loading-text .dot-2,
.loading-text .dot-3 {
    animation: dots 1.5s infinite;
    opacity: 0;
}

.loading-text .dot-2 {
    animation-delay: 0.5s;
}

.loading-text .dot-3 {
    animation-delay: 1s;
}

@keyframes dots {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.hidden {
    max-height: 0;
}

#mobile-menu:not(.hidden) {
    max-height: 300px; /* Adjust based on content */
}

/* Ensure mobile menu is above other content */
#mobile-menu {
    position: relative;
    z-index: 51;
} 