/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (LUXURY EDITORIAL)
   ========================================================================== */
:root {
    --bg-dark: #070709;
    --bg-canvas: #020202;
    --bg-card: rgba(12, 12, 16, 0.85); /* Darker and more opaque for high contrast */
    --bg-card-hover: rgba(18, 18, 24, 0.9);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-hover: rgba(212, 175, 55, 0.35);
    
    /* Elegant Metallic Gold */
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #aa7c11;
    --gold-gradient: linear-gradient(135deg, #aa7c11 0%, #d4af37 50%, #f3e5ab 100%);
    --gold-text-gradient: linear-gradient(135deg, #e5c060 10%, #f3e5ab 50%, #aa7c11 90%);
    
    /* Typography */
    --font-title: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    
    /* Color States */
    --text-primary: #ffffff;
    --text-secondary: #dcdcd1; /* Slightly warmer white for elegant readability */
    --text-muted: #7e7e86;
    
    /* Glows & Shadows */
    --shadow-premium: 0 25px 60px rgba(0, 0, 0, 0.85);
    --gold-glow: 0 0 25px rgba(212, 175, 55, 0.35);
    --gold-glow-intense: 0 0 45px rgba(212, 175, 55, 0.65);
    
    /* Transitions */
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & OUTSIDE CANVAS
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-canvas);
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(circle at center, #15151a 0%, #030303 100%); /* Elegant backlighting gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Avoid double scrolling */
}

/* ==========================================================================
   9:16 PHONE CONTAINER
   ========================================================================== */
.phone-frame {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #09090c 0%, #050507 60%, #0c0a10 100%);
    box-shadow: 0 35px 120px rgba(0, 0, 0, 0.95), 0 0 80px rgba(212, 175, 55, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Hide scrollbar for cleaner app look */
.phone-frame::-webkit-scrollbar {
    width: 4px;
}
.phone-frame::-webkit-scrollbar-track {
    background: transparent;
}
.phone-frame::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

/* Mobile full-viewport adjustments */
@media (max-width: 480px) {
    .phone-frame {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        box-shadow: none;
    }
}

/* ==========================================================================
   GENERIC LUXURY ELEMENTS
   ========================================================================== */
.gold-text {
    background: var(--gold-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.divider .line {
    height: 1px;
    width: 40px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.divider .diamond {
    width: 4px;
    height: 4px;
    background-color: var(--gold-primary);
    transform: rotate(45deg);
    box-shadow: 0 0 6px var(--gold-primary);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    backdrop-filter: blur(25px); /* Enhanced blur */
    -webkit-backdrop-filter: blur(25px);
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Glowing gold hairline accent at the top of each card */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.45), transparent);
    z-index: 2;
}

.glass-panel:hover {
    border-color: var(--border-card-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.06);
}

/* Buttons */
.btn-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #000000;
    background: var(--gold-gradient);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    box-shadow: var(--gold-glow);
    transition: var(--transition-smooth);
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 50%, #aa7c11 100%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.btn-premium:hover {
    box-shadow: var(--gold-glow-intense);
}

.btn-premium:hover::before {
    opacity: 1;
}

.btn-premium:active {
    transform: scale(0.98);
}

.btn-premium .btn-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.btn-premium:hover .btn-icon {
    transform: translateX(3px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    color: #000000;
    background: #ffffff;
    border-color: #ffffff;
}

.mini-icon {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   SECTION 1: INTRO COVER & BACKGROUND VIDEO (9:16 FRAMED)
   ========================================================================== */
#intro-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: #000000;
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#intro-container.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Video Layout (Full Cover inside Phone Frame) */
#intro-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Cover Screen Overlay with Video Frame showing through */
#cover-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
}

#cover-screen.active {
    opacity: 1;
    visibility: visible;
}

.cover-content {
    max-width: 85%;
    text-align: center;
    z-index: 3;
    animation: zoomInIntro 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover-subtitle {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.cover-title {
    font-family: var(--font-title);
    font-size: 38px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.cover-title span {
    font-size: 90px;
    font-family: var(--font-title);
    display: block;
    margin-top: 8px;
    letter-spacing: 0;
}

.cover-scroll-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

/* Elegant Blur Overlay on Cover */
.cover-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 12, 0.45) 0%, rgba(10, 10, 12, 0.85) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1;
}

/* Skip Button */
.btn-skip {
    position: absolute;
    bottom: 30px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-fast);
    z-index: 10;
}

.btn-skip:hover {
    color: #ffffff;
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.15);
}

.btn-skip.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   SECTION 2: MAIN INVITATION CONTENT
   ========================================================================== */
#main-content {
    position: relative;
    padding: 60px 24px 80px;
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#main-content.reveal {
    opacity: 1;
    transform: translateY(0);
}

#main-content.hidden {
    display: none;
}

/* Subtle background lighting inside frame */
.bg-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    filter: blur(90px);
    opacity: 0.26; /* Increased opacity for richer depth */
    transition: var(--transition-smooth);
}

.bg-glow-1 {
    top: -60px;
    right: -80px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.28) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: 120px;
    left: -80px;
    background: radial-gradient(circle, rgba(170, 124, 17, 0.22) 0%, transparent 70%);
}

.bg-glow-3 {
    top: 40%;
    right: -60px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
}

/* ==========================================================================
   HERO / COUNTDOWN SECTION
   ========================================================================== */
#hero {
    margin-bottom: 35px;
    text-align: center;
}

.hero-card {
    padding: 45px 24px;
}

.pre-title {
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}

