/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #000;
    line-height: 1.6;
    background-color: #fff;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fff; /* or your background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* on top of everything */
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

#loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

#loading-screen .loading-content p {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto !important;
    padding: 0 30px;
    width: 100%;
    box-sizing: border-box;
}

/* Section Divider */
.section-divider {
    width: 60%;
    max-width: 450px;
    height: 1px;
    background-color: #000;
    margin: 60px auto;
}

/* Header */
.main-header {
    padding: 80px 20px 60px;
    text-align: center;
    background-color: #fff;
}

.wedding-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 86px;
    font-weight: 400;
    color: #000;
    letter-spacing: 0;
    margin: 0 0 50px 0;
    line-height: 1.2;
}

.header-details {
    display: flex;
    align-items: center;
    gap: 30px;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
    justify-content: flex-start;
}

.wedding-location-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #000;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.wedding-year {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #000;
    letter-spacing: 0;
    margin: 0;
}

/* Section Titles */
.section-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 400;
    color: #000;
    margin-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    max-width: 100%;
}

/* Polaroids Section */
.polaroids-section {

    background-color: #fff;
}

.polaroids-stack {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 600px;
    margin: 0 auto -90px;
}

.polaroid-item {
    position: absolute;
    width: 450px;
    opacity: 1; /* Changed from 0 to ensure visibility if JS fails */
    transform: translateX(-50%); /* Ensure centering even without JS */
    transform-style: preserve-3d;
    perspective: 1000px;
}

