/* ============================================================
   TABLE OF CONTENTS
   ============================================================
   01. DESIGN TOKENS (VARIABLES)
   02. BASE & RESET
   03. LAYOUT & SECTIONS
   04. NAVIGATION & UI ELEMENTS
   05. GALLERY HERO SECTION
   06. GRID CONTENT SECTIONS
   07. HIGHLIGHTS DETAIL & CARDS
   08. STACKS & CYLINDER EFFECTS
   ============================================================ */

/* ============================================================
   01. DESIGN TOKENS (VARIABLES)
   ============================================================ */

:root {
    /* Colors */
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-sub: #475569;
    --overlay-radial: rgba(248, 250, 252, 0.5);
    --card-shadow: rgba(0, 0, 0, 0.15);
    --border-light: #FF5733;
    
    /* Effects */
    --icon-brightness: 0.2;
    --btn-gallery: #f8fafc;
    --box-shadow: rgba(255,87,51,0.8);
    --primary-green: #FF5733;
    
    /* Gradients */
    --bg-overlay-radial: radial-gradient(40% 70% at center, var(--bg-color) 15%, var(--overlay-radial) 150%);
    --bg-overlay-linear: linear-gradient(to top, var(--bg-color) 0%, transparent 25%), 
                         linear-gradient(to top, transparent 75%, var(--bg-color) 100%);
}

/* Dark Mode Overrides */
html:not([data-theme="dark"]) {
    --line-width: clamp(300px, 55vw, 1000px);
    --primary-green: #34d399;
    --bg-color: #111827;
    --text-main: #ffffff;
    --text-sub: #cbd5e1;
    --overlay-radial: rgba(17, 24, 39, 0.5);
    --card-shadow: rgba(255, 255, 255, 0.2);
    --border-light: #ffffff;
    --icon-brightness: 1;
    --btn-gallery: #FF5733;
    --box-shadow: rgba(52, 211, 153, 0.8);
    --bg-overlay-radial: radial-gradient(circle, var(--overlay-radial) 0%, var(--bg-color) 60%);
}

/* ============================================================
   02. BASE & RESET
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100%;
    scroll-padding-top: 50px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Utility Classes */
.lock-scroll {
    overflow: hidden;
    touch-action: none;
}

/* ============================================================
   03. LAYOUT & SECTIONS
   ============================================================ */

/* Shared Section Styles */
.gallery-section,
.process-section,
.highlights-section,
.experiments-section,
.highlights-detail-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    transition: background-color 0.4s ease;
    overflow: hidden;
}

/* Specific Section Layouts */
.gallery-section {
    display: flex;
    justify-content: center;
    align-items: center;
    contain: paint;
}

.process-section,
.highlights-section,
.experiments-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 10%;
    overflow-anchor: none;
    scroll-margin-top: 0;
}

.highlights-detail-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Background Images */
.bg-image,
.bg-image-process img,
.bg-image-highlights img,
.bg-image-experiments img {
    position: absolute;
    width: 100%;
    height: auto;
    filter: blur(3px);
    opacity: 0.8;
    z-index: 1;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bg-timeline.avif');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(3px);
    opacity: 0.8;
    z-index: 1;
    transform: scale(1.1);
    transform-origin: bottom center;
    will-change: transform;
}

/* Background Overlays */
.bg-overlay,
.bg-overlay-process,
.bg-overlay-highlights,
.bg-overlay-experiments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: background 0.4s ease;
}

.bg-overlay {
    background: var(--bg-overlay-radial), var(--bg-overlay-linear);
}

.bg-overlay-process {
    background: radial-gradient(circle at 85% 30%, transparent 0%, transparent 10%, var(--bg-color) 75%),
                var(--bg-overlay-linear);
}

.bg-overlay-highlights,
.bg-overlay-experiments {
    background: radial-gradient(circle at 75% 20%, transparent 0%, transparent 10%, var(--bg-color) 75%),
                var(--bg-overlay-linear);
}

/* Positional Background Adjustments */
.bg-image-process img {
    top: -50px;
    left: 13%;
}

.bg-image-highlights img,
.bg-image-experiments img {
    top: 0;
    left: 0;
    transform: scale(1.1);
}

/* ============================================================
   04. NAVIGATION & UI ELEMENTS
   ============================================================ */

/* Global Navigation Container */
.nav-global-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1800px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    z-index: 999;
    pointer-events: none;
}

.highlights-detail-section .nav-global-container {
    justify-content: center;
}

