/* ================================
   ROOT VARIABLES & RESET
================================ */
:root {
    --primary-color: #ff69b4;
    --secondary-color: #2d2d2d;
    --accent-color: #ffb6c1;
    --bg-dark: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --gradient-pink: linear-gradient(135deg, #ff69b4 0%, #ff1493 50%, #c71585 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --shadow-soft: 0 4px 20px rgba(255, 105, 180, 0.3);
    --shadow-strong: 0 8px 40px rgba(255, 105, 180, 0.4);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --card-bg: var(--gradient-pink);
    --tx: 0px;
    --ty: 0px;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    font-family: "Quicksand", sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ================================
   FLOATING ELEMENTS & EFFECTS
================================ */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    animation-name: float-up;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    opacity: 0.6;
    font-size: clamp(1rem, 3vw, 2rem);
    filter: blur(0.5px);
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-50px) rotate(360deg);
        opacity: 0;
    }
}

.theme-christmas .floating-element {
    animation-name: snow-fall;
}

@keyframes snow-fall {
    0% {
        transform: translateY(-50px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

.theme-birthday .floating-element {
    animation-name: confetti-fall;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-50px) translateX(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) translateX(50px) rotate(180deg) scale(1.2);
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(-50px) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

/* Cursor trail effect */
#cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.trail-heart {
    position: absolute;
    font-size: 1.2rem;
    animation: trail-fade 1s ease-out forwards;
    pointer-events: none;
}

@keyframes trail-fade {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }
}

/* ================================
   NAVIGATION DOTS
================================ */
.section-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-dot::before {
    content: attr(title);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.nav-dot:hover::before {
    opacity: 1;
}

.nav-dot:hover,
.nav-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--primary-color);
}

@media (max-width: 768px) {
    .section-nav {
        right: 10px;
    }

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

    .nav-dot::before {
        display: none;
    }
}

/* ================================
   SECTIONS BASE
================================ */
.section {
    min-height: 100vh;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
}

/* Section snapping (iOS-friendly) */
html {
    scroll-snap-type: y proximity;
    overflow-x: hidden; /* also blocks iOS side-scroll */
}

body {
    overflow-x: hidden;
}

/* Snap points */
.section {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* helps iOS land on a section */
    width: 100%;
}



.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

#reasons .section-title {
    font-family: "Poppins", "Quicksand", sans-serif;
    font-weight: 700;
}


/* ================================
   WELCOME SECTION
================================ */
.welcome-section {
    background: var(--gradient-dark);
    overflow: hidden;
}

.welcome-content {
    text-align: center;
    z-index: 10;
    padding: 20px;
}

.hearts-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            radial-gradient(circle at 20% 80%, rgba(255, 105, 180, 0.1) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 20, 147, 0.1) 0%, transparent 50%),
            radial-gradient(circle at 50% 50%, rgba(199, 21, 133, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.main-title {
    font-family: "Dancing Script", cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--primary-color);
    text-shadow: 0 0 40px rgba(255, 105, 180, 0.5);
    margin-bottom: 20px;
}

.tagline {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 40px;
}

.love-counter {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 105, 180, 0.3);
    border-radius: 20px;
    padding: 30px 50px;
    display: inline-block;
}

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

.counter-number {
    font-family: "Playfair Display", serif;
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.counter-label {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-muted);
    margin-top: 10px;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ================================
   ANIMATIONS
================================ */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease-out 0.6s forwards;
    opacity: 0;
}

.animate-bounce {
    animation: bounceIn 1s ease-out forwards;
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================================
   GALLERY SECTION
================================ */
.gallery-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-light) 100%);
}

.gallery-container {
    position: relative;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.gallery-image-wrapper {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 60px 20px 20px;
    transform: translateY(100%);
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-caption {
    font-weight: 600;
    margin-bottom: 5px;
}

.gallery-date,
.gallery-location {
    font-size: 0.85rem;
    color: var(--accent-color);
    display: block;
}

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

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
}

/* Keep arrows ABOVE everything (images/videos/controls) */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    z-index: 1050;
}

/* Media wrapper so video scales nicely on phone */
.lightbox-content {
    width: min(92vw, 980px);
    max-height: 90vh;
}

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

/* Video behaves like your images (fits phone width, no overflow) */
.lightbox-video {
    display: none;
    max-width: 100%;
    max-height: 80vh;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #000;
}

