/* -------------------------------------------------------------
   Core Ethereal Design 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.4);
    --glow-rose: rgba(244, 63, 94, 0.35);
    --glow-teal: rgba(45, 212, 191, 0.35);
    --glow-gold: rgba(251, 191, 36, 0.5);

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

    /* Transition Speeds */
    --transition-slow: 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: 0.2s ease;
}

/* -------------------------------------------------------------
   Base Resets & Main Shell Setup
   ------------------------------------------------------------- */
* {
    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; /* Lock scroll to control transitions via JS */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

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

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

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

/* -------------------------------------------------------------
   Glassmorphism System & Cards
   ------------------------------------------------------------- */
.glass-card {
    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.6);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 16px 40px -10px rgba(82, 66, 117, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 0 30px rgba(232, 219, 252, 0.4);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 48px -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.5);
}

/* -------------------------------------------------------------
   Slide Shell & Navigation Container
   ------------------------------------------------------------- */
.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    overflow: hidden;
}

/* Slider Section */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100vw) scale(0.95);
    transition: opacity var(--transition-slow), 
                transform var(--transition-slow), 
                visibility var(--transition-slow);
}

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

.slide.prev-slide {
    transform: translateX(-100vw) scale(0.95);
}

/* Inner Layouts */
.slide-content {
    max-width: 1100px;
    width: 90%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 3rem;
    padding: 2rem;
}

/* -------------------------------------------------------------
   Page-Specific Layout Variations
   ------------------------------------------------------------- */
/* Split horizontal column style */
.split-layout {
    flex-direction: row;
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

/* Vertical stack style */
.vertical-layout {
    flex-direction: column;
    justify-content: center;
    gap: 1.8rem;
}

/* Introductory page layout */
.intro-layout {
    flex-direction: row;
}

/* -------------------------------------------------------------
   Floating Anti-Gravity Photo Frames
   ------------------------------------------------------------- */
.photo-wrapper {
    position: relative;
    border-radius: 24px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(82, 66, 117, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-medium);
}

.photo-wrapper img {
    object-fit: cover;
    border-radius: 16px;
    display: block;
    max-height: 55vh;
    max-width: 100%;
    box-shadow: 0 4px 15px rgba(82, 66, 117, 0.1);
    transition: transform var(--transition-medium);
}

/* Anti-Gravity Floating Keyframe Animation */
.anti-gravity {
    animation: floatWeightless 6s ease-in-out infinite alternate;
}

@keyframes floatWeightless {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-15px) rotate(1.5deg) scale(1.01);
    }
    100% {
        transform: translateY(-5px) rotate(-1.5deg) scale(0.99);
    }
}

/* Micro-Pulse Floating for Cards */
.glass-card {
    animation: cardPulse 7s ease-in-out infinite alternate;
}

@keyframes cardPulse {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-8px);
    }
}

/* Circular Intro Frame */
.circular-wrapper {
    width: 320px;
    height: 320px;
    border-radius: 50% !important;
    overflow: visible;
}

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

/* Glow Rings around Frames */
.glow-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 28px;
    z-index: -1;
    opacity: 0.75;
    background: linear-gradient(135deg, #fbcfe8, #e9d5ff, #ccfbf1);
    filter: blur(12px);
    animation: glowShift 4s linear infinite alternate;
}

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

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

/* Custom glow colors */
.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, #f87171, #fb923c);
}
.glow-fun {
    background: linear-gradient(135deg, #fbbf24, #f472b6, #c084fc);
}

/* -------------------------------------------------------------
   Typography & Elements
   ------------------------------------------------------------- */
.elegant-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 2.8rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(82, 66, 117, 0.08);
}

.elegant-text {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    line-height: 1.6;
    color: var(--color-text-light);
    font-weight: 500;
}

.large-para {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text-dark);
    text-align: center;
}

.telugu-text {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    line-height: 1.8;
    font-style: italic;
    color: var(--color-text-dark);
    text-align: center;
    letter-spacing: 0.5px;
}

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

.font-accent {
    color: #831843; /* Rich rose-magenta */
}

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

.sparkle-deco {
    margin-top: 1.2rem;
    font-size: 1.1rem;
    color: #db2777; /* hot pink */
    opacity: 0.65;
    letter-spacing: 6px;
    text-align: center;
}

.text-wrapper {
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-right-side {
    text-align: left;
}

.text-left-side {
    text-align: left;
}

.centered-below {
    max-width: 680px;
    text-align: center;
}

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

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

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

/* -------------------------------------------------------------
   Page 5 Playful Details
   ------------------------------------------------------------- */
.fun-twist-card {
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 2.5rem;
}

.twist-sub {
    display: block;
    margin-top: 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #db2777;
    opacity: 0.95;
    text-align: center;
}

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

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

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

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

.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.5;
        filter: blur(8px);
    }
    100% {
        transform: translate(8px, 5px) scale(0.98);
        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: 100%;
    max-width: 580px;
    padding: 3rem 2.2rem;
    border: 1px dashed rgba(251, 191, 36, 0.4);
    box-shadow: 0 20px 50px -10px rgba(82, 66, 117, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                0 0 35px rgba(251, 191, 36, 0.25);
}

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

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

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

/* Glowing Gold Shimmer for Finale Title */
.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.1rem;
    font-weight: 700;
    padding: 1rem 2.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.35),
                0 0 15px rgba(236, 72, 153, 0.2);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.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 30px rgba(236, 72, 153, 0.5),
                0 0 25px rgba(236, 72, 153, 0.35);
}

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

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

