/* -------------------------------------------------------------
   Core Ethereal Design System & Tokens
   ------------------------------------------------------------- */
:root {
    /* Dreamy Pastel Palette */
    --pastel-lavender: #E8DBFC;
    --pastel-pink: #FCDCE1;
    --pastel-mint: #E0F4EE;
    --pastel-blue: #D6E8FA;
    
    /* Glowing accents */
    --glow-violet: rgba(192, 132, 252, 0.45);
    --glow-rose: rgba(244, 63, 94, 0.4);
    --glow-teal: rgba(45, 212, 191, 0.4);
    --glow-gold: rgba(251, 191, 36, 0.5);

    /* Text Colors */
    --color-text-dark: #2d1d4c;
    --color-text-light: #524275;
    --color-rose-deep: #9d174d;
    --color-gold-deep: #b2851a;
    
    /* Typography */
    --font-serif: "Playfair Display", Georgia, serif;
    --font-sans: "Quicksand", system-ui, -apple-system, sans-serif;
    --font-script: "Great Vibes", cursive;

    /* Transition Timings (GPU-Accelerated Ease) */
    --transition-slide: 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-hover: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* -------------------------------------------------------------
   Base Resets & Strict Scroll Locks
   ------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-dark);
    background-color: var(--pastel-lavender);
    overflow: hidden; /* Fully locks native scroll */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    touch-action: none; /* Prevents mobile browser pull-to-refresh & rubber-banding */
    user-select: none;
    -webkit-user-select: none;
}

/* -------------------------------------------------------------
   Animated Ethereal Particle Background
   ------------------------------------------------------------- */
#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: color-burn;
}

/* Morphing Background Gradient */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 25% 25%, var(--pastel-mint) 0%, transparent 40%),
                radial-gradient(circle at 75% 35%, var(--pastel-pink) 0%, transparent 45%),
                radial-gradient(circle at 35% 75%, var(--pastel-lavender) 0%, transparent 50%),
                radial-gradient(circle at 85% 85%, var(--pastel-blue) 0%, transparent 40%);
    z-index: -2;
    animation: backgroundShift 28s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% {
        transform: rotate(0deg) scale(1) translate(0, 0);
    }
    50% {
        transform: rotate(8deg) scale(1.1) translate(2%, 4%);
    }
    100% {
        transform: rotate(-6deg) scale(1) translate(-2%, -3%);
    }
}

/* -------------------------------------------------------------
   Slide Shell & 3D Hardware Slide Transitions
   ------------------------------------------------------------- */
.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    overflow: hidden;
    touch-action: none;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    /* translate3d engages mobile GPU rasterization for locked 60fps/120fps chimes */
    transform: translate3d(100vw, 0, 0) scale(0.95);
    transition: opacity var(--transition-slide), 
                transform var(--transition-slide), 
                visibility var(--transition-slide);
    touch-action: none;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
}

.slide.prev-slide {
    transform: translate3d(-100vw, 0, 0) scale(0.95);
}

.slide-content {
    width: 90%;
    max-width: 1000px;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    touch-action: none;
}

/* -------------------------------------------------------------
   Unified Glassmorphic Polaroid Cards
   ------------------------------------------------------------- */