.process-section .nav-global-container,
.highlights-section .nav-global-container,
.experiments-section .nav-global-container {
    justify-content: flex-start;
}

/* Navigation Sides */
.nav-side-left,
.nav-side-right {
    flex: 1;
    display: flex;
    pointer-events: auto;
}

.nav-side-left {
    justify-content: flex-start;
}

.nav-side-right {
    justify-content: flex-end;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 35px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.5));
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: scale(1.1);
}

.icon-backtotop {
    fill: currentColor;
    color: var(--primary-green);
}

/* Stepper Navigation */
.section-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--primary-green);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.step.active {
    background-color: var(--primary-green);
    opacity: 1;
    box-shadow: 0 0 15px var(--primary-green);
}

.line {
    width: 40px;
    height: 2px;
    background-color: var(--text-main);
    opacity: 0.3;
}

/* ============================================================
   05. GALLERY HERO SECTION
   ============================================================ */

.content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
}

.headline {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 5px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    color: var(--text-main);
}

.sub-headline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-sub);
    letter-spacing: 2px;
    margin-bottom: 60px;
    opacity: 0.9;
}

/* Gallery Button */
.btn-gallery {
    position: relative;
    display: inline-block;
    padding: 12px 35px;
    background-color: var(--text-main);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 0 15px rgba(249, 250, 251, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.btn-gallery::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid var(--primary-green);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-gallery:hover {
    background-color: var(--primary-green);
    color: #111827;
    box-shadow: 0 0 25px var(--box-shadow);
    transform: translateY(5px);
}

.btn-gallery:hover::before {
    top: -15px;
    opacity: 1;
}

.btn-gallery:hover .btn-text {
    visibility: hidden;
}

/* Button States */
.btn-gallery:not(.unlocked):hover .btn-text::after {
    content: "Tarik Aku";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    visibility: visible;
}

.btn-gallery.unlocked:hover {
    color: #111827;
    box-shadow: 0 0 15px var(--box-shadow);
    transform: none;
}

.btn-gallery.unlocked::before {
    display: none;
}

/* ============================================================
   06. GRID CONTENT SECTIONS
   ============================================================ */

.split-grid-container {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 60px;
    align-items: center;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

/* Section Typography */
.section-headline {
    font-size: 3.5rem;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.1;
}

.title-line {
    width: 100px;
    height: 4px;
    background-color: var(--text-main);
    margin: 20px 0;
}

.section-description {
    color: var(--text-sub);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 90%;
}

/* Video Section */
.video-section-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.video-player {
    flex: 1;
    width: 100%;
    /* Batasi lebar maksimal agar saat 16:9 tidak terlalu raksasa */
    max-width: 900px; 
    margin: 0 auto;
    
    /* Batasi tinggi maksimal 80% dari tinggi layar */
    max-height: 80vh; 
    
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Transisi harus mencakup aspect-ratio */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-player img, 
.video-player iframe {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Gunakan contain agar gambar asli tidak terpotong */
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 50;
    width: 50%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Background gelap transparan */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 15px; /* Sesuaikan dengan style video player-mu */
    backdrop-filter: blur(5px); /* Efek blur kaca */
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.placeholder-content {
    text-align: center;
    color: white;
    font-family: sans-serif;
}

.placeholder-content p {
    margin: 10px 0 5px;
    font-size: 1.1rem;
    font-weight: 500;
}

.placeholder-content span {
    font-size: 0.8rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ratio-3-4 {
    aspect-ratio: 3 / 4;
    max-width: 420px;
}

.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.container-video {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Navigation Arrows */
.nav-arrow {
    cursor: pointer;
    width: 40px;
    height: auto;
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

.nav-arrow:hover {
    opacity: 0.7;
}

.nav-color {
    fill: var(--text-main);
    width: 30px;
    height: auto;
}

/* Video Pagination */
.video-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.dot {
    display: inline-block;
    width: 25px;
    height: 10px;
    background-color: var(--text-main);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.dot:hover {
    opacity: 0.6;
    transform: none;
}

.dot.active {
    width: 40px;
    background-color: var(--text-main);
    opacity: 1;
    transform: none;
}

/* ============================================================
   07. HIGHLIGHTS DETAIL & CARDS
   ============================================================ */

/* Media Type Icons */
.media-type-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-wrapper {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    pointer-events: auto;
}

.icon-wrapper svg.glowing-icon {
    width: 100%;
    height: auto;
    fill: var(--text-sub);
    transition: all 0.3s ease;
}

.icon-wrapper .mode-img {
    width: 28px;
    height: auto;
    filter: brightness(var(--icon-brightness));
}

.icon-wrapper.active {
    opacity: 1;
}

.icon-wrapper.active svg.glowing-icon {
    fill: var(--primary-green);
    filter: drop-shadow(0 0 8px var(--primary-green));
}

.icon-wrapper.active .mode-img {
    filter: drop-shadow(0 0 8px var(--primary-green));
}

.icon-wrapper:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Decoration Lines */
.bottom-decoration-line-container {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.top-decoration-line,
.bottom-decoration-line {
    width: var(--line-width, 55vw);
    height: 1px;
    background: var(--text-sub);
    opacity: 0.3;
    flex-shrink: 0;
}

.top-decoration-line {
    margin: 0 20px;
}

/* ============================================================
   08. STACKS & CYLINDER EFFECTS
   ============================================================ */

/* Image Stacks */
.image-stack {
    display: flex;
    gap: 15px;
    margin-top: 50px;
}

.image-stack img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border: 2px solid var(--border-light);
    border-radius: 8px;
}

.img-tilt-left {
    transform: rotate(-8deg);
}

.img-tilt-right {
    transform: rotate(5deg);
}

/* Triple Image Stack */
.image-stack-triple {
    position: relative;
    height: 210px;
    left: 40px;
}

.image-stack-triple img {
    position: absolute;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.img-bottom {
    width: 130px;
    aspect-ratio: 3/4;
    left: 0;
    bottom: -10px;
    z-index: 1;
}

.img-middle {
    width: 180px;
    aspect-ratio: 4/3;
    left: 60px;
    bottom: -50px;
    z-index: 2;
}

.img-top {
    width: 130px;
    aspect-ratio: 3/4;
    left: 170px;
    bottom: -10px;
    z-index: 3;
}

/* Cylinder Viewport */
.cylinder-viewport {
    perspective: 2500px;
    width: 100%;
    height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 20px;
    cursor: default;
    user-select: none;
}

/* Media Panels */
.media-panel {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.media-panel.active {
    display: flex;
    pointer-events: auto;
}

/* Cylinder Wrapper */
.cylinder-wrapper {
    position: relative;
    width: 450px;
    height: 550px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cylinder-wrapper:active,
.cylinder-wrapper.is-dragging {
    cursor: grabbing;
}

.cylinder-wrapper.is-dragging {
    transition: none;
}

#panel-video .cylinder-wrapper {
    width: 800px;
    height: 450px;
}

.cylinder-external-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 260px; /* Jarak tetap lebar */
    margin: -90px auto 0 auto;
    width: fit-content;
    position: relative;
    z-index: 110;
    pointer-events: none;
}

.highlights-detail-section:hover .cylinder-external-nav {
    opacity: 1;
}

.cylinder-btn {
    width: 45px;
    height: 45px;
    cursor: pointer;
    opacity: 0.1;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.cylinder-btn.left {
    transform: rotate(180deg);
}

.cylinder-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.cylinder-btn.left:hover {
    transform: rotate(180deg) scale(1.2);
}

.cylinder-btn .nav-color {
    fill: var(--primary-green, #00ff88);
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.4));
}

.cylinder-btn:active {
    transform: scale(0.9);
}

/* Cylinder Items */
.cylinder-item {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: visible;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 
        transform 0.1s linear, 
        filter 0.2s ease, 
        opacity 0.2s ease, 
        visibility 0.2s;
    pointer-events: auto;
    cursor: grab;
    will-change: transform, opacity, filter;
}

.cylinder-item img,
.cylinder-item iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.cylinder-item.is-front {
    pointer-events: auto;
    filter: blur(0) brightness(1);
    opacity: 1;
    z-index: 100;
}

.cylinder-item.is-front iframe {
    pointer-events: auto;
}

.cylinder-item:not(.is-front) {
    filter: blur(5px) brightness(0.4);
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Video Grabber Overlay */
.video-overlay-grabber {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
    cursor: grab;
    pointer-events: auto;
    transition: visibility 0.3s, opacity 0.3s;
}

.cylinder-wrapper.is-dragging .cylinder-item.is-front,
.cylinder-wrapper.is-dragging .video-overlay-grabber {
    cursor: grabbing;
}

.cylinder-item.is-front .video-overlay-grabber {
    pointer-events: none;
    z-index: -1;
}