:root {
    --primary-red: #d50000;
    --primary-gold: #ffd700;
    --secondary-gold: #ffb74d;
    --text-cream: #800000;
    --bg-dark: #b71c1c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif Gujarati', serif;
    background-color: #fdfbf7;
    color: var(--text-cream);
    overflow: hidden;
    /* Handle scroll via JS/GSAP */
    height: 100vh;
    width: 100vw;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
    mix-blend-mode: screen;
}

main {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: url('../assets/images/universal_bg.jpg') no-repeat center center fixed;
    background-size: cover;
    overflow-y: auto;
    /* Allow scrolling within screens if content is long */
}

/* Texture Overlay */
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffd700' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.scrollable-content {
    justify-content: flex-start;
    padding-top: 0;
    padding-bottom: 4rem;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    touch-action: pan-y;
    /* Only allow vertical scrolling on touch devices */
}

.scrollable-content::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

#events-screen {
    overflow: hidden;
    touch-action: pan-y;
    /* Only allow vertical scrolling */
}

#events-screen .content-wrapper {
    touch-action: pan-y;
    /* Ensure vertical-only scrolling */
    overscroll-behavior: contain;
    /* Prevent scroll chaining */
}

/* Gujarati Fonts */
.gujarati-text {
    font-family: 'Noto Serif Gujarati', serif;
}

.gujarati-title {
    font-family: 'Baloo Bhai 2', cursive;
    font-weight: 800;
}

.gujarati-highlight {
    font-family: 'Baloo Bhai 2', cursive;
    font-weight: 600;
    color: var(--primary-red);
}

/* Intro Screen Styles */
.top-invocations {
    margin-bottom: 2rem;
    font-size: 1.4rem;
    color: var(--primary-red);
    opacity: 0.9;
    line-height: 1.6;
    position: relative;
    height: 2em;
    /* Reserve space for one line of text */
    width: 100%;
}

.top-invocations p {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    font-family: 'Shrikhand';
    /* Start hidden, GSAP will handle it */
}

.main-motif {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    max-height: 40vh;
}

.ganesha-img,
.vageshwari-img,
.goga-img {
    height: 280px;
    width: auto;
    max-width: 90%;
    max-height: 35vh;
    /* 
       Switched back to screen/lighten for dark background.
    */
    filter: brightness(1.1) contrast(1.1) drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    mix-blend-mode: screen;
    opacity: 0.95;
    animation: pulse-glow 4s infinite ease-in-out;
}

.vageshwari-img,
.goga-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.wedding-logo-main {
    height: 280px;
    width: auto;
    max-width: 90%;
    max-height: 35vh;
    position: absolute;
    top: 30%;
    /* Moved up even further */
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.2));
}

.text-container {
    margin-top: -4rem;
    /* Pull up significantly more */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    /* Reduced from 0.5rem */
}

.couple-names-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: -1rem;
    /* Adjusted relative to text-container */
    position: relative;
    z-index: 5;
}

.name-intro {
    font-family: 'Noto Serif Gujarati', serif;
    font-size: 1.8rem;
    color: #800000;
    font-weight: bold;
}

.hast-melap-icon {
    height: 110px;
    width: auto;
    filter: brightness(0.8) sepia(1) hue-rotate(-50deg) saturate(5);
    /* Adjust color to match theme if needed, or leave natural */
}

.main-title {
    font-size: 2.5rem;
    color: #b80c0c;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.shubh-lagna {
    font-family: 'Shrikhand', cursive;
    font-weight: 400;
    font-size: 1.1em;
    /* Slightly larger */
}

.mantra {
    font-size: 1.2rem;
    color: var(--primary-red);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-red);
    font-size: 1rem;
    opacity: 0.8;
    cursor: pointer;
    z-index: 10;
}

.arrow {
    font-size: 1.5rem;
    margin-top: 5px;
    animation: bounce 2s infinite;
}

/* Details Screen Styles */
.wedding-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-cream);
    margin-bottom: 2rem;
    max-width: 90%;
}