.card-polaroid {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    padding: 1.8rem 1.8rem 2rem 1.8rem;
    width: 100%;
    max-width: 440px; /* Perfect desktop standard */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 48px -10px rgba(82, 66, 117, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 0 35px rgba(232, 219, 252, 0.45);
    transition: transform var(--transition-hover), box-shadow var(--transition-hover);
    touch-action: none;
}

.card-polaroid:hover {
    transform: translateY(-4px) rotate(0.5deg);
    box-shadow: 0 24px 56px -8px rgba(82, 66, 117, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                0 0 45px rgba(252, 220, 225, 0.55);
}

/* Ethereal Floating Keyframes */
.anti-gravity {
    animation: floatWeightless 6s ease-in-out infinite alternate;
}

@keyframes floatWeightless {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(0.8deg);
    }
    100% {
        transform: translateY(-4px) rotate(-0.8deg);
    }
}

/* -------------------------------------------------------------
   Photo Frames inside Polaroid Cards
   ------------------------------------------------------------- */
.photo-frame {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 30px rgba(82, 66, 117, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.6rem;
    overflow: visible;
}

.photo-frame img {
    object-fit: cover;
    display: block;
    max-height: 40vh; /* Scaled to leave plenty of vertical breathing room */
    width: 100%;
    box-shadow: 0 4px 15px rgba(82, 66, 117, 0.08);
}

/* Rounded Rectangular Frame */
.rect-frame {
    border-radius: 18px;
    padding: 8px;
}

.rect-frame img {
    border-radius: 14px;
}

/* Circular Frame (Page 1) */
.circular-frame {
    width: 250px;
    height: 250px;
    border-radius: 50% !important;
    padding: 8px;
}

.circular-frame img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-position: top center;
}

/* Glow Rings behind Frames */
.glow-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 22px;
    z-index: -1;
    opacity: 0.8;
    filter: blur(12px);
    animation: glowShift 4s linear infinite alternate;
}

.circular-frame .glow-ring {
    border-radius: 50% !important;
    filter: blur(18px);
}

@keyframes glowShift {
    0% {
        transform: scale(0.97);
        filter: blur(10px) brightness(1);
    }
    100% {
        transform: scale(1.03);
        filter: blur(16px) brightness(1.22);
    }
}

.glow-intro { background: linear-gradient(135deg, #ec4899, #c084fc, #93c5fd); }
.glow-spark { background: linear-gradient(135deg, #818cf8, #a78bfa, #f472b6); }
.glow-secret { background: linear-gradient(135deg, #fb7185, #f472b6, #2dd4bf); }
.glow-promise { background: linear-gradient(135deg, #ef4444, #fb923c, #fcd34d); }
.glow-fun { background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc); }

/* -------------------------------------------------------------
   Typography & Captions
   ------------------------------------------------------------- */
.card-caption {
    width: 100%;
    text-align: center;
}

.elegant-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--color-text-dark);
    margin-bottom: 0.6rem;
    line-height: 1.2;
    text-shadow: 0 1px 6px rgba(82, 66, 117, 0.05);
}

.elegant-text {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--color-text-light);
    font-weight: 600;
}

.large-para {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.telugu-text {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--color-text-dark);
    letter-spacing: 0.2px;
}

.font-fantasy {
    background: linear-gradient(45deg, #4f46e5, #86198f, #be185d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.font-accent {
    color: var(--color-rose-deep);
}

.font-greatvibes {
    font-family: var(--font-script) !important;
    font-size: 3.2rem !important;
}

.sparkle-deco {
    margin-top: 1rem;
    font-size: 1rem;
    color: #db2777;
    opacity: 0.65;
    letter-spacing: 6px;
}

.twist-sub {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #db2777;
    opacity: 0.9;
}

/* -------------------------------------------------------------
   Page 4 Nebula Glow
   ------------------------------------------------------------- */
.nebula-container {
    position: relative;
    overflow: hidden;
}

.nebula-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,63,94,0.22) 0%, rgba(251,146,60,0.12) 50%, transparent 100%);
    filter: blur(20px);
    z-index: -1;
    animation: nebulaMove 8s infinite alternate ease-in-out;
}

@keyframes nebulaMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-25px, 30px) scale(1.25); }
}

/* -------------------------------------------------------------
   Page 6: The Grand Finale & Crystal Heart
   ------------------------------------------------------------- */
.finale-layout {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.crystal-heart-wrapper {
    cursor: pointer;
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 10px 22px rgba(236, 72, 153, 0.35));
    transition: transform var(--transition-hover);
}

.crystal-heart-wrapper:hover {
    transform: scale(1.05) translateY(-3px);
}

.crystal-heart-wrapper:active {
    transform: scale(0.97);
}

.crystal-heart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Heart Glow Pulse */
.heart-pulse-glow {
    transform-origin: 42px 45px;
    animation: heartBackGlowPulse 2.5s ease-in-out infinite alternate;
}

