/* ===== CSS Variables ===== */
:root {
    --primary-purple: #4B0082;
    --secondary-purple: #800020;
    --gold: #D4AF37;
    --light-gold: #C5B358;
    --text-light: #F5F5DC;
    --accent: rgba(201, 169, 97, 0.8);
    --transition-speed: 0.3s;
}

/* ===== Responsive Enhancements & Safe Area Support ===== */
/* Prevent fixed scenes from being hidden behind phone UI (notch / home bar) */
.scene {
    top: env(safe-area-inset-top, 0);
    height: calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
}

/* Make scene cards more fluid on medium screens */
.scene-card {
    max-width: 100%;
    padding: 2.5rem;
}

/* Mid-size devices (tablets / small laptops) */
@media (max-width: 1024px) {
    .scene-card {
        max-width: 720px;
        padding: 2rem;
        border-radius: 24px;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    /* Move progress indicator inwards and center on narrower viewports */
    .progress-indicator {
        left: 1rem;
        right: 1rem;
        transform: translateX(0);
        justify-content: center;
        gap: 0.8rem;
    }
}

/* Small phones */
@media (max-width: 420px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .scene-card {
        padding: 1rem 0.8rem;
        border-radius: 18px;
    }

    .om-symbol {
        font-size: 4.5rem;
    }

    .invitation-text {
        font-size: 1.6rem;
    }

    .groom-name, .bride-name {
        font-size: 2rem;
    }

    /* Keep progress indicator and countdown safe from bottom UI and avoid overlap */
    .progress-indicator {
        bottom: calc(0.8rem + env(safe-area-inset-bottom, 0));
        left: 0.6rem;
        right: 0.6rem;
        padding: 0.6rem 0.8rem;
        gap: 0.6rem;
        border-radius: 999px;
        backdrop-filter: blur(8px);
    }

    .progress-dot {
        width: 10px;
        height: 10px;
    }

    .countdown-item span:first-child {
        font-size: 1.2rem;
    }

    .countdown-label {
        font-size: 0.65rem;
    }

    .floating-flower {
        font-size: 1.2rem;
    }

    .lightbox-prev, .lightbox-next {
        font-size: 1.6rem;
        padding: 0.4rem;
    }
}

/* Extra: ensure lightbox content fits smaller screens */
@media (max-width: 768px) {
    .lightbox-content {
        width: 95%;
        padding: 0.5rem;
    }

    .lightbox-image-container {
        max-height: 70vh;
    }
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(75, 0, 130, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light-gold);
}

/* ===== Opening Overlay ===== */
.opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.opening-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.om-symbol {
    font-size: 8rem;
    color: var(--gold);
    animation: omPulse 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
}

.invitation-text {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--text-light);
    margin-top: 2rem;
    animation: fadeInUp 1.5s ease 0.5s both;
}

.tap-instruction {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--light-gold);
    margin-top: 3rem;
    animation: blink 2s ease-in-out infinite;
}

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

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== Main Container ===== */
.main-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* ===== Scene Styles ===== */
.scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease, transform 1.5s ease;
    transform: scale(0.9);
}

.scene.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.scene.exiting {
    opacity: 0;
    transform: scale(0.9);
}

/* ===== Scene Card ===== */
.scene-card {
    background: rgba(75, 0, 130, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--accent);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.scene-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

/* ===== Typography ===== */
h1 {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--gold);
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--light-gold);
    margin: 1rem 0;
}

h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0.5rem 0;
}

p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* ===== Decorative Elements ===== */
.decorative-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.5rem auto;
}

.decorative-flourish {
    font-size: 2rem;
    color: var(--gold);
    margin: 2rem 0;
    letter-spacing: 1rem;
}

.mandala-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30rem;
    color: rgba(212, 175, 55, 0.05);
    z-index: -1;
    animation: rotate 60s linear infinite;
}

/* ===== Scene 1: Header ===== */
.om-header {
    font-size: 5rem;
    color: var(--gold);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.main-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
}

.subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--light-gold);
}

/* ===== Scene 2: Couple Names ===== */
.heart-symbol, .rings-symbol {
    font-size: 3rem;
    margin: 1rem 0;
    animation: heartbeat 2s ease-in-out infinite;
}

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

.groom-name, .bride-name {
    font-family: 'Great Vibes', cursive;
    font-size: 3.5rem;
    color: var(--gold);
    margin: 0.5rem 0;
}

.parent-info {
    font-size: 1.2rem;
    color: var(--light-gold);
    font-style: italic;
    margin-bottom: 1rem;
}

.and-symbol {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--text-light);
    margin: 1rem 0;
}

.wedding-date {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-top: 2rem;
    font-weight: 600;
}

/* ===== Scene 3: Invitation Message ===== */
.blessing-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.invitation-message {
    font-size: 1.5rem;
    line-height: 2;
    max-width: 700px;
    margin: 2rem auto;
}

.family-signature {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--light-gold);
    margin-top: 2rem;
}

/* ===== Scene 4: Events Timeline ===== */
.scene[data-scene="4"] .scene-card {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    gap: 1rem;
    overflow-y: scroll;
    overflow-x: hidden;
    /* Hide scrollbar while keeping scroll functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scene[data-scene="4"] .scene-card::-webkit-scrollbar {
    display: none;
}

.event-item {
    background: rgba(128, 0, 32, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid var(--accent);
    transition: all 0.4s ease;
    cursor: pointer;
    /* transform: scale(0.5); */
    opacity: 0.7;
}

