/* ==========================================================================
   CSS Variables & Tokens System
   ========================================================================== */
:root {
    --bg-base: #0a0618;
    --bg-gradient-1: #1a0b36;
    --bg-gradient-2: #0f0524;
    
    --accent-primary: #a764fc;
    --accent-secondary: #5ee7df;
    --accent-glow: #e0c3fc;
    --accent-hot: #ff7eb3;
    
    --text-light: #ffffff;
    --text-muted: #b8aed2;
    --text-dark: #110822;

    --glass-bg: rgba(22, 12, 48, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    
    --font-main: 'Outfit', sans-serif;
    --font-display: 'Poppins', sans-serif;
}

/* ==========================================================================
   Reset & Base Styles with Strict Overflow Prevention
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 20%, var(--bg-gradient-1) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, var(--bg-gradient-2) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Page wrapper guarantees absolutely no hidden extra spaces or scrollbars */
.page-overflow-wrapper {
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Ambient Floating Glow Orbs */
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    max-width: 100vw;
}

.orb-1 {
    top: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    animation: pulseOrb 10s ease-in-out infinite alternate;
}

.orb-2 {
    top: 40%;
    right: -100px;
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    animation: pulseOrb 12s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    bottom: -100px;
    left: 10%;
    width: 500px;
    height: 500px;
    background: var(--accent-hot);
    animation: pulseOrb 15s ease-in-out infinite alternate;
}

/* ==========================================================================
   Dynamic Clear Bubbles Background
   ========================================================================== */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Base styling for highly transparent, less opaque clear soap bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.35) 1%, rgba(255, 255, 255, 0.03) 20%, rgba(167, 100, 252, 0.12) 65%, rgba(94, 231, 223, 0.22) 100%);
    box-shadow: 
        inset 0 0 10px rgba(255, 255, 255, 0.25),
        inset 2px 2px 6px rgba(255, 255, 255, 0.15),
        inset -4px -4px 12px rgba(167, 100, 252, 0.25),
        0 0 12px rgba(167, 100, 252, 0.15);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    will-change: transform, opacity;
    pointer-events: none;
}

/* Subtle tiny crisp light reflections inside the clear bubble */
.bubble::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 18%;
    width: 18%;
    height: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    filter: blur(0.5px);
    transform: rotate(-30deg);
}

/* Pop burst animation */
.bubble.popping {
    animation: popBurst 0.25s ease-out forwards !important;
}

@keyframes popBurst {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); background: rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.7); }
    100% { transform: scale(1.45); opacity: 0; }
}

/* Highly Visible Floating Music Controller at Bottom Right */
.music-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(22, 12, 48, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    z-index: 9999; /* Always on top of any overlay */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.music-btn:hover {
    transform: scale(1.1) translateY(-3px);
    background: rgba(167, 100, 252, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(167, 100, 252, 0.5);
}

.music-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn i {
    font-size: 1.3rem;
    transition: transform 0.3s;
    color: var(--accent-secondary);
}

.sound-waves {
    position: absolute;
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.sound-waves span {
    width: 3px;
    height: 6px;
    background-color: var(--accent-glow);
    border-radius: 3px;
    transition: height 0.1s ease;
}

.music-btn.playing i {
    opacity: 0.15;
    transform: scale(0.7);
}

.music-btn.playing .sound-waves {
    opacity: 1;
}

.music-btn.playing .sound-waves span:nth-child(1) { animation: wave 0.5s infinite alternate; }
.music-btn.playing .sound-waves span:nth-child(2) { animation: wave 0.3s infinite alternate 0.15s; }
.music-btn.playing .sound-waves span:nth-child(3) { animation: wave 0.7s infinite alternate 0.3s; }

/* ==========================================================================
   Layout Wrapper
   ========================================================================== */
.invitation-wrapper {
    position: relative;
    z-index: 2;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.2rem 1.5rem; /* Tightened padding to bring signature flush to the bottom */
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Glassmorphism Generic Card Styling */
.hero-glass-card,
.details-glass-card,
.info-glass-block,
.rsvp-glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 2.5rem 1.8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease;
    width: 100%;
}

.hero-glass-card:hover,
.details-glass-card:hover,
.rsvp-glass-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

/* ==========================================================================
   Hero Section Styling
   ========================================================================== */
.hero-section {
    animation: fadeInDown 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    width: 100%;
}

.subtitle-estas {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: -0.2rem;
    margin-right: -12px; /* Balance letter spacing */
    position: relative;
    z-index: 2;
}

/* Updated to Poppins: well-proportioned, fits gracefully without clipping */
.title-invitado {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 11vw, 4.8rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-glow) 45%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(167, 100, 252, 0.5));
    margin-bottom: 1.2rem;
    padding: 0 5px; /* ensure neon shadows don't clip */
}

.decorative-line {
    height: 1px;
    width: 70%;
    margin: 0 auto 1.8rem;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary);
}

.names-container {
    margin-bottom: 1rem;
}