/* -------------------------------------------------------------
   Interactive Elements & Navigation Elements
   ------------------------------------------------------------- */
/* Side Navigation Arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    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.6);
    color: var(--color-text-dark);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px -5px rgba(82, 66, 117, 0.15);
    z-index: 90;
    transition: all var(--transition-medium);
    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 35px -3px rgba(192, 132, 252, 0.28),
                    0 0 20px rgba(192, 132, 252, 0.2);
    }
}

.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.22;
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
}

.prev-arrow {
    left: 40px;
}

.next-arrow {
    right: 40px;
}

/* Bottom Nav Dots Indicator */
.dots-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 90;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.65rem 1.4rem;
    border-radius: 50px;
    box-shadow: 0 8px 25px -5px rgba(82, 66, 117, 0.1);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(82, 66, 117, 0.25);
    border: none;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.dot:hover {
    background: rgba(219, 39, 119, 0.5);
    transform: scale(1.2);
}

.dot.active {
    background: #db2777;
    transform: scale(1.35);
    box-shadow: 0 0 10px rgba(219, 39, 119, 0.5);
}

/* 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 Confetti & Sparkles
   ------------------------------------------------------------- */
.canvas-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 99;
}

/* -------------------------------------------------------------
   Responsive Breakpoints & Touch Optimization
   ------------------------------------------------------------- */
@media (max-width: 992px) {
    .slide-content {
        flex-direction: column !important;
        justify-content: center;
        gap: 2.2rem;
        width: 88%;
        height: 80%;
    }

    .text-wrapper {
        text-align: center !important;
        max-width: 90%;
        padding: 1.5rem 1.8rem;
    }
    
    .text-right-side, .text-left-side {
        text-align: center;
    }

    .elegant-title {
        font-size: 2.2rem;
    }

    .elegant-text {
        font-size: 1.15rem;
    }

    .large-para {
        font-size: 1.35rem;
    }
    
    .telugu-text {
        font-size: 1.35rem;
    }

    .photo-wrapper img {
        max-height: 38vh;
    }

    .circular-wrapper {
        width: 230px;
        height: 230px;
    }

    .prev-arrow {
        left: 20px;
    }

    .next-arrow {
        right: 20px;
    }
    
    .nav-arrow {
        width: 52px;
        height: 52px;
    }
    
    .nav-arrow svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 576px) {
    .slide {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .slide-content {
        width: 100%;
        padding: 1.2rem 0.6rem;
        gap: 0.8rem !important;
        justify-content: center !important;
        height: 100%;
    }

    .photo-wrapper {
        padding: 5px !important;
        max-width: 80% !important;
    }

    .photo-wrapper img {
        max-height: 25vh !important;
        max-width: 100% !important;
        border-radius: 12px !important;
    }

    .circular-wrapper {
        width: 140px !important;
        height: 140px !important;
    }

    .glass-card {
        padding: 1.1rem 1.3rem !important;
        border-radius: 18px !important;
        width: 90% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }

    .elegant-title {
        font-size: 1.4rem !important;
        margin-bottom: 0.4rem !important;
    }

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

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

    .nav-arrow {
        display: none; /* Swipe & bottom indicator dots are extremely robust on mobile screens */
    }

    .dots-indicator {
        bottom: 12px !important;
        padding: 0.45rem 1rem !important;
        gap: 0.55rem !important;
    }

    .dot {
        width: 8px !important;
        height: 8px !important;
    }

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

    .mouse-icon {
        width: 20px !important;
        height: 32px !important;
    }

    .mouse-icon .wheel {
        width: 3px !important;
        height: 6px !important;
    }
    
    .crystal-heart-wrapper {
        width: 130px !important;
        height: 130px !important;
        margin-bottom: 0.5rem !important;
    }

    .finale-card {
        padding: 1.5rem 1.2rem !important;
        max-width: 320px !important;
    }

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

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

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

/* Device aspect ratio adjustments for small landscapes */
@media (max-height: 500px) and (orientation: landscape) {
    .slide-content {
        flex-direction: row !important;
        height: 90%;
        gap: 1rem;
    }

    .photo-wrapper img {
        max-height: 50vh;
    }

    .circular-wrapper {
        width: 140px;
        height: 140px;
    }

    .text-wrapper {
        max-width: 50%;
        padding: 1rem;
    }

    .elegant-title {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

    .elegant-text {
        font-size: 0.95rem;
    }

    .swipe-hint {
        display: none;
    }
}