@keyframes heartBackGlowPulse {
    0% {
        transform: translate(8px, 5px) scale(0.85);
        opacity: 0.45;
        filter: blur(8px);
    }
    100% {
        transform: translate(8px, 5px) scale(0.96);
        opacity: 0.95;
        filter: blur(14px);
    }
}

.heart-front {
    transform-origin: 42px 45px;
    animation: heartFrontPulse 2.5s ease-in-out infinite alternate;
}

@keyframes heartFrontPulse {
    0% {
        transform: translate(8px, 5px) scale(0.85);
        filter: drop-shadow(0 4px 6px rgba(236,72,153,0.15));
    }
    100% {
        transform: translate(8px, 5px) scale(0.92);
        filter: drop-shadow(0 10px 15px rgba(236,72,153,0.3));
    }
}

/* Finale Glass Card */
.finale-card {
    text-align: center;
    width: 90%;
    max-width: 480px;
    padding: 2.2rem 1.6rem;
    border: 1px dashed rgba(251, 191, 36, 0.4);
    box-shadow: 0 16px 40px -10px rgba(82, 66, 117, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                0 0 30px rgba(251, 191, 36, 0.22);
}

.grand-birthday-title {
    font-size: 2.6rem;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.grand-sub-title {
    color: #be185d;
    margin-bottom: 1rem;
}

.grand-name {
    font-size: 1.8rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

/* Glowing Gold Shimmer */
.animate-gold {
    background: linear-gradient(45deg, #d97706, #fbbf24, #f59e0b, #be185d, #4f46e5);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineGold 4s linear infinite;
}

@keyframes shineGold {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Premium Action Button */
.glow-action-btn {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.35),
                0 0 12px rgba(236, 72, 153, 0.2);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-hover);
}

.glow-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: all 0.6s ease;
}

.glow-action-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.45),
                0 0 20px rgba(236, 72, 153, 0.3);
}

.glow-action-btn:hover::before {
    left: 100%;
}

.glow-action-btn:active {
    transform: translateY(1px) scale(0.99);
}

/* -------------------------------------------------------------
   Interactive Navigation Shell Elements
   ------------------------------------------------------------- */
/* Side Navigation Arrows (Desktop Only) */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: var(--color-text-dark);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px -5px rgba(82, 66, 117, 0.15);
    z-index: 90;
    transition: all var(--transition-hover);
    animation: arrowGlowPulse 3s infinite alternate ease-in-out;
}

@keyframes arrowGlowPulse {
    0% {
        box-shadow: 0 8px 24px -5px rgba(82, 66, 117, 0.15),
                    0 0 5px rgba(255,255,255,0.2);
    }
    100% {
        box-shadow: 0 12px 30px -3px rgba(192, 132, 252, 0.25),
                    0 0 15px rgba(192, 132, 252, 0.15);
    }
}

.nav-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.7);
    color: #db2777;
    transform: translateY(-50%) scale(1.08);
}

.nav-arrow:active:not(:disabled) {
    transform: translateY(-50%) scale(0.96);
}

.nav-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
}

.prev-arrow { left: 40px; }
.next-arrow { right: 40px; }



/* Page Swipe Hint (Page 1) */
.swipe-hint {
    position: absolute;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0.85;
}

.swipe-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-light);
    animation: swipeLeftRight 2.2s infinite ease-in-out;
}

@keyframes swipeLeftRight {
    0%, 100% {
        transform: translateX(-15px) rotate(-8deg);
        opacity: 0.5;
    }
    50% {
        transform: translateX(15px) rotate(8deg);
        opacity: 1;
    }
}

/* -------------------------------------------------------------
   Interactive Particles & Sparkles
   ------------------------------------------------------------- */
.canvas-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 99;
}

/* -------------------------------------------------------------
   Highly Targeted Mobile Responsive Breakpoints
   ------------------------------------------------------------- */
@media (max-width: 992px) {
    .elegant-title { font-size: 1.85rem; }
    .elegant-text { font-size: 1.05rem; }
    .large-para { font-size: 1.15rem; }
    .telugu-text { font-size: 1.15rem; }
    
    .prev-arrow { left: 20px; }
    .next-arrow { right: 20px; }
    
    .nav-arrow {
        width: 52px;
        height: 52px;
    }
    
    .nav-arrow svg {
        width: 26px;
        height: 26px;
    }
}