.couple-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.name-block {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.prefix {
    font-size: 1.2rem;
    color: var(--text-cream);
}

.name {
    font-size: 3.5rem;
    color: var(--primary-red);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.wedding-logo {
    margin: 0.5rem 0;
}

.amp {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--text-cream);
}

.parents-info {
    font-size: 0.9rem;
    color: var(--text-cream);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.and-symbol {
    color: var(--primary-gold);
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.wedding-date-highlight {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--primary-gold);
    padding: 1rem 2rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.wedding-date-highlight p {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-red);
}

/* Events Screen Styles */
.section-title {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.greeting-container {
    text-align: center;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    margin-bottom: 0;
}

.greeting-text {
    font-size: 1.3rem;
    color: #800000;
    font-weight: 600;
}

.dynamic-guest-name {
    border-bottom: 2px dotted #800000;
    padding: 0 10px;
    display: inline-block;
    min-width: 200px;
    font-weight: bold;
}

.invitation-para {
    font-size: 1rem;
    color: var(--primary-red);
    /* Slightly darker/different for body text */
    margin-top: 1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: justify;
    text-align-last: center;
}

.greeting-container .invitation-para {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.greeting-container .couple-names-intro {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.scroll-hint-events {
    margin-top: 1rem;
    color: #d50000;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 2s infinite;
    padding-bottom: 2rem;
    /* Ensure space at bottom */
}

.scroll-hint-events .arrow {
    font-size: 1.5rem;
    margin-top: 0;
}

.events-timeline {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    transition: all 0.5s ease;
    opacity: 0;
    /* Hidden initially for GSAP */
    transform: translateY(50px);
    touch-action: pan-y;
    /* Prevent horizontal dragging on cards */
}

.event-card:nth-child(even) {
    flex-direction: row-reverse;
}

.event-media {
    flex: 1;
    width: 100%;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    /* Very dark red, almost black */
    position: relative;
}

.media-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease;
}

.event-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    visibility: hidden;
    /* Hide until loaded */
    opacity: 0;
    transition: opacity 0.3s ease-in, visibility 0s 0.3s;
    /* Delay visibility change */
}

.event-video.loaded {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-in, visibility 0s 0s;
    /* No delay when showing */
}

.event-card:hover .media-placeholder {
    transform: scale(1.1);
}

.event-details {
    flex: 1;
    text-align: center;
    padding: 1rem;
}

.event-card:nth-child(even) .event-details {
    text-align: center;
}

.event-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-red);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.event-date {
    font-size: 1.3rem;
    color: var(--text-cream);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.event-time {
    font-size: 1.2rem;
    color: var(--primary-red);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.event-location {
    font-size: 1rem;
    color: var(--primary-red);
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.6;
}

/* Responsive for Events */
@media (max-width: 768px) {
    .event-card {
        flex-direction: column !important;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .event-details,
    .event-card:nth-child(even) .event-details {
        text-align: center;
    }

    .event-media {
        height: 200px;
    }
}

.qr-code-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    /* align-items: flex-start; */
    /* Align left by default */
    gap: 5px;
}

/* Responsive adjustment for QR alignment */
@media (max-width: 768px) {

    .qr-code-container,
    .event-card:nth-child(even) .qr-code-container {
        align-items: center;
    }
}

.qr-code-img {
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-gold);
    border-radius: 10px;
    padding: 5px;
    background: white;
    transition: transform 0.3s ease;
}

.qr-code-img:hover {
    transform: scale(1.1);
}

.map-link {
    font-size: 0.9rem;
    color: var(--primary-red);
    text-decoration: none;
    font-weight: bold;
    /* display: flex; */
    align-items: center;
    gap: 5px;
}

.map-link:hover {
    text-decoration: underline;
}

/* Buttons */
.gold-btn {
    background: linear-gradient(to bottom, var(--secondary-gold), var(--primary-gold));
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50px;
    color: var(--primary-red);
    /* Dark red text for contrast on gold */
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gold-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.6);
}

/* Family Gratitude Section */
.family-gratitude-section {
    margin-top: 4rem;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid var(--primary-gold);
    text-align: center;
    margin-bottom: 10px;
}

.family-names-grid {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.family-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    font-size: 1.1rem;
    color: var(--primary-red);
    font-weight: bold;
    align-items: start;
}

.family-row span {
    text-align: left;
}

.children-row {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    font-size: 1.3rem;
    color: var(--primary-red);
}

.children-row span {
    text-align: center;
    width: auto;
}

.harsh-geet-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--primary-gold);
}

.small-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-gold);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.poem-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--primary-red);
    font-size: 1.1rem;
}

.highlight-text {
    color: var(--primary-red) !important;
    font-weight: bold;
    font-size: 1.2rem !important;
    margin-top: 1.5rem;
}

