/* Main Content Overlay */
.main-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #fdfbf7; /* Use the card's off-white color */
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
    overflow: hidden;
}

.main-content.active {
    transform: translateY(0);
}

/* Parallax Backgrounds */
.parallax-bg {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    transition: transform 0.1s ease-out;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.layer-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4), transparent 70%);
    top: 10%;
    left: 10%;
    z-index: 0;
}

.layer-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.4), transparent 70%);
    bottom: 10%;
    right: 10%;
    z-index: 0;
    animation-delay: -10s;
}

/* Prezi Canvas Layout */
.p-canvas {
    width: 600vw;
    height: 600vh;
    position: absolute;
    top: 50%;
    left: 50%;
    /* Start centered on intro relative to 300vw/300vh container */
    transform: translate(-50%, -50%) scale(1);
    transform-origin: 50% 50%;
    transition: transform 1.2s cubic-bezier(0.86, 0, 0.07, 1), transform-origin 1.2s cubic-bezier(0.86, 0, 0.07, 1);
    perspective: 1500px;
    background: rgba(253, 251, 247, 0.5); /* Slight tint for debugging */
    transform-style: preserve-3d;
    z-index: 1;
}

.p-slide {
    position: absolute;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    pointer-events: auto; /* Ensure slides can be clicked */
}