.main-title {
    font-family: var(--font-title);
    font-size: 34px; /* Reduced from 44px to prevent text truncation */
    font-weight: 400;
    letter-spacing: 1.5px; /* Slightly tighter to fit names like Alessandro */
    text-transform: uppercase;
    background: var(--gold-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
}

.hero-tagline {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 auto 35px;
    font-weight: 300;
    max-width: 280px;
}

/* Modern countdown layout */
.countdown-container {
    margin: 0 auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.countdown-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

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

.countdown-item {
    background: rgba(255, 255, 255, 0.012);
    border: 1px solid rgba(212, 175, 55, 0.15); /* Fine gold border for countdown boxes */
    border-radius: 4px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-item span:first-child {
    font-family: var(--font-title);
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.35); /* Shimmering gold foil text shadow */
}

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

/* ==========================================================================
   DETAILS SECTION (VERTICAL GRAPHIC STACK)
   ========================================================================== */
#details {
    margin-bottom: 35px;
}

.detail-card {
    padding: 35px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.detail-card:last-child {
    margin-bottom: 0;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 50%;
    color: var(--gold-primary);
    margin-bottom: 18px;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.detail-card h3 {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.date-highlight, .location-name {
    font-family: var(--font-title);
    font-size: 19px;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
}

.time-highlight, .location-address {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 300;
}

.location-address {
    margin-bottom: 20px;
    max-width: 260px;
    line-height: 1.5;
}

.dress-code-title {
    font-family: var(--font-title);
    font-size: 19px;
    color: var(--gold-primary);
    margin-bottom: 8px;
}

.dress-code-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 260px;
}

/* ==========================================================================
   RSVP SECTION (EDITORIAL MINIMALIST FORM)
   ========================================================================== */
#rsvp {
    margin-bottom: 35px;
}

.rsvp-card {
    padding: 40px 24px;
}

.card-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-tag {
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--gold-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.card-header h3 {
    font-family: var(--font-title);
    font-size: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 500;
}

.rsvp-deadline {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 300;
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

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

.form-group label {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Bottom Border Only Inputs */
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 13px;
    color: #ffffff;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    padding: 10px 0;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-bottom-color: var(--gold-primary);
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 14px;
    padding-right: 24px;
}

.form-group select option {
    background-color: var(--bg-dark);
    color: #ffffff;
}

.form-group textarea {
    resize: none;
}

/* Custom Pill Selector Buttons instead of Standard Radios */
.pill-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.pill-option {
    cursor: pointer;
    position: relative;
}

.pill-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pill-button {
    display: block;
    text-align: center;
    padding: 13px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-fast);
}

.pill-option:hover .pill-button {
    border-color: rgba(212, 175, 55, 0.3);
}

.pill-option input[type="radio"]:checked + .pill-button {
    color: #000000;
    background: var(--gold-gradient);
    border-color: var(--gold-primary);
    box-shadow: var(--gold-glow);
}

/* Conditional Animating Form Height */
#rsvp-conditional-fields {
    max-height: 350px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

#rsvp-conditional-fields.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.rsvp-form .btn-premium {
    margin-top: 10px;
}

/* Success Layout */
.rsvp-success-message {
    text-align: center;
    padding: 15px 0;
    animation: zoomInIntro 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    color: var(--gold-primary);
    margin-bottom: 20px;
    box-shadow: var(--gold-glow);
}

.success-icon svg {
    width: 28px;
    height: 28px;
}

.rsvp-success-message h4 {
    font-family: var(--font-title);
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 500;
}

.rsvp-success-message p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.rsvp-success-message .btn-secondary {
    width: 100%;
}

/* ==========================================================================
   FOOTER (PLAYLIST & LEGAL STYLES)
   ========================================================================== */
footer {
    text-align: center;
}

.footer-card {
    padding: 35px 24px;
}

footer h4 {
    font-family: var(--font-title);
    font-size: 18px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    font-weight: 500;
}

footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 300;
}

.playlist-action {
    margin-bottom: 30px;
}

.playlist-action .btn-secondary {
    width: 100%;
}

.signature {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.signature p {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    font-weight: 500;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes zoomInIntro {
    0% {
        opacity: 0;
        transform: scale(0.97);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Fade In classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Media query for very small or narrow screen viewports (like inside scaled phone mockups) */
@media (max-width: 375px) {
    .main-title {
        font-size: 7.2vw !important; /* Dynamically scales with iframe width to prevent overflow */
        letter-spacing: 0.5px !important;
    }
    .hero-card {
        padding: 30px 14px !important; /* Reduce card padding to maximize text space */
    }
    .pre-title {
        letter-spacing: 2px !important;
    }
    .countdown-item span:first-child {
        font-size: 5.8vw !important; /* Dynamically scales countdown numbers */
    }
    .countdown-item {
        padding: 10px 4px !important;
    }
    .countdown-item .label {
        font-size: 7px !important;
    }
    
    /* Layout & Component Fixes for Horizontal Clipping */
    .phone-frame {
        overflow-x: hidden !important;
    }
    #main-content {
        padding: 40px 16px 60px !important; /* Reduce main container padding from 24px to 16px */
    }
    .detail-card, .rsvp-card, .footer-card {
        padding: 25px 16px !important; /* Reduce card internal padding from 24px/30px to 16px */
    }
    
    /* Typography scaling for narrow screens */
    .date-highlight, .location-name, .dress-code-title {
        font-size: 16px !important;
    }
    .rsvp-card h3 {
        font-size: 18px !important;
    }
    footer h4 {
        font-size: 15px !important;
    }
    
    /* Stack RSVP pills vertically to prevent horizontal expansion */
    .pill-selector {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .pill-button {
        padding: 11px !important;
        font-size: 9px !important;
    }
}