.event-item:hover {
    /* transform: scale(1); */
    opacity: 1;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.event-item.expanded {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    padding: 2rem;
}

/* Desktop: Horizontal Layout */
.scene[data-scene="4"] h2 {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.scene[data-scene="4"] .decorative-line {
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.scene[data-scene="4"] .event-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* width: calc(33.333% - 1rem); */
    margin: 0 0.5rem;
    vertical-align: top;
}

.scene[data-scene="4"] .scene-card > div:not(h2):not(.decorative-line) {
    display: inline-flex;
}

.event-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.event-date {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: 600;
    margin: 0.5rem 0;
}

.event-time {
    font-size: 1.3rem;
    color: var(--light-gold);
    margin: 0.3rem 0;
}

.event-venue {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ===== Scene 5: Venue Details ===== */
.venue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.venue-card {
    background: rgba(128, 0, 32, 0.3);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--accent);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.venue-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
}

.venue-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.venue-address {
    font-size: 1.2rem;
    line-height: 1.8;
    margin: 1rem 0;
}

.map-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), var(--light-gold));
    color: var(--primary-purple);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.map-link:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.5);
}

/* ===== Scene 6: Contact Information ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contact-card {
    background: rgba(128, 0, 32, 0.3);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--accent);
    transition: transform var(--transition-speed);
}

.contact-card:hover {
    transform: scale(1.05);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.phone-link {
    display: block;
    font-size: 1.5rem;
    color: var(--gold);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color var(--transition-speed);
}

.phone-link:hover {
    color: var(--light-gold);
}

.contact-note {
    font-size: 1.1rem;
    color: var(--light-gold);
    margin-top: 2rem;
    font-style: italic;
}

/* ===== Scene 7: Photo Gallery ===== */
.gallery-grid {
    align-items: center;
    align-self: center;
    justify-content: center;
    justify-items: center;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    background: rgba(128, 0, 32, 0.3);
    border: 2px solid var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.gallery-placeholder {
    font-size: 5rem;
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color var(--transition-speed);
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--gold);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-placeholder {
    font-size: 15rem;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 1rem;
    background: rgba(75, 0, 130, 0.5);
    border-radius: 50%;
    transition: background var(--transition-speed);
    user-select: none;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(212, 175, 55, 0.8);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* ===== Scene 8: Blessing ===== */
.ganesha-symbol {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.blessing-message {
    font-size: 1.5rem;
    line-height: 2;
    max-width: 700px;
    margin: 2rem auto;
}

/* ===== Scene 9: Footer ===== */
.closing-message {
    font-size: 1.8rem;
    margin: 2rem 0;
}

.om-footer {
    font-size: 4rem;
    color: var(--gold);
    margin: 2rem 0;
}

.mantra {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--light-gold);
    margin: 1rem 0;
}

.restart-hint {
    font-size: 1rem;
    color: var(--accent);
    margin-top: 2rem;
    font-style: italic;
}

/* ===== Progress Indicator ===== */
.progress-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 1000;
    background: rgba(75, 0, 130, 0.5);
    padding: 1rem 2rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(245, 245, 220, 0.3);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.progress-dot:hover {
    background: var(--light-gold);
    transform: scale(1.3);
}

.progress-dot.active {
    background: var(--gold);
    transform: scale(1.5);
    box-shadow: 0 0 10px var(--gold);
}


.countdown-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--light-gold);
    text-align: center;
    margin-bottom: 0.5rem;
}

.countdown-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

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

.countdown-item span:first-child {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: 700;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

/* ===== Floating Flowers ===== */
#floating-flowers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-flower {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    h3 {
        font-size: 1.8rem;
    }

    p {
        font-size: 1.3rem;
    }

    .scene-card {
        padding: 2rem 1.5rem;
    }

    .om-symbol {
        font-size: 5rem;
    }

    .invitation-text {
        font-size: 2rem;
    }

    .groom-name, .bride-name {
        font-size: 2.5rem;
    }

    .venue-grid, .contact-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Mobile: Vertical Layout for Events */
    .scene[data-scene="4"] .event-item {
        display: block;
        width: 100%;
        margin: 1rem 0;
    }

    .countdown-item span:first-child {
        font-size: 1.3rem;
    }

    .countdown-label {
        font-size: 0.7rem;
    }

    .progress-indicator {
        bottom: 1rem;
        padding: 0.8rem 1.5rem;
        gap: 0.8rem;
    }

    .progress-dot {
        width: 10px;
        height: 10px;
    }

    .lightbox-prev, .lightbox-next {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    p {
        font-size: 1.2rem;
    }

    .scene-card {
        padding: 1.5rem 1rem;
    }

    .event-item {
        padding: 1.5rem;
    }

    .venue-card, .contact-card {
        padding: 1.5rem;
    }
}
a{
    position: relative;
    z-index: 1000;
}

/* ===== Music Toggle Button ===== */
.music-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(75, 0, 130, 0.8);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.music-toggle:hover {
    background: rgba(75, 0, 130, 1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    transform: scale(1.1);
}

.music-toggle:active {
    transform: scale(0.95);
}

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

.music-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.music-toggle.paused .music-icon {
    opacity: 0.7;
}

/* Responsive adjustments for music toggle */
@media (max-width: 768px) {
    .music-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .music-toggle {
        top: 0.8rem;
        right: 0.8rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}