/* Mobile Portrait Layouts (Strict constraints to eliminate vertical scroll) */
@media (max-width: 576px) {
    .slides-container, .slide {
        height: 100%;
        touch-action: none !important;
    }

    .slide-content {
        width: 100%;
        padding: 1rem 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    .card-polaroid {
        padding: 1.1rem 1.1rem 1.3rem 1.1rem !important;
        border-radius: 20px !important;
        width: 86% !important;
        max-width: 295px !important;
        box-shadow: 0 12px 35px -8px rgba(82, 66, 117, 0.12);
        animation: cardPulseMobile 7s ease-in-out infinite alternate;
    }

    @keyframes cardPulseMobile {
        0% { transform: translateY(0) scale(1); }
        100% { transform: translateY(-5px) scale(1.01); }
    }

    /* Polaroid Image constraints on phones */
    .photo-frame {
        margin-bottom: 1.1rem !important;
        padding: 5px !important;
    }

    .photo-frame img {
        max-height: 24vh !important; /* Forces perfect vertical proportions */
        border-radius: 10px !important;
    }

    .circular-frame {
        width: 150px !important;
        height: 150px !important;
        padding: 6px !important;
    }

    /* Font size reductions to prevent text wrapping clipping */
    .elegant-title {
        font-size: 1.35rem !important;
        margin-bottom: 0.35rem !important;
    }

    .elegant-text {
        font-size: 0.88rem !important;
        line-height: 1.4 !important;
    }

    .large-para {
        font-size: 1rem !important;
        line-height: 1.45 !important;
    }
    
    .telugu-text {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }

    .sparkle-deco {
        margin-top: 0.65rem !important;
        font-size: 0.8rem !important;
        letter-spacing: 4px !important;
    }

    .twist-sub {
        margin-top: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .nav-arrow {
        display: flex !important; /* Keep side arrow buttons visible on mobile */
        width: 38px !important;
        height: 38px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
    }

    .nav-arrow svg {
        width: 20px !important;
        height: 20px !important;
    }

    .prev-arrow {
        left: 8px !important;
    }

    .next-arrow {
        right: 8px !important;
    }

    .swipe-hint {
        bottom: 58px !important;
        font-size: 0.8rem !important;
        gap: 0.25rem !important;
    }

    .swipe-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .crystal-heart-wrapper {
        width: 120px !important;
        height: 120px !important;
        margin-bottom: 0.3rem !important;
    }

    .crystal-heart-wrapper svg {
        width: 120px !important;
        height: 120px !important;
    }

    .finale-card {
        padding: 1.3rem 1rem !important;
        max-width: 295px !important;
        border-radius: 20px !important;
    }

    .grand-birthday-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.2rem !important;
    }

    .grand-sub-title {
        font-size: 1.7rem !important;
        margin-bottom: 0.4rem !important;
    }

    .grand-name {
        font-size: 1.1rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.8rem !important;
    }
    
    .glow-action-btn {
        padding: 0.7rem 1.4rem !important;
        font-size: 0.8rem !important;
    }
}

/* Landscape orientation mobile adjustments */
@media (max-height: 480px) and (orientation: landscape) {
    .card-polaroid {
        flex-direction: row !important;
        max-width: 520px !important;
        padding: 1rem !important;
        gap: 1rem !important;
    }

    .photo-frame {
        max-width: 40% !important;
        margin-bottom: 0 !important;
    }

    .photo-frame img {
        max-height: 50vh !important;
    }

    .circular-frame {
        width: 110px !important;
        height: 110px !important;
    }

    .card-caption {
        max-width: 60% !important;
        text-align: left !important;
    }

    .elegant-title {
        font-size: 1.25rem !important;
        text-align: left !important;
    }

    .elegant-text {
        font-size: 0.85rem !important;
        text-align: left !important;
    }

    .swipe-hint {
        display: none !important;
    }
}
