/* ============================================
   2025 New Year Wishes - Clean Theme
   ============================================ */

:root {
    --bg-dark: #0a0612;
    --bg-gradient-start: #1a0a1f;
    --bg-gradient-end: #0d0515;
    --accent-rose: #ff6b9d;
    --accent-gold: #ffd700;
    --accent-soft-pink: #ffb6c1;
    --accent-warm: #ff8c69;
    --text-light: #fff5f8;
    --text-muted: rgba(255, 245, 248, 0.7);
    --frame-color: #fff9f0;
    --frame-shadow: rgba(255, 107, 157, 0.3);
    
    --transition-duration: 2s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-dark) 50%, var(--bg-gradient-end) 100%);
    color: var(--text-light);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Start Overlay with Cover Image
   ============================================ */

.start-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: opacity 1s ease, visibility 1s ease;
}

.start-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
}

/* Dark overlay on cover image for text readability */
.start-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.start-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeInUp 1.5s ease;
}

.start-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.start-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

.heart-pulse {
    font-size: 2.5rem;
    margin-top: 2rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ============================================
   Firework Background
   ============================================ */

.firework-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework-rise 1s ease-out forwards;
}

.firework::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: spark-fly 1.5s ease-out forwards;
}

@keyframes firework-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0.5);
        opacity: 0;
    }
}

@keyframes spark-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ============================================
   Ambient Particles
   ============================================ */

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s ease-in-out infinite;
}

@keyframes float-particle {
    0%, 100% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 90vw;
    opacity: 0;
    transition: opacity 1s ease;
}

.main-content.visible {
    opacity: 1;
}

/* ============================================
   Wish Text
   ============================================ */

.wish-container {
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wish-text {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 500;
    color: var(--text-light);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    line-height: 1.5;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity var(--transition-duration) var(--transition-timing),
        transform var(--transition-duration) var(--transition-timing);
}

.wish-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.wish-text.exit {
    opacity: 0;
    transform: translateY(-20px);
}

/* ============================================
   Image Container with Frame - BIGGER
   ============================================ */

.image-container {
    perspective: 1000px;
    opacity: 0;
    transform: scale(0.9);
    transition: 
        opacity var(--transition-duration) var(--transition-timing),
        transform var(--transition-duration) var(--transition-timing);
}

.image-container.visible {
    opacity: 1;
    transform: scale(1);
}

.polaroid-frame {
    background: var(--frame-color);
    padding: 12px;
    border-radius: 4px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 60px var(--frame-shadow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: rotate(-1deg);
    transition: transform 0.5s ease;
    position: relative;
    max-width: min(85vw, 420px);
    width: min(85vw, 420px);
}

.polaroid-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 18px;
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.6) 0%, 
        rgba(255, 182, 193, 0.3) 100%);
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.polaroid-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.image-wrapper {
    overflow: hidden;
    border-radius: 2px;
    background: #f0f0f0;
    aspect-ratio: 4/5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.slide-image.loading {
    opacity: 0.5;
}

/* Decorative heart */
.polaroid-frame::after {
    content: '💕';
    position: absolute;
    bottom: -18px;
    right: -8px;
    font-size: 1.3rem;
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   Frame Variations - Different styles per slide
   ============================================ */

/* Style 1: Tilt left with swing animation */
.frame-style-1 .polaroid-frame {
    transform: rotate(-3deg);
    animation: swing 4s ease-in-out infinite;
}

.frame-style-1 .polaroid-frame::after {
    content: '✨';
    bottom: -15px;
    left: -10px;
    right: auto;
}

/* Style 2: Tilt right with gentle bob */
.frame-style-2 .polaroid-frame {
    transform: rotate(2deg);
    animation: bob 3s ease-in-out infinite;
}

.frame-style-2 .polaroid-frame::after {
    content: '🌸';
    top: -15px;
    right: -10px;
    bottom: auto;
}

/* Style 3: Straight with pulse glow */
.frame-style-3 .polaroid-frame {
    transform: rotate(0deg);
    animation: pulseGlow 3s ease-in-out infinite;
}

.frame-style-3 .polaroid-frame::after {
    content: '💖';
    bottom: -18px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Style 4: Tilt left with float */
.frame-style-4 .polaroid-frame {
    transform: rotate(-2deg);
    animation: floatFrame 4s ease-in-out infinite;
}

.frame-style-4 .polaroid-frame::after {
    content: '🦋';
    top: -20px;
    left: -5px;
    right: auto;
    bottom: auto;
    animation: flutter 2s ease-in-out infinite;
}

/* Style 5: Tilt right with wobble */
.frame-style-5 .polaroid-frame {
    transform: rotate(3deg);
    animation: wobble 5s ease-in-out infinite;
}

.frame-style-5 .polaroid-frame::after {
    content: '⭐';
    bottom: -15px;
    right: -12px;
    animation: twinkle 1.5s ease-in-out infinite;
}

/* Style 6: Dramatic tilt with sway */
.frame-style-6 .polaroid-frame {
    transform: rotate(-4deg);
    animation: sway 6s ease-in-out infinite;
}

.frame-style-6 .polaroid-frame::after {
    content: '🌙';
    top: -18px;
    right: 20px;
    bottom: auto;
}

/* Style 7: Slight right with heartbeat */
.frame-style-7 .polaroid-frame {
    transform: rotate(1deg);
    animation: frameHeartbeat 2s ease-in-out infinite;
}

.frame-style-7 .polaroid-frame::after {
    content: '💝';
    bottom: -20px;
    right: -5px;
}

/* Style 8: Center with shimmer */
.frame-style-8 .polaroid-frame {
    transform: rotate(0deg);
    animation: shimmer 3s ease-in-out infinite;
}

.frame-style-8 .polaroid-frame::after {
    content: '🌟';
    top: -15px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
}

/* Frame-specific animations */
@keyframes swing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(1deg); }
}

@keyframes bob {
    0%, 100% { transform: rotate(2deg) translateY(0); }
    50% { transform: rotate(2deg) translateY(-8px); }
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 60px var(--frame-shadow);
    }
    50% { 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 100px var(--accent-rose);
    }
}

