/* ====================================================
   Lavi Olami Vision - 3D Interactive Booklet & Flipbook
   ==================================================== */

/* Interactive 3D Square Book Stage (Hero Left Column) */
.booklet-3d-stage {
    perspective: 1800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px 18px;
}

.booklet-3d-trigger {
    position: relative;
    width: min(370px, 78vw);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: rotateY(-20deg) rotateX(6deg);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    animation: bookletFloat 5.5s ease-in-out infinite;
    background: none;
    border: none;
    padding: 0;
    text-align: start;
}

[dir="ltr"] .booklet-3d-trigger {
    transform: rotateY(20deg) rotateX(6deg);
}

.booklet-3d-trigger:hover,
.booklet-3d-trigger:focus-visible {
    animation-play-state: paused;
    transform: rotateY(-8deg) rotateX(2deg) scale(1.03);
    outline: none;
}

[dir="ltr"] .booklet-3d-trigger:hover,
[dir="ltr"] .booklet-3d-trigger:focus-visible {
    transform: rotateY(8deg) rotateX(2deg) scale(1.03);
}

@keyframes bookletFloat {
    0%, 100% {
        transform: rotateY(-20deg) rotateX(6deg) translateY(0px);
    }
    50% {
        transform: rotateY(-16deg) rotateX(4deg) translateY(-8px);
    }
}

[dir="ltr"] .booklet-3d-trigger {
    animation-name: bookletFloatLtr;
}

@keyframes bookletFloatLtr {
    0%, 100% {
        transform: rotateY(20deg) rotateX(6deg) translateY(0px);
    }
    50% {
        transform: rotateY(16deg) rotateX(4deg) translateY(-8px);
    }
}

/* Interior Base Page visible when cover slightly lifts on hover */
.booklet-3d-underpage {
    position: absolute;
    inset: 3px;
    background: #F8FAFC;
    border-radius: 4px 10px 10px 4px;
    transform: translateZ(-2px);
    box-shadow: 0 22px 42px rgba(6, 21, 43, 0.22);
    overflow: hidden;
}

.booklet-3d-underpage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.96;
}

/* 3D Stacked Paper Thickness Edges */
.booklet-3d-edges {
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: -14px;
    width: 16px;
    background: repeating-linear-gradient(
        to right,
        #FFFFFF 0px,
        #FFFFFF 2px,
        #CBD5E1 2px,
        #CBD5E1 3px
    );
    transform: rotateY(90deg) translateZ(-7px);
    transform-origin: left center;
    border-radius: 0 3px 3px 0;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: inset 0 0 6px rgba(15, 23, 42, 0.16);
}

/* 3D Spine */
.booklet-3d-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    width: 18px;
    background: linear-gradient(90deg, #071930 0%, #10325C 60%, #C5A059 95%, #8D6E2E 100%);
    transform: rotateY(-90deg) translateZ(8px);
    transform-origin: right center;
    border-radius: 4px 0 0 4px;
}

/* Front Cover */
.booklet-3d-cover {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 4px 10px 10px 4px;
    overflow: hidden;
    transform-origin: left center;
    transform: translateZ(8px);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    box-shadow:
        0 22px 42px rgba(6, 21, 43, 0.26),
        inset 3px 0 10px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(6, 21, 43, 0.14);
}

.booklet-3d-trigger:hover .booklet-3d-cover {
    transform: translateZ(8px) rotateY(-14deg);
    box-shadow:
        16px 26px 48px rgba(6, 21, 43, 0.32),
        inset 5px 0 14px rgba(0, 0, 0, 0.26),
        0 0 0 1.5px rgba(197, 160, 89, 0.65);
}

.booklet-3d-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Subtle Realistic Print Paper Sheen */
.booklet-3d-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.03) 35%,
        rgba(0, 0, 0, 0) 60%,
        rgba(0, 0, 0, 0.12) 100%
    );
    pointer-events: none;
}

/* Floating CTA Pill on the Cover */
.booklet-3d-pill {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateZ(20px);
    background: rgba(6, 21, 43, 0.92);
    color: #F3D99B;
    border: 1.5px solid #C5A059;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(6, 21, 43, 0.32);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 4;
}

.booklet-3d-trigger:hover .booklet-3d-pill {
    background: #C5A059;
    color: #06152B;
    transform: translateX(-50%) translateZ(28px) scale(1.05);
}

.booklet-shadow-floor {
    width: min(300px, 66vw);
    height: 20px;
    margin-top: 16px;
    background: radial-gradient(ellipse at center, rgba(6, 21, 43, 0.24) 0%, transparent 72%);
    filter: blur(4px);
    pointer-events: none;
}