/* Ensure video can be tapped */
.lightbox-media video {
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Tap-middle layer (for play/pause) */
.video-tap-layer {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

/* Custom UI overlay */
.video-ui {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
    z-index: 3;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox-media.show-controls .video-ui,
.lightbox-media.video-paused .video-ui {
    opacity: 1;
    pointer-events: auto;
}

/* Thin progress bar */
.video-progress {
    width: 100%;
    height: 4px;
    appearance: none;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    outline: none;
    margin: 0 0 8px 0;
}

.video-progress::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-color);
}

.video-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    line-height: 1;
}

.video-time {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
}

/* Vertical volume slider (opens upward) */
.video-vol {
    position: relative;
    display: flex;
    align-items: center;
}

.video-volume {
    position: absolute;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%) rotate(-90deg);
    transform-origin: center;
    width: 110px;

    display: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    outline: none;
}

.video-vol.open .video-volume {
    display: block;
}

.video-volume::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-color);
}

/* On very small phones, keep UI compact */
@media (max-width: 480px) {
    .video-time {
        display: none;
    }
}


.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 20px;
    transition: var(--transition-smooth);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--primary-color);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.2);
}

.lightbox-close:hover {
    transform: scale(1.2);
}

#lightbox-caption {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--accent-color);
}

/* --- Custom lightbox video controls (volume popover so bar stays short) --- */
.lightbox-video-shell { position: relative; }
#lightbox-video { width: 100%; max-height: 80vh; background: #000; border-radius: 10px; }

@supports (-webkit-appearance: slider-vertical) {
}
@supports not (-webkit-appearance: slider-vertical) {
}


/* ================================
   FLIPBOOK / REASONS SECTION
================================ */
.reasons-section {
    background: var(--bg-light);
}

.flipbook-container {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
    overflow: hidden;
}

.flipbook {
    position: relative;
    width: 100%;
    height: 500px;
    perspective: 1500px;
    overflow: hidden;
}

.flip-card {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    transform-style: preserve-3d;
    opacity: 0;
    pointer-events: none;
}

.flip-card.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.flip-card.prev {
    transform: translateX(-120%) rotateY(-15deg);
    opacity: 0.3;
}

.flip-card.next {
    transform: translateX(120%) rotateY(15deg);
    opacity: 0.3;
}

/* Prevent flipbook cards from creating horizontal page scroll (iOS) */
.flipbook-container,
.flipbook {
    overflow: hidden;
}