.names-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-light);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.ampersand {
    font-family: var(--font-main);
    font-weight: 300;
    color: var(--accent-secondary);
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    margin: 0 4px;
    filter: drop-shadow(0 0 8px rgba(94, 231, 223, 0.6));
}

.hero-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 90%;
    margin: 0 auto;
    font-weight: 300;
}

/* ==========================================================================
   Countdown Section Styling
   ========================================================================== */
.countdown-section {
    text-align: center;
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both;
    width: 100%;
}

.section-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.countdown-item {
    background: rgba(15, 6, 34, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* Using Poppins: matches main title perfectly, clean geometric thickness */
.countdown-number {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    font-weight: 800;
    color: var(--text-light);
    line-height: 1.1;
    margin-bottom: 2px;
    text-shadow: 0 2px 10px rgba(167, 100, 252, 0.4);
    letter-spacing: -0.5px;
}

.countdown-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ==========================================================================
   Event Details Section Styling
   ========================================================================== */
.event-details-section {
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s both;
    width: 100%;
}

.details-glass-card {
    gap: 1.5rem;
}

.centered-detail-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    width: 100%;
}

.centered-detail-block .block-icon {
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin-bottom: 4px;
    filter: drop-shadow(0 0 8px rgba(94, 231, 223, 0.5));
}

.info-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    margin-bottom: 2px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 2px;
}

.info-subvalue {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.card-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.map-action-container {
    margin-top: 0.2rem;
    width: 100%;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 1.1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #7b3fe4 100%);
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(167, 100, 252, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(167, 100, 252, 0.6);
    background: linear-gradient(135deg, #b87cfc 0%, var(--accent-primary) 100%);
}

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

/* ==========================================================================
   Additional Info Blocks Styling
   ========================================================================== */
.info-blocks-section {
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s both;
    width: 100%;
}

.info-blocks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.info-glass-block {
    padding: 1.5rem 1rem;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.block-icon {
    font-size: 1.3rem;
    color: var(--accent-secondary);
    margin-bottom: 2px;
    filter: drop-shadow(0 0 6px rgba(94, 231, 223, 0.4));
}

.info-glass-block h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.info-glass-block p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.info-glass-block small {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* ==========================================================================
   RSVP Section Styling
   ========================================================================== */
.rsvp-section {
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s both;
    width: 100%;
}

.rsvp-glass-card {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

/* Constrained properly to never cause horizontal overflow */
.bubble-ring-decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    top: -40px;
    right: -40px;
    pointer-events: none;
    animation: spinRing 30s linear infinite;
    max-width: 100%;
}

.rsvp-icon {
    font-size: 2.6rem;
    color: #25d366;
    filter: drop-shadow(0 0 12px rgba(37, 211, 102, 0.4));
    margin-bottom: -0.5rem;
}

.rsvp-glass-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.rsvp-glass-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 95%;
    margin-bottom: 0.2rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
    background: linear-gradient(135deg, #2eed6f 0%, #25d366 100%);
}

/* ==========================================================================
   Institutional Signature Footer
   ========================================================================== */
.signature-footer {
    text-align: center;
    padding: 1rem 0 1rem;
    animation: fadeIn 1s ease 1.2s both;
    width: 100%;
}

.footer-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1.2rem;
    opacity: 0.4;
}

.footer-divider span {
    height: 1px;
    width: 50px;
    background-color: var(--text-muted);
}

.footer-divider i {
    font-size: 0.55rem;
    color: var(--accent-secondary);
}

.signature-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.signature-name {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.separator {
    color: var(--accent-primary);
    margin: 0 2px;
}

.signature-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    text-decoration: none;
    letter-spacing: 1px;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.8;
}

.signature-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* ==========================================================================
   Keyframes & Micro-animations
   ========================================================================== */
@keyframes pulseOrb {
    0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
    50% { opacity: 0.4; }
    100% { transform: scale(1.1) translate(30px, -20px); opacity: 0.3; }
}

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

@keyframes wave {
    0% { height: 4px; }
    100% { height: 16px; }
}

/* Helper UX Label for Music Controller */
.music-helper-label {
    position: fixed;
    bottom: 42px;
    right: 88px; /* sits cleanly to the left of the music button */
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(22, 12, 48, 0.85);
    border: 1px solid var(--accent-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--accent-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 9998;
    animation: bounceHorizontal 1.2s infinite alternate, fadeIn 0.5s ease-out 1s both;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.music-helper-label.hidden {
    opacity: 0;
    transform: translateX(15px);
}

@keyframes bounceHorizontal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-6px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 480px) {
    .invitation-wrapper {
        padding: 1.5rem 1rem 1.2rem; /* Tightened bottom padding to remove extra empty space */
        gap: 1.5rem;
    }

    .hero-glass-card,
    .details-glass-card,
    .rsvp-glass-card {
        padding: 1.8rem 1.2rem;
        border-radius: 24px;
    }

    .subtitle-estas {
        font-size: 1.2rem;
        letter-spacing: 10px;
        margin-right: -10px;
    }

    .info-blocks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info-glass-block {
        padding: 1.2rem 1rem;
        border-radius: 20px;
    }
}
