/* Base Variables and Reset */
:root {
    --bg-dark: #0a0b10;
    --bg-card: rgba(18, 18, 32, 0.75);
    --spidey-red: #ff2525;
    --spidey-red-glow: rgba(255, 37, 37, 0.5);
    --spidey-blue: #00d2ff;
    --spidey-blue-glow: rgba(0, 210, 255, 0.5);
    --spidey-yellow: #f5c518;
    --text-white: #ffffff;
    --text-muted: #b0b3b8;
    --font-comic: 'Bangers', cursive;
    --font-sans: 'Montserrat', sans-serif;
    --glow-shadow-red: 0 0 15px var(--spidey-red);
    --glow-shadow-blue: 0 0 15px var(--spidey-blue);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-sans);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    /* Repeating spider web-like grid lines for comic style background */
    background-image: 
        radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.4) 100%),
        radial-gradient(rgba(255, 37, 37, 0.05) 1px, transparent 0),
        radial-gradient(rgba(0, 210, 255, 0.05) 1px, transparent 0);
    background-size: 100% 100%, 40px 40px, 30px 30px;
    background-position: center, 0 0, 15px 15px;
}

/* Background Canvas */
#web-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto; /* Allow mouse events to shoot webs */
}

/* Utilities */
.hidden {
    display: none !important;
}

/* --- Curtain Intro Screen --- */
#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.8s ease, visibility 0.8s;
    background-image: 
        radial-gradient(circle at center, transparent 20%, #000000 80%),
        repeating-radial-gradient(circle at center, transparent, transparent 15px, rgba(0, 210, 255, 0.05) 16px, rgba(0, 210, 255, 0.05) 18px);
}

#intro-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 30%, transparent 100px, rgba(229, 9, 20, 0.1) 300px);
    pointer-events: none;
}

.intro-content {
    max-width: 600px;
    padding: 20px;
    z-index: 2;
    animation: zoomIn 0.8s ease-out;
}

.spider-logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    position: relative;
    filter: drop-shadow(0 0 15px var(--spidey-red));
    animation: pulseLogo 2s infinite ease-in-out;
}

.spider-logo-intro {
    width: 100%;
    height: 100%;
}

.intro-title {
    font-family: var(--font-comic);
    font-size: 3rem;
    letter-spacing: 2px;
    color: var(--spidey-yellow);
    text-shadow: 
        -2px -2px 0 #000,  
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000,
         0 0 10px rgba(245, 197, 24, 0.5);
    margin-bottom: 15px;
    line-height: 1.1;
}

.intro-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 600;
    letter-spacing: 1px;
}

#open-invitation-btn {
    background: linear-gradient(135deg, var(--spidey-red) 0%, #b3070f 100%);
    border: 3px solid #000;
    color: #fff;
    padding: 15px 40px;
    font-family: var(--font-comic);
    font-size: 1.8rem;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 0 #000, 0 15px 25px rgba(229, 9, 20, 0.4);
    transition: all 0.2s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

#open-invitation-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255,255,255,0) 40%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 60%);
    transform: rotate(45deg);
    transition: all 0.5s;
    animation: shineBtn 3s infinite;
}

#open-invitation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #000, 0 20px 30px rgba(229, 9, 20, 0.6);
    background: linear-gradient(135deg, #ff4148 0%, #d80b13 100%);
}

#open-invitation-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #000, 0 5px 10px rgba(229, 9, 20, 0.3);
}

/* --- Floating Music Player --- */
#audio-control-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#music-toggle {
    background: rgba(18, 18, 32, 0.8);
    border: 2px solid var(--spidey-red);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 37, 37, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

#music-toggle:hover {
    transform: scale(1.1);
    border-color: var(--spidey-blue);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
}

.music-icon {
    width: 32px;
    height: 32px;
    fill: var(--text-white);
    transition: fill 0.3s;
}

#music-toggle:hover .music-icon {
    fill: var(--spidey-blue);
}

#music-toggle.playing {
    border-color: var(--spidey-blue);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.7);
    animation: rotateSpidey 15s linear infinite;
}

#music-toggle.playing .music-icon {
    fill: var(--spidey-blue);
}