.flip-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.flip-card-front {
    width: 100%;
    height: 100%;
    background: var(--card-bg, var(--gradient-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.cover-front {
    background: var(--gradient-pink);
}

.cover-content {
    text-align: center;
}

.cover-heart {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

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

.cover-content h3 {
    font-family: "Playfair Display", "Quicksand", serif;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 15px;
}

.cover-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.cover-hint {
    font-size: 0.9rem;
    opacity: 0.8;
    animation: fadeInOut 2s infinite;
}

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

/* ===== Reasons card layout: fixed header area + big image area ===== */
.reason-content{
    position:relative;
    width:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    padding:16px;
    gap:12px;
    color:#fff;
}

/* Header block reserves space for badge + text */
.reason-header{
    position:relative;
    flex:0 0 auto;
    min-height: clamp(120px, 18vh, 220px);             /* reserves space so text never collides with image */
    padding-left:74px;             /* room for badge */
    padding-right:10px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:6px;
    text-align:left;
}

/* Badge: top-left inside the card */
.reason-number{
    position:absolute;
    top:0;
    left:0;
    width:56px;
    height:56px;
    display:grid;
    place-items:center;

    font-family:"Playfair Display",serif;
    font-size:1.05rem;
    font-weight:700;

    background:rgba(255,255,255,0.18);
    border:1px solid rgba(255,255,255,0.22);
    border-radius:999px;
    margin:0;
}

.reason-title{
    margin:0;
    font-family:"Playfair Display","Quicksand",serif;
    font-weight:700;
    font-size:2.1rem;
    line-height:1.15;
}


/* Description under title — no "..." truncation, scroll if very long */
.reason-description{
    margin:0;
    font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.10rem);
    line-height: 1.45;
    opacity: 0.95;

    /* allow more text */
    max-height: clamp(6em, 22vh, 12em);

    /* if description is very long, scroll instead of cutting with "..." */
    overflow: auto;

    /* small padding so scrollbar doesn't overlap text */
    padding-right: 6px;
}


/* Image area takes the remaining height */
.reason-image-container{
    flex:1 1 auto;
    min-height:220px;
    border-radius:15px;
    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;

    background:rgba(0,0,0,0.18);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,0.12);
}

.reason-image{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

/* Mobile tuning */
@media (max-width:768px){
    .reason-content{ padding:14px; }

    .reason-header{
        min-height:100px;
        padding-left:68px;
    }

    .reason-number{
        width:52px;
        height:52px;
        font-size:1rem;
    }

    .reason-title{
        font-size:1.7rem;
    }

    .reason-description{
        font-size:0.98rem;
        -webkit-line-clamp:4;
    }

    .reason-image-container{
        min-height:240px;
    }
}


.final-front {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
}

.final-content {
    text-align: center;
}

.final-heart {
    font-size: 5rem;
    display: block;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%,
    100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    35% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.15);
    }
}

.final-content h3 {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.final-message {
    font-family: "Dancing Script", cursive;
    font-size: 2rem;
    margin-top: 20px;
}

/* Flipbook Navigation */
.flipbook-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.flip-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.flip-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.flip-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.flip-progress {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.flip-progress-bar {
    height: 100%;
    background: var(--gradient-pink);
    transition: width 0.3s ease;
}

.flip-counter {
    text-align: center;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   TIMELINE SECTION
================================ */
.timeline-section {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-dark) 100%);
    padding: 60px 20px 100px;
}

.timeline-container {
    width: 100%;
    max-width: 800px;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 40px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline-container::-webkit-scrollbar {
    display: none;
}

.timeline {
    position: relative;
    padding-left: 40px;
    padding-bottom: 80px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 65px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.timeline::after {
    content: "... ";
    position: absolute;
    left: 5px;
    bottom: 30px;
    width: 20px;
    height: 20px;
    background: var(--bg-dark);
    border: 2px solid rgba(176, 176, 176, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(176, 176, 176, 0.7);
    font-weight: 700;
    line-height: 1;
    padding-bottom: 4px;
}

.timeline-end-message {
    position: absolute;
    left: 35px;
    bottom: 30px;
    color: rgba(176, 176, 176, 0.7);
    font-style: italic;
    font-size: 0.85rem;
    white-space: nowrap;
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideIn 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}
.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}
.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}
.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}
.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}
.timeline-item:nth-child(6) {
    animation-delay: 0.6s;
}
.timeline-item:nth-child(7) {
    animation-delay: 0.7s;
}
.timeline-item:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 0;
    width: 30px;
    height: 30px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 2;
}

.timeline-item.today .timeline-marker {
    background: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-color);
    animation: pulse 2s infinite;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 105, 180, 0.2);
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateX(10px);
}

.timeline-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-title {
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.timeline-description {
    color: var(--text-muted);
    line-height: 1.6;
}

.timeline-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 15px;
}

.timeline-anniversary {
    display: inline-block;
    background: var(--gradient-pink);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .timeline {
        padding-left: 30px;
        padding-bottom: 75px;
    }

    .timeline::before {
        left: 10px;
        bottom: 60px;
    }

    .timeline::after {
        left: 1px;
        bottom: 28px;
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .timeline-marker {
        left: -30px;
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-end-message {
        left: 28px;
        font-size: 0.75rem;
        bottom: 26px;
    }
}

/* ================================
   MESSAGE SECTION
================================ */
.message-section {
    background: var(--bg-dark);
    min-height: 100vh;
}

.message-container {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.message-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 40px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    backdrop-filter: blur(10px);
}

.message-header {
    text-align: center;
    margin-bottom: 30px;
}

.message-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

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

.hidden { display: none !important; }


.message-header h2 {
    font-family: "Dancing Script", cursive;
    font-size: 2rem;
    color: var(--primary-color);
}

.message-body p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-light);
}

.message-signature {
    text-align: right;
    margin-top: 30px;
    color: var(--accent-color);
}

.signature {
    font-family: "Dancing Script", cursive;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Love Quote Generator */
.love-quote-container {
    margin-top: 30px;
    text-align: center;
    min-height: 180px;
}


.quote-btn {
    background: var(--gradient-pink);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.quote-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-strong);
}

