@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
    --primary-color: #6366f1; /* Indigo */
    --secondary-color: #ec4899; /* Pink */
    --accent-color: #f59e0b; /* Amber */
    --bg-dark: #0f172a; /* Slate 900 */
    --bg-card: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --border-color: rgba(255, 255, 255, 0.1);
}

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

html {
    background-color: #0f172a;
    min-height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0f172a;
    background-image: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    background-attachment: fixed; /* Fixes iOS Safari gradient scrolling bug */
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background animated elements */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: moveBlob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 { top: -10%; left: -10%; width: 40vw; height: 40vw; background: var(--primary-color); animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 50vw; height: 50vw; background: var(--secondary-color); animation-delay: -5s; }
.blob-3 { top: 40%; left: 30%; width: 30vw; height: 30vw; background: var(--accent-color); animation-delay: -10s; }

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

/* Container */
.container {
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

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

/* Typography and Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    background: linear-gradient(to right, #f472b6, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

.invitation-text {
    font-size: 1.125rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.invitation-text span.highlight {
    color: var(--accent-color);
    font-weight: 600;
}

.party-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.party-details p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

.party-details p strong {
    white-space: nowrap;
    min-width: 80px; /* Ensures consistent indentation if desired, though optional */
}

.party-details p:last-child {
    margin-bottom: 0;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    animation: slideIn 0.5s ease-out both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-group.horizontal {
    flex-direction: row;
    gap: 1.5rem;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.radio-option:hover, .checkbox-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.radio-option input, .checkbox-option input {
    accent-color: var(--primary-color);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.number-inputs {
    display: flex;
    gap: 1.5rem;
}

.input-cont {
    flex: 1;
}

input[type="number"], input[type="text"], input[type="password"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

input[type="number"]:focus, input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    margin-top: 1rem;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Conditional Logic containers */
#yes-options, #no-options {
    display: none;
    overflow: hidden;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-yes {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-no {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.reason-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Balloons Animation */
.balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -150px;
    font-size: 4rem;
    animation: floatUp infinite ease-in;
    opacity: 0.9;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
}

.b1 { left: 15%; animation-duration: 14s; animation-delay: 0s; font-size: 3.5rem; }
.b2 { left: 45%; animation-duration: 11s; animation-delay: 2s; font-size: 5rem; }
.b3 { left: 75%; animation-duration: 16s; animation-delay: 5s; font-size: 4rem; }
.b4 { left: 85%; animation-duration: 13s; animation-delay: 8s; font-size: 3rem; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-60vh) rotate(15deg); }
    100% { transform: translateY(-120vh) rotate(-10deg); }
}

/* Cake and Candle Elements */
.cake-container {
    margin: 3.5rem auto 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 1.5s ease-out;
}

.cake {
    position: relative;
    width: 140px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.cake-tier {
    position: relative;
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3), inset 0 5px 10px rgba(255,255,255,0.2);
    border-bottom: 5px solid rgba(0,0,0,0.15);
}

.bottom-tier {
    width: 140px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    background-image: 
        radial-gradient(circle at 20% 30%, #facc15 3px, transparent 4px),
        radial-gradient(circle at 50% 60%, #f43f5e 3px, transparent 4px),
        radial-gradient(circle at 80% 40%, #22c55e 3px, transparent 4px),
        radial-gradient(circle at 30% 70%, #a855f7 3px, transparent 4px),
        radial-gradient(circle at 70% 20%, #ec4899 3px, transparent 4px),
        radial-gradient(circle at 90% 80%, #facc15 3px, transparent 4px);
    z-index: 1;
}

.bottom-tier::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 12px;
    background: #ffedd5;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.1);
}

.top-tier {
    width: 100px;
    height: 40px;
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
    background-image: 
        radial-gradient(circle at 25% 40%, #facc15 3px, transparent 4px),
        radial-gradient(circle at 75% 60%, #ec4899 3px, transparent 4px),
        radial-gradient(circle at 50% 30%, #22c55e 3px, transparent 4px);
    z-index: 2;
    margin-bottom: -5px;
}

.top-tier::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 10px;
    background: #ffffff;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.1);
}

.candle {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 40px;
    background: repeating-linear-gradient(45deg, #fff, #fff 5px, #f43f5e 5px, #f43f5e 10px);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.3);
    z-index: 3;
}

.candle-number {
    font-weight: 800;
    font-size: 1.5rem;
    color: #1e1b4b;
    z-index: 2;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.9);
}

.flame {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 22px;
    background: #fbbf24;
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 0 20px #f59e0b, 0 0 40px #f59e0b, 0 0 60px #ef4444;
    animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) rotate(-3deg); opacity: 0.9; }
    50% { transform: translateX(-50%) scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: translateX(-50%) scale(0.9) rotate(-2deg); opacity: 0.8; }
}

/* Magic Surprise Styles */
.magic-surprise {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(236, 72, 153, 0.4);
    border-radius: 12px;
    animation: pulseMagic 3s infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.magic-surprise p {
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0;
    background: linear-gradient(to right, #facc15, #f472b6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.magic-icon {
    font-size: 2.5rem;
    display: inline-block;
    animation: bounceHat 2s infinite ease-in-out;
}

@keyframes pulseMagic {
    0% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.4); }
    100% { box-shadow: 0 0 30px rgba(236, 72, 153, 0.5); border-color: rgba(236, 72, 153, 0.8); }
}

@keyframes bounceHat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 6;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 24px;
    top: -30px;
    animation: fall linear infinite;
    opacity: 0.8;
    border-radius: 3px;
}

.c1 { left: 10%; background: #facc15; animation-duration: 4s; animation-delay: 0s; }
.c2 { left: 30%; background: #3b82f6; animation-duration: 5s; animation-delay: 2s; }
.c3 { left: 50%; background: #ef4444; animation-duration: 3.5s; animation-delay: 1s; }
.c4 { left: 70%; background: #22c55e; animation-duration: 6s; animation-delay: 3s; }
.c5 { left: 90%; background: #a855f7; animation-duration: 4.5s; animation-delay: 1.5s; }
.c6 { left: 20%; background: #ec4899; animation-duration: 5.5s; animation-delay: 0.5s; }
.c7 { left: 60%; background: #06b6d4; animation-duration: 3.8s; animation-delay: 2.5s; }
.c8 { left: 80%; background: #fb923c; animation-duration: 4.2s; animation-delay: 1.2s; }

@keyframes fall {
    0% { transform: translateY(-30px) rotate(0deg) scale(1); }
    100% { transform: translateY(110vh) rotate(720deg) scale(0.8); }
}

/* Interactive Chameleon and Fly */
/* Interactive Chameleon and Fly */
.chameleon {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 20;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
    user-select: none;
    cursor: pointer;
}

#cham-head {
    animation: headBob 2.5s infinite ease-in-out alternate;
}

@keyframes headBob {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(3deg); }
}

#cham-eyelid {
    animation: blink 4s infinite ease-in-out;
}

@keyframes blink {
    0%, 90%, 100% { transform: translateY(-50px); }
    95% { transform: translateY(0px); }
}

.tongue {
    position: fixed;
    z-index: 19;
    height: 8px;
    background: #ec4899; /* Pink tongue */
    border-radius: 4px;
    transform-origin: left center;
    width: 0; /* Hidden by default */
    display: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.tongue::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    width: 16px;
    height: 16px;
    background: #ec4899;
    border-radius: 50%;
}

.fly {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 1.5rem;
    z-index: 25;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
    transition: transform 2s ease-in-out;
}

/* Comprehensive Responsive Adjustments for Mobile */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }
    
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 1.5rem 1rem 4rem;
        border: none;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.5rem; }
    .greeting { font-size: 1.25rem; }
    .invitation-text { font-size: 1rem; }

    /* Move balloons to edges, send backward, and make smaller to avoid overlapping text deeply */
    .balloon {
        font-size: 2.5rem !important;
        opacity: 0.3 !important;
        z-index: -1;
    }
    .b1 { left: -5%; }
    .b2 { left: 90%; }
    .b3 { left: 5%; }
    .b4 { left: 85%; }
    
    .confetti {
        width: 6px;
        height: 12px;
        opacity: 0.3;
    }

    /* Target the SVG class directly */
    .chameleon {
        width: 100px;
        height: 100px;
        left: -15px;
        bottom: 5px;
    }

    .cake-container {
        margin: 1.5rem auto 1rem;
        transform: scale(0.85);
    }
    
    .magic-surprise {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .magic-surprise p {
        font-size: 1.1rem;
    }
    
    .magic-icon {
        font-size: 2rem;
    }
}
