/* ================================================
   FLIP BOOK — Premium Cinematic Gallery
   ================================================ */

/* === Layout === */
.flipbook-section {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    padding: 0;
    overflow: hidden;
}

.flipbook-viewer {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* === Slides === */
.flipbook-canvas {
    position: relative;
    width: 100%;
    height: 100%;
}

.flipbook-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1.08);
    will-change: opacity, transform;
}

.flipbook-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.flipbook-slide.exiting {
    opacity: 0;
    visibility: visible;
    transform: scale(0.96);
    z-index: 1;
}

.flipbook-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* === Ken Burns (subtle zoom animation on active slide) === */
.flipbook-slide.active img {
    animation: kenBurns 6s ease-in-out forwards;
}

@keyframes kenBurns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.06); }
}

/* === Navigation Zones === */
.flipbook-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
    cursor: pointer;
}

.flipbook-nav--prev {
    left: 0;
    cursor: w-resize;
}

.flipbook-nav--next {
    right: 0;
    cursor: e-resize;
}

/* Hover feedback — subtle vignette */
.flipbook-nav--prev:hover ~ .flipbook-canvas .flipbook-slide.active::after,
.flipbook-nav--next:hover ~ .flipbook-canvas .flipbook-slide.active::after {
    opacity: 1;
}

.flipbook-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.flipbook-nav--prev:hover ~ .flipbook-canvas .flipbook-slide.active::after {
    background: linear-gradient(90deg, rgba(0,0,0,0.15) 0%, transparent 40%);
}

.flipbook-nav--next:hover ~ .flipbook-canvas .flipbook-slide.active::after {
    background: linear-gradient(-90deg, rgba(0,0,0,0.15) 0%, transparent 40%);
}

/* === Progress Bar === */
.flipbook-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 20;
}

.flipbook-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary, #E6B17E), #fff);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* Animate progress bar when playing */
.flipbook-viewer.playing .flipbook-progress-bar {
    animation: progressFill 5s linear forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* === Counter === */
.flipbook-counter {
    position: absolute;
    bottom: 24px;
    right: 32px;
    z-index: 20;
    font-family: var(--font-main, 'Outfit', sans-serif);
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
}

.flipbook-counter-sep {
    margin: 0 4px;
    opacity: 0.5;
}

/* === Pause Indicator === */
.flipbook-pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 25;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    pointer-events: none;
}

.flipbook-pause-indicator.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* === Overlay Text === */
.flipbook-overlay-text {
    position: absolute;
    bottom: 60px;
    left: 32px;
    z-index: 20;
    pointer-events: none;
}

.flipbook-tagline {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 1s ease 1s forwards;
}

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

/* === Dot indicators (optional, on top) === */
.flipbook-dots {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 6px;
}

.flipbook-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.flipbook-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.4);
}

/* === Responsive === */
@media (max-width: 768px) {
    .flipbook-counter {
        bottom: 16px;
        right: 16px;
        font-size: 0.75rem;
    }

    .flipbook-overlay-text {
        bottom: 44px;
        left: 16px;
    }

    .flipbook-tagline {
        font-size: 0.9rem;
    }

    .flipbook-pause-indicator {
        width: 48px;
        height: 48px;
    }

    .flipbook-pause-indicator svg {
        width: 18px;
        height: 18px;
    }
}
