/*
 * Behind the Scenes Page Styles
 * Matching Figma design with tabbed sections
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */

.bts-page {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.bts-header {
    position: fixed;
    top: 35px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0;
}

.bts-header .header-content {
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.2);
    padding: 18px 34px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bts-header .header-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 1.2px;
    color: var(--color-primary, #1d5037);
}

.bts-header .site-title {
    font-family: 'Courier New', monospace;
    font-size: 30px;
    line-height: 36px;
    color: var(--color-primary, #1d5037);
    margin: 0;
    text-decoration: none;
}

.bts-header .header-button {
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.2);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary, #1d5037);
    flex-shrink: 0;
    align-self: flex-start;
}

/* Tab Navigation */
.bts-nav {
    position: fixed;
    top: 175px;
    left: 34px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bts-nav-btn {
    display: block;
    padding: 22px 26px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-decoration: none;
    border: 2px solid var(--color-primary, #1d5037);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bts-nav-btn:not(.active) {
    background: var(--color-bg-cream, #fcfaf1);
    color: var(--color-primary, #1d5037);
}

.bts-nav-btn.active {
    background: var(--color-primary, #1d5037);
    color: var(--color-bg-cream, #fcfaf1);
}

.bts-nav-btn:hover:not(.active) {
    background: var(--color-note, #e5e8a7);
}

/* Content Sections */
.bts-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.bts-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    z-index: 1;
}

.bts-section.active {
    pointer-events: auto;
    z-index: 2;
}

#tips-section {
    background-image: url('../assets/specimen-background.svg');

}

#tools-section {
    background-image: url('../assets/specimen-background.svg');

}

#videos-section {
    background-image: url('../assets/bts-videos-bg.svg');

}

/* ============================================
   TOP TIPS - BOOK STYLE (CodePen CSS-only flip)
   Based on: https://codepen.io/diemoritat/pen/LKROYZ
   Maintains original Figma design for tip cards
   ============================================ */

.tips-book-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 150px 280px 100px 280px;
    overflow: hidden;
}

/* Prevent scrollbar flash during page flip animation */
#tips-section {
    overflow: hidden;
}

/* Cover wrapper - creates the shadow */
.cover {
    width: 1136px;
    height: 817px;
    box-shadow: 30px 16px 4px 0px rgba(0, 0, 0, 0.25),
                -19px 16px 4px 0px rgba(0, 0, 0, 0.25);
}

/* Book container - flexbox layout with perspective */
.book {
    width: 100%;
    height: 100%;
    display: flex;
    perspective: 1200px;
}

/* Base page styling */
.book__page {
    position: relative;
    width: 50%;
    height: 100%;
    transform: rotateY(0deg);
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: 0% 0%;
    background-color: var(--color-note, #e5e8a7);
    background-image: linear-gradient(90deg, rgba(180,182,130,1) 0%, rgba(229,232,167,0) 18%);
}

/* Left page gradient goes other direction */
.book__page:nth-of-type(1) {
    background-image: linear-gradient(-90deg, rgba(180,182,130,1) 0%, rgba(229,232,167,0) 18%);
}

/* Page 1 - Left static page */
.book__page--1 {
    cursor: pointer;
    overflow: hidden;
    border-right: 6px solid #d3d59c;
}

/* Page 2 - The flipping page (has front and back) */
.book__page--2 {
    position: absolute;
    right: 0;
    pointer-events: none;
    transform-style: preserve-3d;
    background-color: var(--color-note, #e5e8a7);
    background-image: linear-gradient(90deg, rgba(180,182,130,1) 0%, rgba(229,232,167,0) 18%);
}

/* Page 4 - Right static page (visible when book closed) */
.book__page--4 {
    cursor: pointer;
    box-shadow: 9px 6px 4px 0px rgba(0, 0, 0, 0.25);
}

/* Front of flipping page */
.book__page-front {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotateY(0deg) translateZ(1px);
    backface-visibility: hidden;
    background-color: var(--color-note, #e5e8a7);
    border-right: 6px solid #d3d59c;
}

/* Back of flipping page */
.book__page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg) translateZ(1px);
    backface-visibility: hidden;
    background-color: var(--color-note, #e5e8a7);
    box-shadow: 9px 6px 4px 0px rgba(0, 0, 0, 0.25);
}

/* Hidden radio inputs for page state */
.book input[type="radio"] {
    display: none;
}

/* THE MAGIC: When radio is checked, flip the page */
.book input[type="radio"]:checked + .book__page {
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform: rotateY(-180deg);
}

/* ===========================================
   TIP CARD STYLING (Original Figma Design)
   =========================================== */

.tip-card {
    width: 100%;
    height: 100%;
    background: var(--color-note, #e5e8a7);
    padding: 21px;
    display: flex;
    flex-direction: column;
    gap: 47px;
    justify-content: flex-end;
    padding-bottom: 59px;
}

/* Right page layout - content on top, image below */
.tip-card.right-layout {
    justify-content: flex-start;
    padding-top: 59px;
    padding-bottom: 21px;
}

.tip-image {
    width: 100%;
    aspect-ratio: 174 / 181;
    overflow: hidden;
}

.tip-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tip-image.placeholder {
    background: linear-gradient(135deg, #c9d4a0 0%, #a8b88a 100%);
    border: 2px dashed var(--color-primary, #1d5037);
}

.tip-content {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.tip-number-badge {
    width: 38px;
    height: 38px;
    background: var(--color-primary, #1d5037);
    border: 2px solid var(--color-primary, #1d5037);
    color: var(--color-bg-cream, #fcfaf1);
    font-family: 'Courier New', monospace;
    font-size: 19px;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tip-text {
    flex: 1;
}

.tip-title {
    font-family: 'Courier New', monospace;
    font-size: 19px;
    line-height: 28px;
    color: var(--color-primary, #1d5037);
    margin: 0 0 5px 0;
}

.tip-description {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 23px;
    letter-spacing: -0.18px;
    color: var(--color-primary, #1d5037);
}

.tip-description p {
    margin: 0;
}

/* Hint text below book */
.book-hint {
    margin-top: 30px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--color-primary, #1d5037);
    opacity: 0.7;
}

.book-hint span {
    background: var(--color-bg-cream, #fcfaf1);
    padding: 8px 16px;
    border: 1px solid var(--color-primary, #1d5037);
}

/* ============================================
   TOOLS OF THE TRADE - POLAROIDS
   ============================================ */

.tools-container {
    min-height: 100vh;
    padding: 150px 50px 50px 280px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.polaroids-scatter {
    position: relative;
    width: 1600px;
    height: 800px;
    pointer-events: none;
}

.polaroid {
    position: absolute;
    background: var(--color-bg-cream, #fcfaf1);
    border: 1.5px solid var(--color-primary, #1d5037);
    padding: 12px 12px 8px 12px;
    transform: rotate(var(--rotation, 0deg));
    box-shadow: -5px 6px 3px 0px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    pointer-events: auto;
}

.polaroid[data-tool="0"]:hover {
    transform: translate(calc(-50% - 393px), calc(-50% - 150px)) rotate(var(--rotation, 0deg)) scale(1.05);
    z-index: 100;
}

.polaroid[data-tool="1"]:hover {
    transform: translate(calc(-50% + 382px), calc(-50% - 155px)) rotate(var(--rotation, 0deg)) scale(1.05);
    z-index: 100;
}

.polaroid[data-tool="2"]:hover {
    transform: translate(calc(-50% - 62px), calc(-50% + 65px)) rotate(var(--rotation, 0deg)) scale(1.05);
    z-index: 100;
}

.polaroid[data-tool="3"]:hover {
    transform: translate(calc(-50% - 295px), calc(-50% + 192px)) rotate(var(--rotation, 0deg)) scale(1.05);
    z-index: 100;
}

.polaroid[data-tool="4"]:hover {
    transform: translate(calc(-50% + 198px), calc(-50% + 127px)) rotate(var(--rotation, 0deg)) scale(1.05);
    z-index: 100;
}

/* Polaroid positions - matching Figma exactly */
/* Figma design center point for checklist: ~988px horizontal */
/* mattock - biggest, left side (Geological Hammers in Figma) */
.polaroid[data-tool="0"] {
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% - 393px), calc(-50% - 150px)) rotate(var(--rotation, 0deg));
    width: 438px;
    z-index: 40;
}

/* Geological Hammer - top right (Brushes in Figma) */
.polaroid[data-tool="1"] {
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% + 382px), calc(-50% - 155px)) rotate(var(--rotation, 0deg));
    width: 370px;
    z-index: 30;
}

/* Brushes & Dental Picks - middle right (Safety Goggles in Figma) */
.polaroid[data-tool="2"] {
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% - 62px), calc(-50% + 65px)) rotate(var(--rotation, 0deg));
    width: 272px;
    z-index: 60;
}

/* Safety Goggles & Gloves - bottom left (Collection Bags in Figma) */
.polaroid[data-tool="3"] {
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% - 295px), calc(-50% + 192px)) rotate(var(--rotation, 0deg));
    width: 269px;
    z-index: 20;
}

/* Field Notebook & Camera - bottom right (Field Notebook in Figma) */
.polaroid[data-tool="4"] {
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% + 198px), calc(-50% + 127px)) rotate(var(--rotation, 0deg));
    width: 351px;
    z-index: 10;
}

.polaroid-image {
    width: 100%;
    aspect-ratio: 1 / 0.8;
    border: 1.5px solid var(--color-primary, #1d5037);
    overflow: hidden;
}

.polaroid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.polaroid-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d4c4a8 0%, #c9b896 100%);
}

.polaroid-caption {
    font-family: 'Delius Unicase', cursive, 'Comic Sans MS', sans-serif;
    font-size: 19px;
    text-align: center;
    color: #000;
    margin: 15px 0 5px 0;
    letter-spacing: 0.8px;
}

/* Tools Checklist */
.tools-checklist {
    position: absolute;
    left: 50%;
    top: 50%;
    /* Account for 280px left padding - 50px right padding = 230px offset, so shift left by 115px to true center */
    transform: translate(calc(-50% + 115px), calc(-50% - 200px));
    width: 437px;
    background: var(--color-note, #e5e8a7);
    border: 1.7px solid var(--color-primary, #1d5037);
    padding: 22px;
    box-shadow: 20px 3px 3px 0px rgba(0, 0, 0, 0.25),
        -12px 7px 3px 0px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.checklist-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.checklist-item:last-child {
    margin-bottom: 0;
}

.checklist-icon {
    width: 17px;
    height: 17px;
    background: var(--color-primary, #1d5037);
    border: 1.7px solid var(--color-primary, #1d5037);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--color-bg-cream, #fcfaf1);
}

.checklist-text h4 {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 20px;
    color: var(--color-primary, #1d5037);
    margin: 0 0 3px 0;
}

.checklist-text p {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 17px;
    letter-spacing: -0.13px;
    color: var(--color-primary, #1d5037);
    margin: 0;
}

/* ============================================
   BTS VIDEOS - BOOK SPINES
   ============================================ */

.videos-container {
    min-height: 100vh;
    padding: 200px 0 50px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-carousel {
    position: relative;
    width: 100vw;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    margin-left: 140px; /* Half of 280px sidebar to shift center right */
}

.video-carousel.dragging {
    cursor: grabbing;
}

.video-shelf {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-block {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 180px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
}

.video-spine {
    background-image: url('../assets/Video-spine-bg.svg');
    ;
    background-size: cover;
    border: 1.5px solid var(--color-primary, #1d5037);
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    box-shadow: 12px 5px 3px 0px rgba(0, 0, 0, 0.25);
    min-height: 500px;
}

.video-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 253px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.video-title .title-line {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 35px;
    line-height: 33px;
    color: #000;
    text-align: center;
}

.video-divider {
    width: 126px;
    height: 1.5px;
    background: var(--color-primary, #1d5037);
}

.video-duration {
    text-align: center;
    color: #000;
}

.duration-label {
    display: block;
    font-family: 'Courier New', monospace;
    font-style: italic;
    font-size: 9px;
    line-height: 12px;
}

.duration-time {
    display: block;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
    font-size: 15px;
    line-height: 19px;
}

.video-play-btn {
    width: 69px;
    height: 69px;
    background: var(--color-primary, #1d5037);
    border: 3px solid var(--color-primary, #1d5037);
    color: var(--color-bg-cream, #fcfaf1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-play-btn:hover {
    background: #2a6b4a;
}

.video-play-btn svg {
    margin-left: 5px;
}

/* ============================================
   VIDEO LIGHTBOX
   ============================================ */

.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.video-lightbox .lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 52px;
    height: 52px;
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    color: var(--color-primary, #1d5037);
    font-size: 32px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 2001;
}

.video-lightbox .lightbox-close:hover {
    background: var(--color-note, #e5e8a7);
    transform: scale(1.05);
}

.video-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Placeholder when no video content */
.video-placeholder {
    text-align: center;
    color: var(--color-bg-cream, #fcfaf1);
}

.video-placeholder-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.video-placeholder-title {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.video-placeholder-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1400px) {
    .tips-book-container {
        padding: 150px 50px 50px 250px;
    }

    .tip-card {
        width: 450px;
        height: 650px;
    }

    .polaroid[data-tool="0"] {
        left: 50px;
        width: 350px;
    }

    .polaroid[data-tool="1"] {
        left: 450px;
        width: 300px;
    }

    .polaroid[data-tool="2"] {
        left: 150px;
        top: 350px;
        width: 220px;
    }

    .polaroid[data-tool="3"] {
        left: 400px;
        top: 280px;
        width: 220px;
    }

    .polaroid[data-tool="4"] {
        left: 650px;
        top: 350px;
        width: 280px;
    }

    .tools-checklist {
        left: 500px;
        width: 380px;
    }
}

@media (max-width: 1100px) {
    .bts-nav {
        position: relative;
        top: 150px;
        left: 0;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0 20px;
    }

    .tips-book-container {
        padding: 220px 20px 80px 20px;
        flex-direction: column;
    }

    .book-spread.active {
        width: 100%;
        height: auto;
    }
    
    .tip-card {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform-origin: center !important;
    }

    .tip-card {
        width: 100%;
        max-width: 500px;
        height: auto;
        min-height: 400px;
    }

    .tools-container,
    .videos-container {
        padding: 220px 20px 80px 20px;
    }

    .polaroids-scatter {
        height: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .polaroid {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 200px !important;
    }

    .tools-checklist {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 400px;
        margin: 30px auto 0;
    }
}