/* ====================================================
   Movement Film Section - Clean Editorial Cinema Design
   ==================================================== */
.film-editorial-section {
    background: #FFFFFF;
    padding: 76px 0;
    border-bottom: 1px solid #E2E8F0;
}

.film-editorial-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.35fr;
    gap: 52px;
    align-items: center;
}

.film-editorial-rule {
    width: 44px;
    height: 2px;
    background: #C5A059;
    margin-bottom: 16px;
}

.film-editorial-kicker {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748B;
    margin-bottom: 10px;
}

.film-editorial-title {
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    font-weight: 800;
    color: #06152B;
    line-height: 1.24;
    margin-bottom: 16px;
}

.film-editorial-desc {
    font-size: 1.06rem;
    line-height: 1.72;
    color: #475569;
    margin-bottom: 26px;
}

.film-editorial-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #06152B;
    color: #FFFFFF;
    border: 1px solid #06152B;
    border-radius: 4px;
    font-size: 0.96rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.film-editorial-btn:hover {
    background: #0E2A4D;
    border-color: #0E2A4D;
}

.film-editorial-btn svg {
    width: 14px;
    height: 14px;
    fill: #C5A059;
}

.film-cinema-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: #0B1220;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 22px 46px -16px rgba(6, 21, 43, 0.22);
    cursor: pointer;
}

.film-cinema-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease;
}

.film-cinema-frame:hover video {
    transform: scale(1.02);
}

.film-cinema-scrim {
    position: absolute;
    inset: 0;
    background: rgba(6, 21, 43, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease;
}

.film-cinema-frame:hover .film-cinema-scrim {
    background: rgba(6, 21, 43, 0.26);
}

.film-play-circle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(6, 21, 43, 0.12);
    box-shadow: 0 10px 26px rgba(6, 21, 43, 0.26);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease;
}

.film-cinema-frame:hover .film-play-circle {
    transform: scale(1.08);
    background: #FFFFFF;
}

.film-play-circle svg {
    width: 24px;
    height: 24px;
    fill: #06152B;
    margin-left: 3px;
}

@media (max-width: 992px) {
    .film-editorial-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .film-editorial-section {
        padding: 54px 0;
    }
}

/* ====================================================
   Interactive Flipbook Popup Modal (#bookletModal)
   ==================================================== */