.quote-card {
    background: rgba(255, 105, 180, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

.quote-card.hidden {
    display: none;
}

.quote-text {
    font-family: "Poppins", "Quicksand", sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.quote-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

.quote-close:hover {
    opacity: 1;
}

/* Hearts Burst Button */
.hearts-burst-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 40px auto 0;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.hearts-burst-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.hearts-btn-text {
    font-family: "Quicksand", sans-serif;
}

/* Burst hearts animation */
.burst-heart {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 1000;
    animation: burst 1.5s ease-out forwards;
}

@keyframes burst {
    0% {
        opacity: 1;
        transform: scale(0) translate(0, 0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1) translate(var(--tx), var(--ty));
    }
}

/* ================================
   BIRTHDAY OVERLAY
================================ */
.birthday-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: 2000;
    overflow: hidden;
}

.birthday-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 2001;
}

/* Birthday confetti burst class */
.birthday-confetti-burst {
    position: fixed;
    pointer-events: none;
    opacity: 1;
}

.birthday-gift-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2002;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.birthday-gift-stage.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.birthday-gift-content {
    text-align: center;
    padding: 20px;
}

.birthday-title-small {
    font-family: "Dancing Script", cursive;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
}

.birthday-subtitle-small {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 40px;
}

.birthday-gift-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.gift-shake-container {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.gift-shake-container:active {
    transform: scale(0.95);
}

.gift-shake-container.shake {
    animation: giftShake 0.3s ease;
}

@keyframes giftShake {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

.gift-emoji {
    font-size: clamp(6rem, 20vw, 12rem);
    animation: giftFloat 2s ease-in-out infinite;
}

@keyframes giftFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.tap-counter {
    font-size: 1.2rem;
    color: var(--accent-color);
    background: rgba(255, 105, 180, 0.2);
    padding: 15px 30px;
    border-radius: 30px;
    border: 2px solid var(--primary-color);
}

#taps-remaining {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

body.scroll-locked {
    overflow: hidden;
    touch-action: none;
}


.birthday-reveal-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2003;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8);
}

.birthday-reveal-stage.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.birthday-reveal-stage.hidden {
    display: none;
}

.birthday-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
}

.birthday-title {
    font-family: "Dancing Script", cursive;
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
}

.birthday-subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.birthday-age {
    margin-bottom: 30px;
}

.age-number {
    font-family: "Playfair Display", serif;
    font-size: clamp(4rem, 15vw, 6rem);
    font-weight: 700;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1;
}

.age-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    display: block;
    margin-top: 10px;
}

.birthday-message {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 40px;
}

.gift-reveal-content {
    margin: 40px 0;
    animation: fadeIn 0.5s ease-out;
}

.gift-message {
    font-family: "Dancing Script", cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.birthday-close {
    margin-top: 30px;
    background: var(--gradient-pink);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.birthday-close:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-strong);
}

@media (max-width: 768px) {
    .birthday-content {
        padding: 20px 15px;
    }

    .gift-emoji {
        font-size: 8rem;
    }
}

/* ================================
   FOOTER
================================ */
.site-footer {
    background: var(--bg-dark);
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 105, 180, 0.2);
}

.footer-text {
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 10px;
}