.polaroid-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.polaroid-2 {
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.polaroid-3 {
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.polaroid-4 {
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}

.polaroid-frame {
    background: #fff;
    padding: 12px 12px 50px 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.polaroid-image {
    width: 100%;
    height: 320px;
    background: #f5f5f5;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.polaroid-label {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.polaroid-static-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.polaroid-static-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Quote Section */
.quote-section {
    padding: 60px 20px;
    background-color: #fff;
}

.wedding-quote {
    max-width: 650px;
    margin: 0 auto;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    font-style: italic;
    color: #000;
    text-align: center;
    line-height: 1.7;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-weight: 400;
}

.wedding-quote cite {
    display: inline;
    font-size: 18px;
    font-style: italic;
    color: #000;
    font-family: Georgia, 'Times New Roman', serif;
    margin-left: 5px;
}

/* Schedule Section */
.schedule-section {
    padding: 0px 0px;
    background-color: #fff;
}

.schedule-year {
    margin-bottom: 50px;
}

.year-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 400;
    color: #000;
    margin-bottom: 40px;
    text-align: center;
}

.events-list {
    max-width: 650px;
    margin: 0 auto;
}

.event-item {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.event-time {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    min-width: 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.event-details {
    flex: 1;
}

.event-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #000;
    margin-bottom: 8px;
}

.event-location {
    font-size: 14px;
    font-weight: 400;
    color: #000;
    margin-bottom: 3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.event-address {
    color: #666;
    margin-bottom: 5px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.get-directions {
    display: inline-block;
    color: #0066cc;
    text-decoration: underline;
    font-weight: 400;
    margin-top: 3px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
}

.get-directions:hover {
    color: #0052a3;
}

.event-note {
    margin-top: 8px;
    font-style: italic;
    color: #666;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.schedule-note {
    max-width: 550px;
    margin: 30px auto 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    text-align: left;
    color: #666;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Schedule Image Reveal Effect */
.schedule-image-reveal {
    position: relative;
    width: 100%;
    height: 900px; /* Fixed height for the reveal window */
    margin: 80px 0;
    overflow: hidden;
    background-image: url('/assets/images/test.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Makes background static during scroll */
    background-repeat: no-repeat;
}

.reveal-content-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%; /* Cover top half initially */
    background-color: #fff;
    z-index: 1; /* Above background image */
}

.reveal-content-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%; /* Cover bottom half initially */
    background-color: #fff;
    z-index: 1; /* Above background image */
}


/* Wedding Party Section */
.wedding-party-section {
    padding: 60px 20px;
    background-color: #fff;
}

.section-subtitle {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 50px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.party-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.party-member {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    transition: none;
}

.member-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-image-placeholder {
    font-size: 48px;
    font-weight: 600;
    color: #999;
    font-family: Georgia, 'Times New Roman', serif;
}

.member-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #000;
    margin-bottom: 12px;
}

.member-description {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
}

/* Gifts Section */
.gifts-section {
    padding: 0px 20px;
    background-color: #fff;
    text-align: center;
}

.FAQ-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 400;
    color: #000;
    text-align: center;
    margin-bottom: 0;
}

.gifts-intro, .honeymoon-intro, .Children-intro, .Photo-intro, .Dress-intro {
    max-width: 550px;
    margin: 30px auto 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.Gifts-text, .honeymoon-text, .Children-text, .Photo-text, .Dress-text {
    max-width: 550px;
    margin: 5px auto 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.honeymoon-fund {
    margin-top: 20px;
}

.honeymoon-button {
    display: inline-block;
    padding: 0;
    background-color: transparent;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 0;
    transition: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: none;
    letter-spacing: 0;
    border: none;
}

.honeymoon-button:hover {
    color: #666;
    transform: none;
}

/* RSVP Section */
.rsvp-section {
    padding: 0px 20px;
    background-color: #fff;
}

.rsvp-note {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rsvp-link {
    display: block;
    padding: 12px 24px;
    background-color: #000;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-decoration: none;
    border: 2px solid #000;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto 30px;
    width: fit-content;
    text-align: center;
}

.rsvp-link:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rsvp-message {
    max-width: 550px;
    margin: 0 auto 25px;
    padding: 12px 15px;
    border-radius: 0;
    text-align: center;
    font-size: 13px;
}

.rsvp-success {
    background-color: #f0f9f4;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rsvp-error {
    background-color: #fef0f0;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rsvp-form {
    max-width: 550px;
    margin: 0 auto 30px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    color: #000;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    transition: border-color 0.2s ease;
    background: #fff;
    color: #000;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000;
}

.rsvp-submit {
    width: 100%;
    padding: 10px;
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: none;
    letter-spacing: 0;
}

.rsvp-submit:hover {
    background-color: #333;
    border-color: #333;
}

.guest-names-note {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    font-style: italic;
}

.children-note {
    max-width: 550px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    text-align: center;
}

.children-heading {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
    color: #000;
    margin-bottom: 15px;
    text-align: center;
}

.children-note p {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Footer */
.main-footer {
    padding: 50px 20px;
    background-color: #fff;
    color: #999;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    margin-top: 40px;
}

.footer-text {
    font-size: 11px;
    opacity: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0;
}

/* Universal centering class for critical elements */
.center-element {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    display: block !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wedding-title {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .hero-section {
        min-height: 500px;
        padding: 60px 20px;
    }
    
    .hero-container {
        height: 400px;
    }
    
    .hero-polaroid {
        width: 220px;
    }
    
    .polaroid-photo {
        height: 280px;
    }
    
    .hero-polaroid-1 {
        top: 30px;
        left: 5%;
    }
    
    .hero-polaroid-2 {
        top: 60px;
        left: 25%;
    }
    
    .hero-polaroid-3 {
        top: 30px;
        left: 50%;
    }
    
    .hero-polaroid-4 {
        top: 60px;
        left: 70%;
    }
    
    .polaroids-stack {
        height: 400px;
    }
    
    .polaroid-item {
        width: 250px;
    }
    
    .polaroid-image {
        height: 200px;
    }
    
    .event-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .event-time {
        min-width: auto;
    }
    
    .party-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .wedding-quote {
        font-size: 16px;
    }
    
    .year-title {
        font-size: 20px;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .main-header {
        padding: 60px 15px 40px;
    }
    
    .polaroids-section,
    .quote-section,
    .wedding-party-section,
    .gifts-section,
    .rsvp-section {
        padding: 50px 15px;
    }
    
    .section-divider {
        width: 70%;
        margin: 40px auto;
    }

    /* Additional centering for tablets */
    .rsvp-link,
    .rsvp-form,
    .rsvp-message,
    .section-title,
    .wedding-quote,
    .party-grid,
    .gifts-intro,
    .Gifts-text,
    .honeymoon-intro,
    .honeymoon-text,
    .Children-intro,
    .Children-text,
    .Photo-intro,
    .Photo-text,
    .Dress-intro,
    .Dress-text,
    .children-note {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wedding-title {
        font-size: 28px;
    }

    .polaroids-stack {
        height: 350px;
    }

    .polaroid-item {
        width: 180px;
    }

    .polaroid-image {
        height: 150px;
    }

    /* Ensure all centered elements stay centered on very small screens */
    .rsvp-link,
    .rsvp-form,
    .rsvp-message,
    .section-title,
    .wedding-quote,
    .party-grid,
    .gifts-intro,
    .Gifts-text,
    .honeymoon-intro,
    .honeymoon-text,
    .Children-intro,
    .Children-text,
    .Photo-intro,
    .Photo-text,
    .Dress-intro,
    .Dress-text,
    .children-note,
    .footer-text {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    /* Note: Polaroid positioning is handled by JavaScript/GSAP animations */
    /* Do not override left/transform properties here as it breaks animations */
}