/* Visual soundwave bars inside the button when playing */
.sound-wave {
    position: absolute;
    bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 12px;
    width: 30px;
}

.sound-wave span {
    width: 3px;
    height: 3px;
    background-color: var(--spidey-blue);
    margin: 0 1px;
    border-radius: 50px;
    transform-origin: bottom;
    transition: height 0.2s ease;
    display: none;
}

#music-toggle.playing .sound-wave span {
    display: block;
    animation: bounceWave 1.2s ease-in-out infinite alternate;
}

.sound-wave span:nth-child(2) { animation-delay: 0.15s; }
.sound-wave span:nth-child(3) { animation-delay: 0.3s; }
.sound-wave span:nth-child(4) { animation-delay: 0.45s; }

/* --- Main Layout & Content --- */
#main-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Web Shooting Tip */
.web-tip {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--spidey-blue);
    background: rgba(0, 210, 255, 0.1);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px dashed var(--spidey-blue);
    animation: floatText 3s ease-in-out infinite;
    text-align: center;
}

/* --- Card Styles (3D Tilt effect) --- */
.card-container {
    perspective: 1000px;
    width: 100%;
}

.invitation-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 2px rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.invitation-card:hover {
    border-color: rgba(255, 37, 37, 0.4);
    box-shadow: 
        0 20px 45px rgba(0,0,0,0.6), 
        0 0 25px var(--spidey-red-glow);
}

/* Card Header & Spidey Eyes */
.card-header {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-bottom: 4px solid var(--spidey-red);
}

.hero-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: brightness(0.9) contrast(1.1);
    transition: transform 0.8s ease;
}

.invitation-card:hover .hero-image {
    transform: scale(1.05);
}

.hero-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
}

/* Card Body */
.card-body {
    padding: 30px 25px;
    text-align: center;
    transform: translateZ(20px);
}

.badge {
    display: inline-block;
    background: var(--spidey-blue);
    color: #000;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
    animation: pulseBadge 2s infinite alternate;
}

.birthday-title {
    font-family: var(--font-comic);
    font-size: 3.8rem;
    letter-spacing: 2px;
    color: var(--spidey-red);
    text-shadow: 
        -2px -2px 0 #000,  
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000,
         0 0 15px var(--spidey-red-glow);
    margin-bottom: 15px;
    line-height: 1;
}

.hero-phrase {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
}

.detail-item:first-child:hover {
    border-color: var(--spidey-blue);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.15);
}

.detail-item:last-child:hover {
    border-color: var(--spidey-red);
    box-shadow: 0 5px 15px rgba(255, 37, 37, 0.15);
}

.detail-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.detail-icon svg {
    width: 100%;
    height: 100%;
}

.detail-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-text .label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.detail-text .value {
    font-family: var(--font-comic);
    font-size: 1.8rem;
    letter-spacing: 1px;
    line-height: 1;
}

.detail-text .sub-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Map Button */
.map-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: linear-gradient(135deg, var(--spidey-red) 0%, #b3070f 100%);
    border: 2px solid #000;
    color: #fff;
    padding: 14px 20px;
    font-family: var(--font-comic);
    font-size: 1.4rem;
    letter-spacing: 1px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 0 #000, 0 10px 20px rgba(229, 9, 20, 0.2);
    transition: all 0.2s ease;
    transform: translateZ(10px);
}

