/* ========================================= */
/* 1. CONFIGURATION & THEME                  */
/* ========================================= */
:root {
    --bg-color: #FFFBF7;      
    --card-bg: #FFFFFF;       
    --sub-card-bg: #F9F5F0;   
    --primary: #C55A37;       
    --primary-light: #FCEFE9; 
    --text-dark: #4A4A4A;     
    --text-light: #888888;    
    --border-color: #E6E0D6;
    --radius: 12px;           
    --shadow: 0 8px 30px rgba(197, 90, 55, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(255, 251, 247, 0.9), rgba(255, 251, 247, 0.9)),
        url('images/img1.png'); /* [CONFIG] Pattern Image */
    background-repeat: repeat;
    background-size: 400px auto; 
    color: var(--text-dark);
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh; 
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: #2c2c2c; font-weight: 700; }
.text-center { text-align: center; }

/* ========================================= */
/* 2. COMPONENTS (Nav, Buttons, Inputs)      */
/* ========================================= */

/* Standard Sticky Nav (used on RSVP page) */
nav {
    position: sticky; top: 0; z-index: 1000; text-align: center;
    background: rgba(255, 251, 247, 0.95); backdrop-filter: blur(5px); 
    padding: 1rem; border-bottom: 1px solid var(--border-color);
}
nav a {
    margin: 0 15px; text-decoration: none; color: var(--text-dark);
    font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1.5px;
    transition: color 0.3s;
}
nav a:hover { color: var(--primary); }

/* --- SMART NAV (Home Page) --- */
.transparent-nav {
    position: fixed; 
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    
    /* Layout */
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
    
    /* ANIMATION: Smoothly transition background and position */
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, box-shadow 0.3s ease;

    /* DEFAULT STATE (Absolute Top): Transparent & No Line */
    background-color: transparent;
    border-bottom: none; 
    box-shadow: none;
    backdrop-filter: none;
}

/* STATE 1: Hidden (Scrolling Down) */
.nav-hidden {
    transform: translateY(-100%);
}

/* STATE 2: White (Scrolling Up) */
.nav-white {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-bottom: none; /* Ensures line stays gone */
}

/* Mobile Adjustments for Smart Nav */
@media (max-width: 600px) {
    .transparent-nav {
        padding: 0.8rem 1rem;
        justify-content: space-between; /* Keeps buttons in corners */
    }
}
.nav-btn {
    margin: 0 !important; /* Overrides default button margin */
    padding: 10px 20px !important; /* Smaller size for navbar */
    font-size: 0.9rem !important;
}

/* Button Styles */
.btn {
    display: inline-block; padding: 14px 30px; margin: 10px 0;
    text-decoration: none; border-radius: 50px;
    font-family: 'Lato', sans-serif; font-weight: 600; cursor: pointer; 
    transition: all 0.3s ease; text-align: center; font-size: 1rem;
    letter-spacing: 0.5px; border: 2px solid transparent;
}
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 15px rgba(197, 90, 55, 0.3); }
.btn.primary:hover { background: #A04020; border-color: #A04020; transform: translateY(-2px); }

.btn.secondary { border-color: white; color: white; background-color: transparent; }
.btn.secondary:hover { background: white; color: var(--text-dark); }

.btn.outline { border-color: var(--primary); color: var(--primary); background-color: transparent; }
.btn.outline:hover { background: var(--primary); color: white; transform: translateY(-2px); }

.full-width { width: 100%; margin: 10px 0; }

.input-styled {
    width: 100%; padding: 14px 16px; background: var(--card-bg); 
    border: 1px solid var(--border-color); border-radius: 8px;
    font-size: 1rem; color: #333; transition: all 0.3s;
}
.input-styled:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
input, select, textarea { font-size: 16px !important; }

/* ========================================= */
/* 3. SECTIONS (Hero, Timeline, Forms)       */
/* ========================================= */
.hero {
    height: 100vh; /* Full screen height */
    display: flex; flex-direction: column; 
    align-items: center; justify-content: center; text-align: center; 
    color: white; position: relative; background-size: cover; background-position: center;
}
/* [CONFIG] Background Images */
.hero-bg-home { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('images/hero.jpg'); }
.rsvp-header-bg { background-image: url('images/rsvp-bg.jpg'); }

.hero h1 { font-size: 4rem; margin: 10px 0; color: #FFF8E7; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.subtitle { letter-spacing: 4px; text-transform: uppercase; color: #FFF8E7; margin-bottom: 10px; }
.date { font-size: 1.5rem; margin-bottom: 30px; color: #FFF8E7; }

.section { padding: 80px 20px; max-width: 800px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 50px; color: var(--primary); }

/* Timeline Cards */
.timeline { display: flex; flex-direction: column; gap: 25px; }
.event-card {
    display: flex; align-items: flex-start; padding: 30px;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}
.event-card:hover { transform: translateY(-5px); }
.icon-box { 
    width: 50px; height: 50px; border-radius: 50%; background: var(--primary-light);
    color: var(--primary); font-size: 1.5rem; margin-right: 25px; 
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; 
}
.event-details h3 { font-size: 1.4rem; color: var(--text-dark); margin-bottom: 5px; }
.event-links { margin-top: 15px; display: flex; gap: 15px; font-size: 0.9rem; flex-wrap: wrap; }
.map-link { color: var(--primary); text-decoration: none; font-weight: bold; border-bottom: 1px solid var(--primary); }

/* RSVP Specifics */
.rsvp-header { height: 40vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; background-size: cover; background-position: center; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(44, 44, 44, 0.4); }
.header-content { position: relative; z-index: 2; color: #FFF8E7; }
.header-content h1 { font-size: 3.5rem; margin-bottom: 10px;}

.main-container { max-width: 600px; margin: -60px auto 50px; padding: 20px; position: relative; z-index: 10; width: 100%; }
.form-card, #summaryCard { background: var(--card-bg); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.form-heading { text-align: center; font-size: 2rem; margin-bottom: 40px; color: var(--text-dark); }
.ornament-top { text-align: center; color: var(--primary); font-size: 2rem; margin-bottom: 10px; opacity: 0.8; }

/* Form Elements */
.input-group { margin-bottom: 25px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-dark); }

.phone-wrapper { 
    display: flex; 
    gap: 0; /* Ensures borders touch */
}

.code-select { 
    width: auto;           /* Let it size to content */
    min-width: 80px;       /* Minimum comfortable width */
    max-width: 110px;      /* Prevent it from getting too big */
    flex-shrink: 0;        /* Don't let it shrink too small */
    border-right: none;    /* Merge with input */
    border-radius: 8px 0 0 8px; 
    padding: 14px 10px;    /* Reduce padding slightly */
}

.phone-input { 
    flex-grow: 1;          /* Take up all remaining space */
    width: auto;           /* Override fixed percentage */
    border-radius: 0 8px 8px 0; 
}

.checkbox-group { display: flex; flex-direction: column; gap: 15px; }
.event-option-card {
    display: flex; align-items: center; background: #FFFFFF; padding: 15px 20px; 
    border-radius: 12px; border: 1px solid var(--border-color); cursor: pointer; transition: all 0.2s;
}
.event-option-card:hover, .event-option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.event-icon { font-size: 1.5rem; color: var(--primary); margin-right: 15px; width: 30px; text-align: center;}
.card-content { flex-grow: 1; }
.evt-title { display: block; font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: bold; }
.evt-date { display: block; font-size: 0.85rem; color: var(--text-light); }

.event-option-card input { display: none; }
.check-icon { width: 24px; height: 24px; border: 2px solid #ddd; border-radius: 50%; color: transparent; display: flex; align-items: center; justify-content: center; }
.event-option-card input:checked ~ .check-icon { background: var(--primary); border-color: var(--primary); color: white; }

/* Guest Sub-cards & Summary */
.guest-sub-card { background: var(--sub-card-bg); padding: 20px; border-radius: 12px; border: 1px solid #EBE5DD; margin-top: 15px; animation: slideDown 0.3s; }
.guest-info-text { font-size: 0.9rem; color: #666; margin-bottom: 10px; }
.summary-header { text-align: center; } 
.summary-icon { font-size: 3rem; color: var(--primary); background: var(--primary-light); width: 80px; height: 80px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.details-box { background: var(--sub-card-bg); padding: 25px; border-radius: 12px; margin: 25px 0; text-align: left; }
.detail-row { padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.detail-row:last-child { border-bottom: none; }
.label { font-size: 0.75rem; text-transform: uppercase; color: #999; }
.value { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: bold; }
.event-pill { background: #EBCFB2; color: #6B3E2E; font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; font-weight: bold; margin-right: 5px;}
.select-all-btn { float: right; font-size: 0.85rem; color: var(--primary); cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px; }
.select-all-circle { width: 16px; height: 16px; border: 1px solid var(--primary); border-radius: 50%; display: inline-block; }
.select-all-circle.active { background: var(--primary); }
.highlight-text { color: var(--primary); font-weight: bold; }
.reset-section { margin-top: 30px; border-top: 1px dashed #ddd; padding-top: 20px; text-align: center;}
.reset-link { color: #999; font-size: 0.85rem; text-decoration: none; display: inline-flex; align-items: center; gap: 5px;}
.reset-link:hover { color: #d9534f; }

/* Popups & Footer */
.popup-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(60, 40, 30, 0.6); backdrop-filter: blur(4px); z-index: 9999; align-items: center; justify-content: center; }
.popup-content { background: var(--bg-color); padding: 40px 30px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; animation: popUp 0.4s; border: 2px solid var(--primary-light); }
.popup-icon { width: 70px; height: 70px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 20px; }
.error-icon { background: #FFF5F5; color: #C55A37; }
footer { text-align: center; padding: 40px 20px; margin-top: auto; background: #2C2C2C; color: #F9F5F0; border-top: 4px solid var(--primary); }

/* Animation Utils */
@keyframes slideDown { from {opacity:0; transform:translateY(-10px);} to {opacity:1; transform:translateY(0);} }
@keyframes popUp { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.appear { opacity: 1; transform: translateY(0); }

/* --- COUNTDOWN SECTION (Dark Pattern) --- */
.countdown-section {
    padding: 60px 20px;
    background-color: #2C2C2C; 
    background-image: 
        linear-gradient(rgba(105, 105, 105, 0.9), rgba(105, 105, 105, 0.9)),
        url('images/img1.png');
    background-repeat: repeat;
    background-size: 400px auto;
    display: flex;
    justify-content: center;
    width: 100%;
    border-top: 4px solid var(--primary); 
    border-bottom: 4px solid var(--primary);
}

.circular-countdown-container { display: flex; gap: 20px; justify-content: center; align-items: center; }
.time-circle { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(197, 90, 55, 0.3); }
.time-circle span { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.time-circle small { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* --- MINI RSVP SECTION (Dark Pattern + Top Border) --- */
.mini-rsvp-section {
    background-color: #2C2C2C;
    background-image: 
        linear-gradient(rgba(105, 105, 105, 0.9), rgba(105, 105, 105, 0.9)),
        url('images/img1.png');
    background-repeat: repeat;
    background-size: 400px auto;
    color: #FFF8E7;
    padding: 80px 20px;
    text-align: center;
    margin-top: 0;
    
    /* ADDED: Top Border Only (Bottom is handled by footer) */
    border-top: 4px solid var(--primary);
}

.mini-rsvp-section p {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 700;
}

/* --- FIX: POPUP SPACING --- */
.popup-content h2 {
    margin-top: 10px;
    margin-bottom: 15px;
}

.popup-content p {
    margin-bottom: 30px; /* Adds space between text and buttons */
    color: #666;
    font-size: 1.05rem;
}

.popup-content .btn {
    margin: 0 8px; /* Adds 8px space to the Left and Right of buttons */
    display: inline-block;
    min-width: 120px; /* Ensures buttons aren't too skinny */
}

/* ========================================= */
/* 5. RESPONSIVE DESIGN (MOBILE & DESKTOP)   */
/* ========================================= */
@media (max-width: 600px) {
    /* Adjust transparent nav for mobile */
    .transparent-nav {
        padding: 0.5rem 1rem;
        justify-content: space-between; /* Keeps buttons in corners */
    }
    .nav-btn {
        padding: 8px 15px !important;
        font-size: 0.8rem !important;
    }

    nav { padding: 0.8rem 0.5rem; }
    nav a { margin: 0 8px; font-size: 0.75rem; letter-spacing: 1px; }
    .hero h1 { font-size: 2.5rem; line-height: 1.2; }
    .section { padding: 50px 15px; }
    .event-card { padding: 20px; }
    .icon-box { margin-right: 15px; width: 45px; height: 45px; font-size: 1.2rem; }
    .event-details h3 { font-size: 1.3rem; }
    .main-container { padding: 15px; margin-top: -40px; }
    .form-card { padding: 25px 15px; }
    .countdown-section { padding: 30px 10px; }
    .circular-countdown-container { gap: 10px; }
    .time-circle { width: 65px; height: 65px; }
    .time-circle span { font-size: 1.2rem; }
    .time-circle small { font-size: 0.5rem; }
    .popup-content { width: 95%; max-height: 85vh; overflow-y: auto; padding: 30px 20px; }
}

@media (min-width: 1024px) {
    .section { max-width: 1200px; }
    .event-card { padding: 50px; border-radius: 16px; }
    .icon-box { width: 80px; height: 80px; font-size: 2.2rem; margin-right: 40px; }
    .event-details h3 { font-size: 2.2rem; margin-bottom: 10px; }
    .event-details p.time, .event-details p.location { font-size: 1.3rem; margin-bottom: 5px; }
    .event-links { margin-top: 25px; font-size: 1.1rem; gap: 30px; }
}