/* Positioning Slides Spatially */
/* Canvas Center is 50%, 50% */
.slide-intro {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.slide-akad {
    top: 10%;
    left: 10%;
    transform: translate(-50%, -50%);
}

.slide-resepsi {
    top: 90%;
    left: 90%;
    transform: translate(-50%, -50%);
}

.slide-wishes {
    top: 10%;
    left: 90%;
    transform: translate(-50%, -50%);
}

.slide-video {
    top: 90%;
    left: 10%;
    transform: translate(-50%, -50%);
}

.slide-gallery {
    top: 50%;
    left: 10%;
    transform: translate(-50%, -50%);
}

.slide-sumbangan {
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.slide-story {
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.slide-ayat {
    top: 50%;
    left: 90%;
    transform: translate(-50%, -50%);
}

.slide-rsvp {
    top: 30%;
    left: 30%;
    transform: translate(-50%, -50%);
}

/* Controls */
.p-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    user-select: none;
    max-width: 90vw;
}

/* Scrollable Navigation Container */
.nav-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    max-width: 600px;
    padding: 2px 0;
}

.nav-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Scroll Arrow Buttons */
.scroll-arrow {
    background: var(--primary-color);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow .icon {
    font-size: 0.9rem;
    line-height: 1;
}

.scroll-arrow:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.scroll-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

.nav-btn {
    background: none;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 60px;
}

.nav-btn .icon {
    font-size: 1.2rem;
    line-height: 1;
}

.nav-btn .label {
    font-size: 0.65rem;
    white-space: nowrap;
}

.nav-btn.active,
.nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.close-btn-fixed {
    background: none;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    font-family: 'Cinzel', serif;
    padding: 10px;
    margin-left: 10px;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn-fixed .icon {
    font-size: 1.2rem;
    line-height: 1;
    font-weight: bold;
}

.close-btn-fixed:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Minimize Button */
.minimize-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    padding: 10px;
    margin-left: 5px;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.minimize-btn .icon {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: bold;
}

.minimize-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Minimized Menu Button */
.minimized-menu {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 200;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    padding: 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.minimized-menu .icon {
    font-size: 1.8rem;
    line-height: 1;
}

.minimized-menu:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Minimized State */
.p-controls.minimized {
    transform: translateX(-50%) translateY(150%);
    opacity: 0;
    pointer-events: none;
}

/* Content Styles */
.names-big {
    font-family: 'Great Vibes', cursive;
    font-size: 6rem;
    color: var(--primary-color);
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.date-big {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    letter-spacing: 3px;
    border-top: 1px solid var(--accent-color);
    background: rgba(253, 251, 247, 1);
}

.event-box {
    padding: 20px 20px 70px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    background: rgba(253, 251, 247, 0.95);
    position: relative;
    transform: translateZ(30px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
    max-width: 450px;
    width: 90%;
    height: 480px; /* Fixed height to prevent collision */
    max-height: 70vh; /* Viewport limit */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.event-box:hover {
    transform: translateZ(60px) scale(1.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    background: rgba(253, 251, 247, 1);
}

.event-box h3 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.event-box p {
    font-size: 1rem;
    line-height: 1.8;
}

.event-box .time,
.event-box .location,
.event-box .address {
    margin-bottom: 10px;
}

.wishes-box p {
    font-style: italic;
    color: #666;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Intro Animation */
.header-section {
    opacity: 0;
    transform: translateY(50px) rotateX(-20deg);
    transition: all 1s ease 0.5s;
}

.main-content.active .header-section {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .p-canvas {
        /* On mobile, responsive units like vw/vh might be tricky if address bar hides/shows 
           but generally okay. We keep same ratio 300x300. 
        */
        width: 300vw;
        height: 300vh;
    }

    .names-big {
        font-size: 2.5rem;
    }

    .event-box {
        padding: 20px;
        max-width: 80vw;
        min-height: 50vh;
        max-height: 65vh;
        width: 100%;
        margin: 0 auto;
        transform: translateZ(0) !important;
        /* Flatten 3D to prevent magnification */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }

    .event-box h3 {
        font-size: 1rem;
        margin-bottom: 10px;
        letter-spacing: 0.5px;
    }

    .event-box p {
        font-size: 0.75rem;
        line-height: 1.5;
        margin-bottom: 5px;
    }

    .wishes-box p {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    .p-controls {
        width: 95%;
        max-width: 400px;
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        justify-content: space-evenly;
        padding: 10px;
        gap: 5px;
    }

    .nav-btn {
        padding: 8px 10px;
        min-width: 45px;
    }

    .nav-btn .icon {
        font-size: 1.4rem;
    }

    .nav-btn .label {
        display: none;
        /* Hide labels on mobile for icon-only navigation */
    }

    .close-btn-fixed {
        width: 45px;
        height: 45px;
        padding: 10px;
        margin-left: 5px;
    }

    .close-btn-fixed .icon {
        font-size: 1.4rem;
    }
}

    .minimize-btn {
        width: 45px;
        height: 45px;
        margin-left: 0;
    }

    .minimize-btn .icon {
        font-size: 1.6rem;
    }

    .minimized-menu {
        bottom: 15px;
        bottom: calc(15px + env(safe-area-inset-bottom, 0px));
        left: 15px;
        width: 55px;
        height: 55px;
    }
/* Swipe Hint */
.swipe-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--primary-color);
    text-align: center;
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 20;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 12px;
    border-radius: 20px;
}

.swipe-hint .arrows {
    font-size: 0.9rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Music Toggle Button */
.music-toggle {
    position: fixed;
    top: 20px;`r`n    right: 20px;
    z-index: 200;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    padding: 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.music-toggle .icon {
    font-size: 1.8rem;
    line-height: 1;
}

.music-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.music-toggle.paused {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .music-toggle {
        top: 15px;
        top: calc(15px + env(safe-area-inset-top, 0px));
        right: 15px;
        width: 55px;
        height: 55px;
    }
}

/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
    flex-grow: 1;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: brightness(1.1);
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoom 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-color);
    text-decoration: none;
    transform: scale(1.2);
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .close-modal {
        top: 20px;
        right: 25px;
        font-size: 35px;
    }
}

/* Bank Account Card Styles */
.bank-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    flex-grow: 1;
}

.bank-card {
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.bank-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.bank-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.account-number {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 5px 0;
    color: #333;
}

.account-holder {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
}

.copy-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease, transform 0.2s ease;
    font-family: 'Cinzel', serif;
}

.copy-btn:hover {
    background: var(--accent-color);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: #4CAF50;
}

@media (max-width: 768px) {
    .account-number {
        font-size: 1rem;
    }
    
    .bank-card {
        padding: 12px;
    }
}

/* Event Details & Countdown Styles */
.event-info {
    margin-bottom: 20px;
}

.date-text {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 12px;
    border: 1px dashed var(--accent-color);
}

.timer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-item span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Cinzel', serif;
}

.timer-item small {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.location-info {
    margin: 20px 0;
    text-align: center;
}

.venue-name {
    font-weight: bold;
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.location-info .address {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.event-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1.5px solid var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-btn.outline {
    background: transparent;
    color: var(--primary-color);
}

.event-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .timer-item span {
        font-size: 1.1rem;
    }
    
    .timer-item small {
        font-size: 0.5rem;
    }
    
    .countdown {
        padding: 10px;
        gap: 5px;
    }
}