.footer-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 768px) {
    .section {
        padding: 40px 15px;
    }

    .love-counter {
        padding: 20px 30px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .flipbook {
        height: 450px;
    }

    .flip-card-front {
        padding: 20px;
    }

    .reason-number {
        font-size: 2rem;
    }

    .reason-title {
        font-size: 1.5rem;
    }

    .reason-description {
        font-size: 1rem;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-marker {
        left: -30px;
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .timeline-content {
        padding: 20px;
    }

    .message-card {
        padding: 25px;
    }

    .birthday-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .counter-number {
        font-size: 2.5rem;
    }

    .flipbook {
        height: 400px;
    }

    .cover-heart {
        font-size: 3rem;
    }

    .cover-content h3 {
        font-size: 1.5rem;
    }
}

/* ================================
   PLACEHOLDER IMAGE
================================ */
.gallery-image[src*="placeholder"],
.reason-image[src*="placeholder"],
.timeline-image[src*="placeholder"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================
   IMPROVED LIGHTBOX WITH THUMBNAILS
================================ */
.lightbox-counter {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.lightbox-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.lightbox-thumbnail:hover {
    opacity: 0.8;
}

.lightbox-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .lightbox-thumbnails {
        display: none;
    }

    .lightbox-counter {
        bottom: 20px;
    }
}

/* ================================
   PREVENT TEXT SELECTION ON INTERACTIVE ELEMENTS
================================ */
button,
.nav-dot,
.gallery-item,
.flip-card,
.flip-btn,
.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-thumbnail,
.quote-btn,
.quote-close,
.hearts-burst-btn,
.birthday-gift-wrapper,
.gift-shake-container,
.gift-emoji,
.tap-counter,
.album-folder,
.album-folder *,
.album-photo-item,
.album-photo-item *,
.lightbox,
.lightbox *,
.birthday-close {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Specific for birthday gift */
.birthday-gift-wrapper,
.birthday-gift-wrapper * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent dragging images */
img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* But allow clicks on gallery images */
.gallery-image,
.lightbox-content img {
    pointer-events: auto;
}

/* Play badge overlay for video thumbnails */
.folder-body.is-video::after,
.album-photo-wrapper.is-video::after,
.lightbox-thumbnail.is-video::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 42px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.folder-body.is-video::before,
.album-photo-wrapper.is-video::before,
.lightbox-thumbnail.is-video::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.0) 55%);
    pointer-events: none;
}


/* ================================
   ALBUM/FOLDER GALLERY WITH FADE EDGES
================================ */

/* Wrapper (no overlays needed) */
/* wrapper */
.albums-fade {
    position: relative;
    overflow: hidden;
}

/* default: fade BOTH edges */
.albums-grid {
    -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 10%,
            #000 90%,
            transparent 100%
    );
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
}

/* at start: NO left fade, only right fade */
.albums-fade.at-start .albums-grid {
    -webkit-mask-image: linear-gradient(
            to right,
            #000 0%,
            #000 90%,
            transparent 100%
    );
}

/* at end: only left fade, NO right fade */
.albums-fade.at-end .albums-grid {
    -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 10%,
            #000 100%
    );
}

/* if content fits (no scrolling): disable fades entirely */
.albums-fade.no-scroll .albums-grid {
    -webkit-mask-image: none;
}


@media (max-width: 768px) {
    .albums-grid {
        padding: 15px 15px;
        gap: 20px;

        -webkit-mask-image: linear-gradient(
                to right,
                transparent 0%,
                #000 12%,
                #000 88%,
                transparent 100%
        );
    }
}

/* Keep the first/last card fully visible even with the right/left fade */
.albums-grid { scroll-padding-left: 8px; scroll-padding-right: 8px; }


.albums-grid {
    display: flex;
    gap: 30px;
    padding: 20px 80px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    transition: var(--transition-smooth);
}

@media (max-width: 768px) {
    .albums-grid {
        padding: 15px 50px;
        gap: 20px;
    }
}

.albums-grid::-webkit-scrollbar {
    height: 8px;
}

.albums-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.albums-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.albums-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.albums-grid.hidden {
    display: none;
}

.album-folder {
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    width: 200px;
    scroll-snap-align: start;
}

.album-folder:hover {
    transform: translateY(-10px);
}

.folder-icon {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.folder-tab {
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 15%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 8px 8px 0 0;
    z-index: 1;
}

.folder-body {
    position: absolute;
    top: 12%;
    left: 0;
    width: 100%;
    height: 88%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    padding: 10px;
}

.album-folder:hover .folder-body {
    box-shadow: var(--shadow-strong);
    transform: scale(1.02);
}

.folder-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    opacity: 0.9;
}

.folder-label {
    text-align: center;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.folder-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Scroll hint for many albums */
.albums-scroll-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 10px;
    opacity: 0.7;
    font-style: italic;
}

/* Album View */
.album-view {
    width: 100%;
    opacity: 1;
    transition: var(--transition-smooth);
    margin-top: -10px;
}

.album-view.hidden {
    display: none;
    opacity: 0;
}

.album-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.back-to-albums {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.back-to-albums:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

.album-title {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.album-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 0 20px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.album-photos-grid::-webkit-scrollbar {
    width: 8px;
}

.album-photos-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.album-photos-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.album-photo-item {
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    padding-bottom: 100%;
}

.album-photo-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.album-photo-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.album-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    pointer-events: auto;
}

.album-photo-item:hover .album-photo {
    transform: scale(1.1);
}

.album-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 15px 15px;
    transform: translateY(100%);
    transition: var(--transition-smooth);
}

.album-photo-item:hover .album-photo-overlay {
    transform: translateY(0);
}

.album-photo-caption {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
    color: white;
}

.album-photo-date,
.album-photo-location {
    font-size: 0.75rem;
    color: var(--accent-color);
    display: block;
}

