/* Midnight Romance Theme */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0D1424; /* Main background - Deep Navy */
    color: #F8F4EF; /* Primary text - Warm off-white */
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
.font-anime {
    font-family: 'Mochiy Pop One', sans-serif;
}
.text-sakura {
    color: #D77A96; /* Rose accent */
}
.bg-sakura {
    background-color: #D77A96;
}
.bg-navy {
    background-color: #0D1424;
}
.text-champagne {
    color: #E8CC9A;
}
.bg-champagne {
    background-color: #E8CC9A;
}
.text-burgundy {
    color: #8F2948;
}
.bg-burgundy {
    background-color: #8F2948;
}
.bg-card {
    background-color: #1B253A;
}
.bg-elevated {
    background-color: #222D43;
}
.bg-secondary {
    background-color: #151D30;
}
.text-secondary {
    color: #C6C8D2;
}
.border-subtle {
    border-color: rgba(232, 204, 154, 0.20);
}
/* Style for the falling petals canvas */
#sakura-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Allows clicks to go through the canvas */
}
/* For hiding the scrollbar */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Fade in animation for reveal message */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile-First Responsive Styles */
/* Base mobile styles */
* {
    box-sizing: border-box;
}

/* Ensure content is above canvas */
header, main, footer {
    position: relative;
    z-index: 10;
}

main {
    padding-left: 16px;
    padding-right: 16px;
}

/* Scroll Progress Indicator */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #E8CC9A, #D77A96);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
    padding-top: env(safe-area-inset-top);
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for child elements */
.scroll-reveal .stagger-1 { transition-delay: 0.1s; }
.scroll-reveal .stagger-2 { transition-delay: 0.2s; }
.scroll-reveal .stagger-3 { transition-delay: 0.3s; }

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .text-gradient,
    .hero-bg-gradient,
    .animate-blink,
    .animate-float,
    .animate-shimmer,
    .animate-gradient {
        animation: none !important;
    }
    
    .animate-particle-float {
        animation: none !important;
    }
    
    #cursor {
        display: none !important;
    }
    
    #subtitle,
    #sorryText {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Custom utilities for Midnight Romance */
.text-gradient {
    background: linear-gradient(to right, #E8CC9A, #D77A96, #E8CC9A);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease infinite;
}

/* Hero Background Gradient */
.hero-bg-gradient {
    background: linear-gradient(to bottom right, rgba(143, 41, 72, 0.1), transparent, rgba(215, 122, 150, 0.1));
    animation: gradient 15s ease infinite;
    background-size: 200% 200%;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .text-gradient,
    .hero-bg-gradient,
    .animate-blink,
    .animate-float,
    .animate-shimmer,
    .animate-gradient {
        animation: none !important;
    }
    
    .animate-particle-float {
        animation: none !important;
    }
    
    #cursor {
        display: none !important;
    }
    
    #subtitle,
    #sorryText {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Animations */
@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes particle-float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.animate-gradient {
    animation: gradient 15s ease infinite;
}

.animate-shimmer {
    animation: shimmer 3s ease infinite;
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Hero Section */
header {
    min-height: 100svh; /* Use svh for better mobile support */
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.05;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    color: #2c3e50;
    text-shadow: none;
}

header p {
    font-size: clamp(0.875rem, 3vw, 1.125rem);
    line-height: 1.6;
    padding: 0 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#countdown {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    line-height: 1.4;
    padding: 0 8px;
    color: #F8F4EF;
}

#countdown span {
    color: #E8CC9A;
    font-weight: 600;
}

/* Section Spacing */
section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Headings */
section h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 8px;
}

section h3 {
    font-size: clamp(1.25rem, 3.5vw, 1.875rem);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Message Cards */
section > div > div,
section > div {
    width: 100%;
    max-width: 100%;
    padding: 16px 20px;
    overflow: hidden;
    background-color: #1B253A; /* Card background */
    border: 1px solid rgba(232, 204, 154, 0.20); /* Subtle border */
}

section > div > div p,
section > div p {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    line-height: 1.7;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Story Section Images */
.story-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
}

/* Gallery */
#lightgallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#lightgallery img {
    border-width: 3px;
    border-color: rgba(232, 204, 154, 0.20);
    min-height: 150px;
    object-fit: cover;
}

/* Lightbox fixes for mobile */
.lg-outer .lg-img-wrap {
    max-height: 80vh;
}

/* Music Section */
#spotifyPlayer {
    border-radius: 0;
    background-color: #151D30;
}

#currentSong {
    font-size: 0.875rem;
    color: #C6C8D2;
}

#playerError {
    background-color: #222D43;
    color: #F8F4EF;
}

/* Envelope Section */
#envelopeCard {
    transition: opacity 0.5s ease-in-out;
}

#envelopeMessage {
    transition: opacity 0.5s ease-in-out;
}

/* Surprise Buttons */
.surprise-btn {
    min-height: 48px;
}

.surprise-msg {
    transition: opacity 0.5s ease-in-out;
}

/* Final Reveal */
#finalRevealMessage {
    transition: opacity 0.5s ease-in-out;
}

/* Gift Room Section */
.gift-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gift-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(143, 41, 72, 0.15);
}

.gift-msg {
    transition: opacity 0.5s ease-in-out;
}

/* Song button active state */
.song-btn.active {
    border-color: #E8CC9A !important;
    background-color: rgba(232, 204, 154, 0.15) !important;
}

/* Button styling for Midnight Romance */
button.bg-sakura {
    background-color: #8F2948; /* Burgundy */
}

button.bg-sakura:hover {
    background-color: #A03055; /* Lighter burgundy on hover */
}

button:hover.bg-burgundy {
    background-color: #A03055; /* Lighter burgundy on hover */
}

/* Button focus states */
button:focus-visible {
    outline: 2px solid #E8CC9A;
    outline-offset: 2px;
}

/* Song button hover state */
.song-btn:hover {
    border-color: #D77A96 !important;
    background-color: rgba(215, 122, 150, 0.15) !important;
}

/* Additional iPhone/Safari improvements */
@supports (padding: max(0px)) {
    header {
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    footer {
        padding-bottom: max(32px, env(safe-area-inset-bottom));
    }
}

/* Mobile spacing for new sections */
@media (max-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Button sizing */
button {
    min-height: 44px;
    min-width: 44px;
}

/* Tablet Styles */
@media (min-width: 768px) {
    main {
        padding-left: 32px;
        padding-right: 32px;
    }

    section {
        margin-top: 4rem;
        margin-bottom: 4rem;
    }

    header {
        padding: 40px 32px;
    }

    section > div > div,
    section > div {
        padding: 24px 32px;
    }

    #lightgallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    main {
        padding-left: 48px;
        padding-right: 48px;
    }

    section {
        margin-top: 5rem;
        margin-bottom: 5rem;
    }

    #lightgallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Small Mobile (320px - 360px) */
@media (max-width: 360px) {
    main {
        padding-left: 12px;
        padding-right: 12px;
    }

    section > div > div,
    section > div {
        padding: 14px 16px;
    }

    #lightgallery {
        grid-template-columns: 1fr;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    #sakura-canvas {
        animation: none;
    }
}

/* Subtle Parallax for Hero Background */
header img {
    transform: translateZ(0);
    will-change: transform;
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
    header img {
        transition: transform 0.1s ease-out;
    }
}

/* Footer with safe area support */
footer {
    padding: 32px 16px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* Landscape Mobile */
@media (max-width: 932px) and (orientation: landscape) {
    header {
        min-height: auto;
        padding: 40px 16px;
    }

    section {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

