/* Invitation Page Specific Styles */
.invitation-body {
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(135deg, 
        rgba(255,149,128,0.1) 0%, 
        rgba(250,247,242,1) 25%, 
        rgba(75,108,183,0.1) 100%);
    width: 100%;
    max-width: 100vw;
    position: relative;
    /* Remove min-height to prevent scroll boundary issues */
}

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    touch-action: pan-y;
}

.invitation-body .particles-container {
    pointer-events: none;
    z-index: 0;
}

.nav-bar {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    animation: slideInLeft 0.8s ease-out;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

.invitation-main {
    padding: 80px 2rem 4rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Remove min-height constraint that causes bounce-back */
}

.invitation-container {
    max-width: 800px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.invitation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: visible;
    animation: fadeInUp 1s ease-out;
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

.invitation-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(255,149,128,0.05) 0%, 
        transparent 40%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

.invitation-header {
    margin-bottom: 3rem;
    text-align: center;
}

.ornament-top, .ornament-bottom {
    height: 30px;
    color: var(--primary-color);
    margin: 2rem auto;
    opacity: 0.8;
}

.invitation-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 1rem 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.invitation-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.8;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

.couple-names-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
    text-align: center;
}

.bride-name, .groom-name {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
    animation: fadeInScale 1.2s ease-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bride-name {
    color: var(--primary-color);
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.groom-name {
    color: var(--secondary-color);
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.ampersand-decoration {
    width: 50px;
    height: 50px;
    color: var(--accent-color);
    animation: pulse 2s ease-in-out infinite;
}

.couple-photos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 3rem 0;
    text-align: center;
    width: 100%;
}

.photo-carousel {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 200px;
    max-height: 350px;
    border-radius: 15px;
    background: transparent;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.photo-slide.active {
    opacity: 1;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--text-color);
    width: auto;
    height: auto;
}

.photo-placeholder img {
    max-width: 400px;
    max-height: 350px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Smart sizing for different orientations */
.photo-placeholder img.portrait {
    max-height: 350px;
    width: auto;
    object-fit: contain;
}

.photo-placeholder img.landscape {
    max-width: 400px;
    height: auto;
    object-fit: contain;
}

.photo-placeholder img.square {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
}

.photo-placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.photo-placeholder .photo-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.95;
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,149,128,0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,149,128,0.6);
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(255,149,128,0.4);
}

.photo-frame-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) 1;
    border-radius: 15px;
    animation: borderShimmer 3s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.7;
}

.wedding-details {
    display: grid;
    gap: 2rem;
    margin: 4rem 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.detail-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.detail-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
}

.detail-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.venue-detail {
    font-size: 0.9rem !important;
    opacity: 0.7;
    font-style: italic;
}

.maps-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(66, 133, 244, 0.1);
    color: #4285F4;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.maps-link:hover {
    background: rgba(66, 133, 244, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.2);
}

.invitation-message {
    margin: 4rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, 
        rgba(255,149,128,0.1) 0%, 
        rgba(75,108,183,0.1) 100%);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.invitation-message p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    font-style: italic;
}

.rsvp-section {
    margin: 4rem 0 2rem;
    text-align: center;
}

.rsvp-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0 0 0.5rem 0;
    letter-spacing: 2px;
}

.rsvp-section p {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin: 0 0 2rem 0;
}

.rsvp-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.rsvp-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.rsvp-btn.attending {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(255,149,128,0.3);
}

.rsvp-btn.attending:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,149,128,0.4);
}

.rsvp-btn.not-attending {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    border: 2px solid rgba(255,149,128,0.3);
}

.rsvp-btn.not-attending:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    z-index: -1;
    /* Use fixed positioning to prevent scroll interference */
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes photoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes borderShimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

/* Mobile scroll fixes */
@media (max-width: 768px) {
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for readable content */
    .invitation-message p,
    .detail-content p,
    .detail-content h3,
    .invitation-title,
    .invitation-subtitle,
    .bride-name,
    .groom-name {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Prevent scroll interference from animations */
    .floating-hearts {
        pointer-events: none;
        touch-action: none;
    }
    
    /* Ensure carousel doesn't interfere with scrolling */
    .photo-carousel {
        touch-action: pan-y;
    }
    
    .carousel-dots {
        touch-action: manipulation;
    }
    
    /* Prevent layout shifts during animations */
    .photo-slide {
        transform: translate3d(-50%, -50%, 0);
    }
    
    /* Prevent scroll jumping and improve performance */
    .invitation-card {
        contain: layout;
        transform: translate3d(0, 0, 0);
    }
    
    /* Disable particles container on mobile */
    .particles-container {
        display: none;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .invitation-main {
        padding: 60px 1rem 3rem;
        touch-action: pan-y;
        /* Remove min-height constraint on mobile */
    }
    
    .invitation-card {
        padding: 2rem 1.5rem;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .invitation-title {
        font-size: 2.5rem;
    }
    
    .bride-name, .groom-name {
        font-size: 2.5rem;
    }
    
    .couple-names-section {
        gap: 0.8rem;
    }
    
    .photo-carousel {
        max-width: min(320px, 90vw);
        min-height: 200px;
        max-height: 240px;
    }
    
    .wedding-details {
        gap: 1.5rem;
    }
    
    .detail-item {
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-bar {
        top: 15px;
        left: 15px;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .invitation-main {
        padding: 50px 0.75rem 2rem;
        touch-action: pan-y;
        /* Additional mobile scroll optimization */
        -webkit-overflow-scrolling: auto;
        /* Remove min-height constraint that causes scroll issues */
    }
    
    /* Ensure body scroll is smooth on small screens */
    body {
        overscroll-behavior: contain;
    }
    
    .invitation-card {
        padding: 1.5rem 1rem;
        border-radius: 15px;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
    
    .invitation-title {
        font-size: 2rem;
    }
    
    .bride-name, .groom-name {
        font-size: 2rem;
    }
    
    .couple-names-section {
        gap: 0.5rem;
    }
    
    .ampersand-decoration {
        width: 35px;
        height: 35px;
    }
    
    .photo-carousel {
        max-width: min(280px, 85vw);
        min-height: 180px;
        max-height: 200px;
    }
    
    .rsvp-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .rsvp-btn {
        width: 180px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Additional scroll performance optimizations */
@media (max-width: 768px) {
    /* Prevent momentum scrolling issues and bounce-back */
    .invitation-body {
        overscroll-behavior-y: none;
        overscroll-behavior-x: contain;
    }
    
    html, body {
        overscroll-behavior-y: none;
        height: auto;
        min-height: 100%;
    }
    
    /* Ensure animations don't interfere with scroll */
    .floating-hearts * {
        pointer-events: none;
        touch-action: none;
    }
    
    /* Optimize heavy animations for mobile */
    .invitation-card::before {
        animation: none;
    }
    
    /* Prevent scroll restoration issues */
    .invitation-container {
        min-height: auto;
    }
}