/* Family Signature - Calligraphic Style */
/* Alternative font options - simply replace line 716 with any of these:
   Option 1 (Current): font-family: 'Tiro Gujarati', 'Noto Serif Gujarati', serif; (Elegant italic calligraphy)
   Option 2: font-family: 'Shrikhand', cursive; (Bold decorative style)
   Option 3: font-family: 'Mukta Vaani', 'Noto Serif Gujarati', sans-serif; (Modern bold)
   Option 4: font-family: 'Hind Vadodara', 'Noto Serif Gujarati', sans-serif; (Clean traditional)
   Option 5: font-family: 'Baloo Bhai 2', cursive; (Playful rounded)
*/
.family-signature {
    font-family: 'Tiro Gujarati', 'Noto Serif Gujarati', serif;
    font-size: 3rem;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(135deg, #b80c0c 0%, #b80c0c 30%, #ffd700 50%, #b80c0c 70%, #b80c0c 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 3px;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.6));
    animation: signature-glow 3s ease-in-out infinite, gradient-shift 5s ease infinite;
    position: relative;
    padding: 0 60px;
    line-height: 1.3;
}

.family-signature::before,
.family-signature::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    background: linear-gradient(135deg, #d4af37, #b80c0c, #b80c0c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
    animation: star-pulse 2s ease-in-out infinite;
}

.family-signature::before {
    left: 0;
}

.family-signature::after {
    right: 0;
}

@keyframes signature-glow {

    0%,
    100% {
        filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.6));
    }

    50% {
        filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.9));
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

@keyframes star-pulse {

    0%,
    100% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}


@media (max-width: 768px) {
    .family-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .family-row span {
        text-align: center;
        width: 100%;
    }
}

/* Music Button */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

.music-btn.playing {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    animation-play-state: running;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes pulse-glow {
    0% {
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    }

    50% {
        filter: brightness(1.2) contrast(1.15) drop-shadow(0 0 25px rgba(212, 175, 55, 0.7));
    }

    100% {
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Ornament Corners */
.ornament-corner {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10,10 Q50,10 90,50' fill='none' stroke='%23d4af37' stroke-width='2' opacity='0.5'/%3E%3Cpath d='M10,10 Q10,50 50,90' fill='none' stroke='%23d4af37' stroke-width='2' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.top-left {
    top: 10px;
    left: 10px;
}

.top-right {
    top: 10px;
    right: 10px;
    transform: rotate(90deg);
}

.bottom-right {
    bottom: 10px;
    right: 10px;
    transform: rotate(180deg);
}

.bottom-left {
    bottom: 10px;
    left: 10px;
    transform: rotate(270deg);
}

.hidden {
    display: none;
    opacity: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .name {
        font-size: 2.5rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .wedding-text {
        font-size: 0.9rem;
    }

    .content-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .screen {
        background-image: url('../assets/images/mobile_bg.jpg');
    }

    /* Adjust scroll indicator for average-sized phones */
    .scroll-indicator {
        bottom: 80px;
    }

    /* Adjust fade for average-sized phones - fade starts higher */
    .content-wrapper {
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 90%, transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 90%, transparent 100%);
    }
}

/* For smaller phones, move it even higher */
@media (max-width: 480px) {
    .top-invocations {
        font-size: 0.9rem;
        /* Reduced to prevent line break */
        white-space: nowrap;
    }

    .name {
        font-size: 2.2rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .name-intro {
        font-size: 1.4rem;
    }

    .wedding-text {
        font-size: 0.9rem;
    }

    .content-wrapper {
        padding: 1rem;
        overflow-y: auto;
        height: 100%;
        /* Fade settings for small phones (iPhone 13 mini, etc.) - working correctly */
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 96%, transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 96%, transparent 100%);
    }

    .content-wrapper.scrollable-content {
        padding-top: 1rem;
        /* Increased slightly to be safe */
        padding-bottom: 6rem;
    }

    .greeting-container {
        justify-content: flex-start;
        min-height: auto;
        /* Allow it to take natural height */
        padding-top: 0;
        /* Remove extra padding since wrapper has it */
    }

    .screen {
        overflow: hidden;
        padding: 4.2rem 2rem;
    }

    .scroll-indicator {
        bottom: 100px;
        /* Higher for very small phones */
    }

    .desktop-hint {
        display: none !important;
    }

    .mobile-hint {
        display: flex !important;
        position: absolute;
        bottom: 5rem;
        right: 2rem;
        z-index: 20;
        padding-bottom: 0;
        margin: 0;
        align-items: flex-end;
    }

    .mobile-hint .gujarati-text {
        font-size: 0.8rem;
    }

    .event-title,
    .section-title {
        white-space: nowrap;
        font-size: 1.4rem;
    }

    .family-signature {
        font-size: 2.5rem;
        letter-spacing: 2px;
        padding: 0 50px;
    }

    .family-signature::before,
    .family-signature::after {
        font-size: 1.8rem;
    }

    .family-signature::before {
        left: 5px;
    }

    .family-signature::after {
        right: 5px;
    }
}

.mobile-hint {
    display: none;
}