@media (max-width: 768px) {
    .albums-wrapper::before,
    .albums-wrapper::after {
        width: 40px;
    }

    .album-folder {
        width: 160px;
    }

    .album-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        max-height: 50vh;
    }

    .album-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .album-title {
        font-size: 1.4rem;
    }
}
/* FIX: keep folder layout intact (video overlay must NOT change positioning) */
.folder-body { position: absolute; }         /* must stay absolute */
.album-photo-wrapper { position: absolute; }  /* already intended */
.lightbox-thumbnail { position: relative; }   /* safe to position for ::before/::after */

/* Move album view slightly up on mobile */
.album-view {
    margin-top: -10px;
}

@media (max-width: 768px) {
    .album-header {
        margin-bottom: 18px; /* was 30px */
    }
}
/* Reserve space so the close button never overlaps media inconsistently */
.lightbox-content {
    position: relative;
    padding-top: calc(52px + env(safe-area-inset-top));
}

/* Keep close button in a consistent spot (notch-safe) */
.lightbox-close {
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
}

/* Put audio control top-left (horizontal) */
#video-vol-wrap {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
}

/* Horizontal slider */
#video-volume {
    position: static;
    transform: none;
    width: 120px;
    height: 18px;
}

/* Fullscreen bottom-right */
#video-fullscreen {
    position: absolute;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    padding: 10px;
}
/* Prevent layout jump when quote card appears */
.love-quote-container {
    min-height: 180px; /* reserve room so page doesn't jump */
}


/* =========================================================
   iOS LIGHTBOX VIDEO UI FIXES (override)
   - No overlap between play and volume
   - Volume slider visible, horizontal
   - Fullscreen aligned with play row
   - Caption + counter moved to top (no clash)
========================================================= */

/* Let video UI position elements relative to the full media area */
.lightbox-media { position: relative; }

/* Make UI cover the whole media area so we can place top controls */
.video-ui {
    position: absolute;
    inset: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
}

/* Bottom bar stays at the bottom */
.video-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Progress stays above the bar */
.video-progress { margin-bottom: 10px; }

/* Buttons: consistent sizing and no weird glyph skew */
.video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
}

.video-btn svg {
    display: block;
    width: 22px;
    height: 22px;
}

/* Fullscreen: align in the same row (right side) */
#video-fullscreen {
    position: static !important;
    margin-left: auto;
}

/* Volume control: top-right, notch-safe, horizontal slider always visible */
#video-vol-wrap {
    position: absolute !important;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    left: auto !important;
    bottom: auto !important;

    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.18);
    z-index: 5;
}

/* Override the old vertical slider styling */
#video-volume,
.video-volume {
    position: static !important;
    transform: none !important;
    transform-origin: initial !important;

    width: 120px;
    height: 4px;
    appearance: none;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    outline: none;
}

#video-volume::-webkit-slider-thumb,
.video-volume::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-color);
}

/* Make sure the tap layer doesn't block the top volume control */
.video-tap-layer { z-index: 2; }
#video-vol-wrap { z-index: 6; }

/* -------- Caption + counter at top (no bottom clash on iOS) -------- */
.lightbox-content {
    position: relative;
}

/* Caption moves to top-center */
#lightbox-caption {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 6px 10px;
    max-width: min(75vw, 520px);
    font-size: 0.95rem;
    color: rgba(255,255,255,0.92);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    z-index: 6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Counter moves to top-left */
.lightbox-counter {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    color: rgba(255,255,255,0.92);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    padding: 6px 10px;
    z-index: 1100;
    font-size: 0.95rem;
}

/* Keep close button top-right and above caption */
.lightbox-close {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    z-index: 1200;
}


/* ================================
   iOS LIGHTBOX VIDEO UI FIXES (v3)
   - Volume wrap pinned top-right and ALWAYS shows slider
   - Only visible when video is active
   - Fullscreen icon alignment + no skew
================================ */
.lightbox-media:not(.is-video) #video-vol-wrap { display: none !important; }
.lightbox-media.is-video #video-vol-wrap { display: flex !important; }

#video-vol-wrap {
    position: absolute !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    right: calc(12px + env(safe-area-inset-right)) !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 8 !important;
}

/* Make the slider actually show on iOS Safari */
#video-volume {
    display: block !important;
    width: 120px !important;
    height: 4px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: rgba(255,255,255,0.25) !important;
    border-radius: 999px !important;
    outline: none !important;
    padding: 0 !important;
}

/* iOS track */
#video-volume::-webkit-slider-runnable-track {
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
}