.map-btn:hover {
    transform: translateZ(10px) translateY(-2px);
    box-shadow: 0 7px 0 #000, 0 12px 25px rgba(229, 9, 20, 0.3);
    background: linear-gradient(135deg, #ff4148 0%, #d80b13 100%);
}

.map-btn:active {
    transform: translateZ(10px) translateY(3px);
    box-shadow: 0 2px 0 #000, 0 4px 8px rgba(229, 9, 20, 0.15);
}

.map-btn svg {
    width: 24px;
    height: 24px;
}

/* --- Countdown Section --- */
.countdown-section {
    width: 100%;
    text-align: center;
    background: rgba(18, 18, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.section-title {
    font-family: var(--font-comic);
    font-size: 1.8rem;
    letter-spacing: 1.5px;
    color: var(--spidey-blue);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.countdown-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 12px;
    min-width: 75px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.05);
    transition: all 0.3s ease;
}

.countdown-box:hover {
    border-color: var(--spidey-red);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 37, 37, 0.2);
}

.countdown-box .number {
    font-family: var(--font-comic);
    font-size: 2.2rem;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.countdown-box .unit {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

/* --- Info Section --- */
.info-section {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(245, 197, 24, 0.08);
    border: 1.5px dashed var(--spidey-yellow);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 5px 15px rgba(245, 197, 24, 0.05);
}

.spider-badge-container {
    flex-shrink: 0;
}

.spider-badge {
    width: 40px;
    height: 40px;
    background: var(--spidey-yellow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(245, 197, 24, 0.4);
}

.info-section p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #ffffff;
}

.info-section p strong {
    color: var(--spidey-yellow);
}

/* --- RSVP Section --- */
.rsvp-section {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.rsvp-section::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--spidey-blue) 0%, var(--spidey-red) 50%, var(--spidey-yellow) 100%);
}

.section-title-rsvp {
    font-family: var(--font-comic);
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--spidey-red);
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--spidey-red-glow);
}

.rsvp-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
    margin-bottom: 25px;
}

#rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    width: 50%;
}

label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

input[type="text"],
select,
textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 12px 16px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: var(--spidey-blue);
    background: rgba(0, 210, 255, 0.04);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

/* Custom Dropdown Styling */
select option {
    background-color: #121220;
    color: #ffffff;
}

textarea {
    resize: none;
}

.rsvp-submit-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: 2px solid #000;
    color: #ffffff;
    padding: 14px 20px;
    font-family: var(--font-comic);
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 0 #000, 0 10px 20px rgba(37, 211, 102, 0.2);
    transition: all 0.2s ease;
    margin-top: 10px;
}

.rsvp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #000, 0 12px 25px rgba(37, 211, 102, 0.3);
    background: linear-gradient(135deg, #34e073 0%, #159c8d 100%);
}

.rsvp-submit-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #000, 0 4px 8px rgba(37, 211, 102, 0.1);
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

/* --- Footer --- */
footer {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer .copyright {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.2);
}

footer .promo {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

footer .promo-logo-link {
    display: flex;
    align-items: center;
}

footer .promo-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

footer .promo-logo-link:hover .promo-logo {
    transform: scale(1.08);
    filter: drop-shadow(0 0 5px var(--spidey-blue-glow));
}

footer .promo-link {
    color: var(--spidey-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

footer .promo-link:hover {
    color: var(--spidey-red);
    text-shadow: 0 0 8px var(--spidey-red-glow);
}

/* --- Animations --- */
@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulseLogo {
    0% { transform: scale(1); filter: drop-shadow(0 0 15px var(--spidey-red-glow)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(255, 37, 37, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 15px var(--spidey-red-glow)); }
}

@keyframes shineBtn {
    0% { left: -50%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

@keyframes rotateSpidey {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceWave {
    from { transform: scaleY(0.2); }
    to { transform: scaleY(1); }
}

@keyframes pulseBadge {
    0% { box-shadow: 0 0 8px rgba(0, 210, 255, 0.3); }
    100% { box-shadow: 0 0 18px rgba(0, 210, 255, 0.8); }
}

@keyframes floatText {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* --- Responsive Styling --- */
@media (max-width: 600px) {
    #main-content {
        padding: 40px 15px 15px;
        gap: 30px;
    }

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

    .birthday-title {
        font-size: 2.8rem;
    }

    .card-header {
        height: 220px;
    }

    .spidey-eyes {
        width: 120px;
        height: 48px;
    }

    .eye {
        width: 50px;
        height: 40px;
        border-width: 5px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-item {
        flex-direction: row;
        padding: 15px;
        text-align: left;
        gap: 15px;
    }

    .detail-icon {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .detail-text .value {
        font-size: 1.5rem;
    }

    .form-group-row {
        flex-direction: column;
        gap: 18px;
    }

    .form-group.half {
        width: 100%;
    }

    #music-toggle {
        width: 50px;
        height: 50px;
    }

    .music-icon {
        width: 26px;
        height: 26px;
    }
}
