/* ==========================================================================
   Design System & Variables - Immersive Gallery
   ========================================================================== */
:root {
    /* Colors */
    --clr-lagoon: #00b4d8;
    --clr-lagoon-light: #90e0ef;
    --clr-pine: #1b4332;
    --clr-sand: #f8f9fa;
    --clr-coral: #ff7b54;
    --clr-dark: #0f172a;
    --clr-text: #334155;
    --clr-text-light: #64748b;
    --clr-white: #ffffff;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--clr-dark);
    color: var(--clr-white);
    overflow: hidden;
    /* Prevent normal scrolling, container handles it */
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    line-height: 1.1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ==========================================================================
   Navigation Overlay
   ========================================================================== */
.gallery-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
    /* Let clicks pass through except on children */
}

.gallery-nav>* {
    pointer-events: auto;
    /* Re-enable clicks on children */
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-brand i {
    color: var(--clr-coral);
    font-size: 1.8rem;
}

/* Scroll Indicators (Dots) */
.nav-indicators {
    display: flex;
    gap: 1rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.indicator-dot.active {
    background-color: var(--clr-white);
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn-primary {
    background-color: var(--clr-coral);
    color: var(--clr-white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 123, 84, 0.4);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 123, 84, 0.6);
    background-color: #ff6535;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-outline-white {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: 2px solid var(--clr-white);
    color: var(--clr-white);
    border-radius: 50px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-outline-white:hover {
    background-color: var(--clr-white);
    color: var(--clr-dark);
}

/* ==========================================================================
   Scroll Snapping Structure
   ========================================================================== */
.gallery-container {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Hide scrollbar for a cleaner look */
.gallery-container::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.gallery-slide {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    /* Prevent edges during animation */
    transition: transform 10s ease-out;
}

/* Subtle zoom effect when slide is active (managed by JS) */
.gallery-slide.is-visible .slide-bg {
    transform: scale(1);
}

/* Overlays to ensure text readability */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.2) 50%, rgba(15, 23, 42, 0.5) 100%);
    z-index: 2;
}

.slide-overlay-darker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2;
}

.slide-overlay-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
    z-index: 2;
}

/* ==========================================================================
   Typography & Content within Slides
   ========================================================================== */
.slide-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: 0.3s;
}

.gallery-slide.is-visible .slide-content {
    opacity: 1;
    transform: translateY(0);
}

.slide-content.right-align {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.slide-content.left-align {
    text-align: left;
    max-width: 800px;
    margin-left: 5%;
}

.slide-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.slide-title {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.slide-title strong {
    color: var(--clr-lagoon-light);
}

.slide-description {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 300;
    max-width: 600px;
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
}

.right-align .slide-description {
    max-width: 500px;
}

/* Scroll Prompt Animation */
.scroll-prompt {
    position: absolute;
    bottom: -15vh;
    /* Push it down near the very bottom */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.scroll-prompt span {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-prompt i {
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* ==========================================================================
   PhotoBooth Section
   ========================================================================== */
.photobooth-slide {
    flex-direction: column;
    justify-content: center;
}

.photobooth-overlay {
    background: rgba(15, 23, 42, 0.85);
    /* Darker for the app interface */
}

.photobooth-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: var(--shadow-lg);

    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.gallery-slide.is-visible .photobooth-container {
    opacity: 1;
    transform: translateY(0);
}

.photobooth-header {
    text-align: center;
}

.photobooth-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--clr-coral);
}

.photobooth-workspace {
    display: flex;
    gap: 3rem;
    align-items: stretch;
}

/* Controls */
.photobooth-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--clr-lagoon-light);
}

.bg-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.bg-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.bg-thumb:hover {
    transform: scale(1.05);
}

.bg-thumb.active {
    border-color: var(--clr-coral);
    box-shadow: 0 0 10px rgba(255, 123, 84, 0.5);
}

.file-input {
    display: none;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.btn-upload:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--clr-white);
}

.hint {
    color: var(--clr-text-light);
    font-size: 0.85rem;
}

.zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zoom-controls input[type="range"] {
    width: 100%;
    accent-color: var(--clr-coral);
}

/* Preview Area */
.photobooth-preview {
    flex: 1.5;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#preview-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#user-photo-wrapper {
    position: absolute;
    z-index: 2;
    cursor: grab;
    transform-origin: center center;
}

#user-photo-wrapper.hidden {
    display: none;
}

#user-photo-wrapper:active {
    cursor: grabbing;
}

#user-photo {
    display: block;
    max-width: 300px;
    /* Base constraint for initial load */
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    /* Makes the person pop slightly from background */
}

.postcard-stamp {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 3;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--clr-white);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.slide-footer {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.footer-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--clr-white);
    text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .photobooth-workspace {
        flex-direction: column;
    }

    .photobooth-preview {
        min-height: 300px;
    }

    .nav-indicators {
        display: none;
        /* Hide dots on very small screens */
    }
}

@media (max-width: 600px) {
    .slide-title {
        font-size: 2.5rem;
    }

    .slide-content {
        text-align: center;
        align-items: center;
    }

    .slide-content.left-align,
    .slide-content.right-align {
        margin: 0;
        text-align: center;
        align-items: center;
        max-width: 100%;
    }

    .slide-overlay-left {
        width: 100%;
        background: rgba(15, 23, 42, 0.5);
    }

    .photobooth-container {
        padding: 1.5rem;
    }
}