/* iOS thumb */
#video-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--primary-color);
    margin-top: -5px; /* centers thumb on 4px track */
}

/* Fullscreen stays aligned in bottom row */
.video-bar { width: 100%; }
#video-fullscreen {
    position: static !important;
    margin-left: auto !important;
}

/* Ensure SVGs render crisp and not skewed */
.video-btn { transform: none !important; }
.video-btn svg { display: block; width: 22px; height: 22px; }

/* ================================
   HOTFIX: Lightbox UI (counter/caption) + video tap behavior
   - Removes the weird blurred bar on the left (was a fixed/blurred counter + inherited transforms)
   - Makes play/pause tap (middle of video) work reliably
   - Forces the volume slider to actually show (older .video-volume rule hid it)
================================ */

/* Counter: top-left, NOT blurred, NOT transformed, notch-safe */
.lightbox-counter{
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: calc(12px + env(safe-area-inset-left)) !important;
    right: auto !important;
    bottom: auto !important;

    transform: none !important;

    background: rgba(0,0,0,0.45) !important;
    backdrop-filter: none !important;

    border: 1px solid rgba(255,255,255,0.16) !important;
    border-radius: 999px !important;
    padding: 6px 10px !important;

    z-index: 1105 !important;
    font-size: 0.95rem !important;
}

/* Caption: top-center (so it never clashes with the counter or bottom controls) */
#lightbox-caption{
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    margin: 0 !important;

    color: rgba(255,255,255,0.92) !important;
    background: rgba(0,0,0,0.35) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;

    max-width: min(78vw, 520px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    z-index: 1105 !important;
    pointer-events: none !important;
}

/* Video UI: keep overlay visible, but do NOT steal taps in the middle.
   Buttons + slider still clickable. */
.video-ui{
    pointer-events: none !important;
}
.video-ui .video-progress,
.video-ui .video-bar,
.video-ui button,
.video-ui input{
    pointer-events: auto !important;
}

/* Volume: top-right, horizontal, and always visible when video is open */
#video-vol-wrap{
    position: absolute !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    right: calc(12px + env(safe-area-inset-right)) !important;
    left: auto !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    background: rgba(0,0,0,0.35) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    z-index: 1104 !important;
}

/* Older CSS in the file hid the slider via .video-volume { display:none }.
   Force it visible and iOS-stylable. */
#video-volume,
.video-volume{
    display: block !important;
    position: static !important;
    transform: none !important;
    width: 120px !important;
    height: 18px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
}

/* iOS/WebKit track/thumb */
#video-volume::-webkit-slider-runnable-track,
.video-volume::-webkit-slider-runnable-track{
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
}
#video-volume::-webkit-slider-thumb,
.video-volume::-webkit-slider-thumb{
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-color);
    margin-top: -4px;
}
#video-volume::-moz-range-track,
.video-volume::-moz-range-track{
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
}
#video-volume::-moz-range-thumb,
.video-volume::-moz-range-thumb{
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-color);
    border: none;
}

/* ================================
   LIGHTBOX HEADER (counter + caption) - v5 tweaks
   - Prevent collisions on long captions
   - Bring back pink coloring
================================ */
.lightbox-counter{
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: calc(12px + env(safe-area-inset-left)) !important;
    transform: none !important;
    background: rgba(255, 105, 180, 0.16) !important;
    border: 1px solid rgba(255, 105, 180, 0.45) !important;
    color: #fff !important;
    box-shadow: 0 8px 30px rgba(255, 105, 180, 0.25) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-counter #lightbox-current,
.lightbox-counter #lightbox-total{
    color: #fff !important;
}

/* Caption bubble sits BELOW the counter row to avoid overlap
   - Wraps to multiple lines (no truncation)
   - Keeps pink styling
*/
#lightbox-caption{
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top) + 46px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    max-width: min(820px, calc(100vw - 120px)) !important; /* leave room for close button */
    padding: 10px 16px !important;

    background: rgba(255, 105, 180, 0.12) !important;
    border: 1px solid rgba(255, 105, 180, 0.35) !important;
    border-radius: 18px !important;

    color: #ffd1ea !important;
    font-weight: 600 !important;
    text-shadow: 0 0 20px rgba(255,105,180,0.25);

    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;

    z-index: 1050 !important;
    pointer-events: none; /* don't steal taps from the video */
}


/* ================================
   LIGHTBOX HEADER LAYOUT OVERRIDES
   (prevent caption/counter collisions, wrap long captions)
================================ */