.booklet-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 13, 26, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.booklet-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.booklet-modal-shell {
    width: min(96vw, 1320px);
    height: min(94dvh, 880px);
    height: min(94vh, 880px);
    background: #08182E;
    border: 1.5px solid rgba(197, 160, 89, 0.55);
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.booklet-modal-backdrop.active .booklet-modal-shell {
    transform: scale(1);
}

/* Top Toolbar */
.booklet-topbar {
    background: #051122;
    border-bottom: 1px solid rgba(197, 160, 89, 0.35);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.booklet-topbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.booklet-topbar-title h3 {
    color: #F3D99B;
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booklet-page-badge {
    background: rgba(197, 160, 89, 0.18);
    border: 1px solid rgba(197, 160, 89, 0.45);
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.booklet-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.booklet-tool-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    height: 36px;
    padding: 0 11px;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.booklet-tool-btn:hover,
.booklet-tool-btn.active {
    background: #C5A059;
    color: #06152B;
    border-color: #C5A059;
}

.booklet-close-btn {
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.booklet-close-btn:hover {
    background: #EF4444;
    color: #FFFFFF;
}

/* Main Flipbook Reading Stage */
.booklet-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: radial-gradient(circle at center, #112C4E 0%, #071427 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 18px 58px;
    user-select: none;
}

.booklet-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.booklet-viewport.is-zoomed {
    align-items: flex-start;
    justify-content: flex-start;
    cursor: grab;
}

.booklet-book-wrap {
    perspective: 2200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    transform-origin: center center;
    margin: auto;
}

/* Force LTR inside the physical English book spread so Page 2 sits Left & Page 3 sits Right */
.booklet-book {
    direction: ltr;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.15);
    transform-style: preserve-3d;
}

.booklet-book.is-single {
    height: min(68vh, 68vw, 660px);
    width: min(68vh, 68vw, 660px);
}

.booklet-book.is-spread {
    height: min(67vh, 42vw, 640px);
    width: calc(min(67vh, 42vw, 640px) * 2);
}

.booklet-page-slot {
    position: relative;
    flex: 1 1 50%;
    height: 100%;
    background: #FFFFFF;
    overflow: hidden;
    cursor: pointer;
}

.booklet-book.is-single .booklet-page-slot {
    flex: 1 1 100%;
}

.booklet-page-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* Center Book Spine Shadow on Spread */
.booklet-book.is-spread::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 34px;
    transform: translateX(-50%);
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.14) 38%,
        rgba(0, 0, 0, 0.28) 50%,
        rgba(0, 0, 0, 0.12) 62%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    z-index: 4;
}

/* 3D Page Flipping Leaf Animation Layer */
.booklet-flip-leaf {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 8;
}

.booklet-flip-leaf.flip-from-right {
    right: 0;
    transform-origin: left center;
    animation: flipPageNext 0.52s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.booklet-flip-leaf.flip-from-left {
    left: 0;
    transform-origin: right center;
    animation: flipPagePrev 0.52s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.booklet-flip-leaf.flip-single-next {
    inset: 0;
    width: 100%;
    transform-origin: left center;
    animation: flipSingleNext 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.booklet-flip-leaf.flip-single-prev {
    inset: 0;
    width: 100%;
    transform-origin: right center;
    animation: flipSinglePrev 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.booklet-flip-face {
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.booklet-flip-face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.booklet-flip-back {
    transform: rotateY(180deg);
}

@keyframes flipPageNext {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); }
}

@keyframes flipPagePrev {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(180deg); }
}

@keyframes flipSingleNext {
    0% { transform: rotateY(0deg); opacity: 1; }
    100% { transform: rotateY(-95deg); opacity: 0.15; }
}

@keyframes flipSinglePrev {
    0% { transform: rotateY(0deg); opacity: 1; }
    100% { transform: rotateY(95deg); opacity: 0.15; }
}

/* Floating Stage Navigation Arrows */
.booklet-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(5, 17, 34, 0.86);
    border: 1.5px solid rgba(197, 160, 89, 0.6);
    color: #F3D99B;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.booklet-nav-arrow:hover:not(:disabled) {
    background: #C5A059;
    color: #06152B;
    transform: translateY(-50%) scale(1.08);
}

.booklet-nav-arrow:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.booklet-arrow-left {
    left: 12px;
}

.booklet-arrow-right {
    right: 12px;
}

/* Thumbnails Drawer */
.booklet-thumbs-drawer {
    display: none;
    background: #061325;
    border-top: 1px solid rgba(197, 160, 89, 0.25);
    padding: 10px 16px;
    gap: 10px;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.booklet-thumbs-drawer.open {
    display: flex;
}

.booklet-thumb-btn {
    flex: 0 0 auto;
    width: 66px;
    background: none;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.18s ease;
}

.booklet-thumb-btn img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.booklet-thumb-btn span {
    font-size: 0.72rem;
    color: #94A3B8;
    font-weight: 700;
}

.booklet-thumb-btn.active {
    border-color: #C5A059;
    background: rgba(197, 160, 89, 0.15);
}

.booklet-thumb-btn.active span {
    color: #F3D99B;
}

/* Bottom Controls & Scrubber */
.booklet-bottombar {
    background: #051122;
    border-top: 1px solid rgba(197, 160, 89, 0.35);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}

.booklet-step-btn {
    background: rgba(197, 160, 89, 0.16);
    border: 1px solid rgba(197, 160, 89, 0.45);
    color: #F3D99B;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.booklet-step-btn:hover:not(:disabled) {
    background: #C5A059;
    color: #06152B;
}

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

.booklet-scrubber-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.booklet-chapter-caption {
    font-size: 0.82rem;
    color: #CBD5E1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.booklet-range {
    width: min(360px, 100%);
    accent-color: #C5A059;
    cursor: pointer;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .booklet-mode-toggle {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .booklet-modal-backdrop {
        padding: 0;
    }
    .booklet-modal-shell {
        width: 100vw;
        height: 100dvh;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .booklet-topbar {
        padding: 8px 10px;
    }
    .booklet-topbar-title h3 {
        font-size: 0.92rem;
    }
    .booklet-hide-mobile {
        display: none !important;
    }
    .booklet-stage {
        padding: 12px 10px;
    }
    .booklet-book.is-single,
    .booklet-book.is-spread {
        width: min(92vw, 66dvh);
        height: min(92vw, 66dvh);
    }
    .booklet-nav-arrow {
        display: none;
    }
    .booklet-bottombar {
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .booklet-step-btn {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .booklet-topbar-title h3 {
        display: none;
    }
    .booklet-tool-btn {
        height: 34px;
        padding: 0 8px;
        font-size: 0.78rem;
    }
    .booklet-close-btn {
        width: 34px;
        height: 34px;
    }
}