@keyframes floatFrame {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    25% { transform: rotate(-1deg) translateY(-5px); }
    75% { transform: rotate(-3deg) translateY(-3px); }
}

@keyframes flutter {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(-10deg) translateY(-3px); }
    75% { transform: rotate(10deg) translateY(-3px); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(3deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(4deg); }
}

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

@keyframes sway {
    0%, 100% { transform: rotate(-4deg) translateX(0); }
    50% { transform: rotate(-2deg) translateX(5px); }
}

@keyframes frameHeartbeat {
    0%, 100% { transform: rotate(1deg) scale(1); }
    25% { transform: rotate(1deg) scale(1.02); }
    35% { transform: rotate(1deg) scale(1); }
    45% { transform: rotate(1deg) scale(1.03); }
}

@keyframes shimmer {
    0%, 100% { 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 60px var(--frame-shadow);
    }
    50% { 
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 0 80px var(--accent-gold);
    }
}

/* ============================================
   Final Message
   ============================================ */

.final-message {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 2s ease, visibility 2s ease;
    padding: 2rem;
}

.final-message.visible {
    opacity: 1;
    visibility: visible;
}

.final-title {
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 600;
    color: var(--accent-gold);
    text-shadow: 
        0 0 30px rgba(255, 215, 0, 0.5),
        0 0 60px rgba(255, 215, 0, 0.3);
    margin-bottom: 1rem;
    animation: glow 2s ease-in-out infinite alternate;
}

.final-subtitle {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 400;
    color: var(--text-light);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

.hearts-float {
    display: flex;
    gap: 1rem;
    font-size: 2rem;
}

.hearts-float span {
    animation: float 2s ease-in-out infinite;
}

.hearts-float span:nth-child(2) { animation-delay: 0.2s; }
.hearts-float span:nth-child(3) { animation-delay: 0.4s; }
.hearts-float span:nth-child(4) { animation-delay: 0.6s; }
.hearts-float span:nth-child(5) { animation-delay: 0.8s; }

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    35% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.15);
    }
    55% {
        transform: scale(1);
    }
}

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

@keyframes glow {
    from {
        text-shadow: 
            0 0 30px rgba(255, 215, 0, 0.5),
            0 0 60px rgba(255, 215, 0, 0.3);
    }
    to {
        text-shadow: 
            0 0 40px rgba(255, 215, 0, 0.7),
            0 0 80px rgba(255, 215, 0, 0.5),
            0 0 100px rgba(255, 215, 0, 0.3);
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 480px) {
    .polaroid-frame {
        padding: 8px;
        max-width: 90vw;
        width: 90vw;
    }
    
    .wish-container {
        min-height: 50px;
    }
    
    .main-content {
        gap: 1rem;
        padding: 1rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* Ensure smooth scrolling is disabled */
html {
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}