/* Reserve a header band so caption never overlaps the media */
.lightbox-content{
    padding-top: calc(160px + env(safe-area-inset-top)) !important;
}

/* Counter: fixed top-left, no transform (prevents the weird left blur) */
.lightbox-counter{
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: calc(12px + env(safe-area-inset-left)) !important;
    transform: none !important;

    padding: 10px 14px !important;
    border-radius: 999px !important;

    background: rgba(255, 105, 180, 0.14) !important;
    border: 1px solid rgba(255, 105, 180, 0.35) !important;
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.18) !important;

    color: #fff !important;
    font-weight: 700 !important;
}

/* Caption: fixed on its own row below the counter, wraps instead of truncating */
#lightbox-caption{
    position: fixed !important;
    top: calc(62px + env(safe-area-inset-top)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    max-width: min(94vw, 760px) !important;
    padding: 12px 18px !important;
    border-radius: 18px !important;

    background: rgba(255, 105, 180, 0.12) !important;
    border: 1px solid rgba(255, 105, 180, 0.32) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.28), 0 6px 18px rgba(255, 105, 180, 0.16) !important;

    color: #fff !important;
    font-size: 1.02rem !important;
    line-height: 1.25 !important;
    text-align: center !important;

    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;

    pointer-events: none !important; /* never block tap-to-play */
}

/* Dynamic sizing for long captions */
#lightbox-caption.cap-long{
    font-size: 0.95rem !important;
    max-width: min(96vw, 860px) !important; /* more horizontal room */
}

#lightbox-caption.cap-xlong{
    font-size: 0.86rem !important;
    max-width: min(96vw, 980px) !important;
}

/* Small screens: keep it readable and reduce header band */
@media (max-width: 480px){
    .lightbox-content{
        padding-top: calc(178px + env(safe-area-inset-top)) !important;
    }
    #lightbox-caption{
        max-width: calc(100vw - 24px) !important;
        padding: 10px 14px !important;
        font-size: 0.96rem !important;
    }
    #lightbox-caption.cap-long{ font-size: 0.90rem !important; }
    #lightbox-caption.cap-xlong{ font-size: 0.82rem !important; }
}

/* --- LIGHTBOX: caption directly above media (flow layout), keep media centered --- */

/* Ensure the lightbox content is a vertical stack and centered */
.lightbox-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: calc(12px + env(safe-area-inset-top)) !important; /* small top padding only */
}

/* Media stays centered and can be large */
.lightbox-media {
    order: 2 !important;
    position: relative !important;
    width: min(92vw, 980px) !important;
    max-height: 80vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
}

/* Caption becomes a real block above the media (no absolute positioning) */
#lightbox-caption {
    order: 1 !important;

    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    translate: none !important;

    margin: 0 0 12px 0 !important; /* THIS is how “low/high” it sits above the image */
    max-width: min(92vw, 680px) !important;
    padding: 10px 16px !important;
    border-radius: 999px !important;

    background: rgba(255, 105, 180, 0.16) !important;
    border: 1px solid rgba(255, 105, 180, 0.45) !important;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.20) !important;

    color: #ffd6ea !important;
    font-weight: 600 !important;
    text-align: center !important;

    /* allow long captions to wrap nicely */
    white-space: normal !important;
    line-height: 1.25 !important;

    /* do NOT block tap-to-play */
    pointer-events: none !important;
}

/* Counter stays top-left of the screen and doesn't collide */
.lightbox-counter {
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: calc(12px + env(safe-area-inset-left)) !important;
    z-index: 3000 !important;
}

/* IMPORTANT: revert any previous "fit-content/inline-flex" hacks */
.lightbox-media {
    width: min(92vw, 980px) !important;
}
/* ===== Video thumbnail play badge (no emoji) ===== */
.album-photo-wrapper.is-video::after,
.gallery-image-wrapper.is-video::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 999px;

    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);

    /* triangle "play" icon using SVG mask */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;

    /* icon color (mask uses background-color) */
    background-color: rgba(255, 105, 180, 0.85);

    z-index: 5;
    pointer-events: none;
}
/* ---- FIX album grid gap: restore absolute wrapper for square tiles ---- */
.album-photo-wrapper{
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.album-photo{
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Keep gallery wrapper relative if you want (safe) */
.gallery-image-wrapper { position: relative; }
.album-photo-overlay { display: none !important; }
