/* =========================================
   LITPALM - FUTURE BIO-TECH DESIGN SYSTEM
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap'); /* For Counters */

:root {
    /* Colors */
    --bg-obsidian: #050507;
    --bg-panel: #0a0f16;
    --accent-green: #00FF94;
    --accent-cyan: #00E5FF;
    --accent-purple: #BD00FF;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 30px;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Gradients */
    --gradient-glow: linear-gradient(135deg, rgba(0, 255, 148, 0.1) 0%, rgba(0, 229, 255, 0.05) 100%);
    
    /* Spacing */
    --container-width: 1280px;
    --header-height: 80px;
}

/* =========================================
   RESET & BASE
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-obsidian); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-green); }

/* =========================================
   PRELOADER
   ========================================= */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-obsidian);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 2rem;
    position: relative;
    opacity: 0; /* Handled by GSAP */
}

.loader-logo span {
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(0, 255, 148, 0.5);
}

.progress-container {
    width: 300px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.progress-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--accent-green);
    margin-top: 1rem;
}

/* =========================================
   UTILITIES & COMPONENTS
   ========================================= */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-panel:hover {
    border-color: rgba(0, 255, 148, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 148, 0.05);
}

.text-gradient {
    background: linear-gradient(to right, #fff, rgba(255,255,255,0.5));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-green { color: var(--accent-green); }
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: rgba(0, 255, 148, 0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 148, 0.1);
}

.btn-primary:hover {
    background: var(--accent-green);
    color: var(--bg-obsidian);
    box-shadow: 0 0 30px rgba(0, 255, 148, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

/* =========================================
   NAVIGATION
   ========================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.nav-logo span { color: var(--accent-green); }

.nav-menu-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    display: none; /* Desktop default */
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 7, 0.95);
    backdrop-filter: blur(20px);
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-nav-overlay.active { transform: translateX(0); }

.mobile-nav-overlay a {
    font-size: 2rem;
    font-weight: 700;
}

/* =========================================
   HERO SECTION
   ========================================= */

.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: calc(var(--header-height) + 60px);
}

/* Custom CSS from User */
spline-viewer {
    outline: none;
}

.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 255, 148, 0.3); /* Glow Hijau LitPalm */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    pointer-events: none; /* Let clicks pass through to 3D if needed, enable on buttons */
}

.hero-content * { pointer-events: auto; }

.hero-headline {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.spline-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* =========================================
   SECTIONS GENERAL
   ========================================= */

section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.section-title span {
    color: var(--accent-green);
}

/* =========================================
   BENTO GRIDS (Home)
   ========================================= */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.bento-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: 0 10px 40px -10px rgba(0, 255, 148, 0.1);
}

.bento-icon {
    font-size: 2rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
}

/* =========================================
   TIMELINE (About)
   ========================================= */

.timeline-container {
    position: relative;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-green), transparent);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    justify-content: center;
    padding-bottom: 80px;
    position: relative;
}

.timeline-content {
    width: 40%;
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content { margin-right: auto; text-align: right; }
.timeline-item:nth-child(even) .timeline-content { margin-left: auto; }

.timeline-year {
    position: absolute;
    top: 0;
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.03);
    line-height: 1;
    z-index: 0;
}

.timeline-item:nth-child(odd) .timeline-year { right: 20px; }
.timeline-item:nth-child(even) .timeline-year { left: 20px; }

/* =========================================
   EDUCATION
   ========================================= */

.progress-tracker-sticky {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    background: rgba(5, 5, 7, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 40px;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.module-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
}

.module-body {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.module-card.active .module-body {
    padding: 20px;
    max-height: 500px; /* Adjust as needed */
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.checklist-item:hover { background: rgba(255,255,255,0.03); }

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.custom-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.custom-checkbox i {
    color: #000;
    font-size: 12px;
    display: none;
}

.custom-checkbox.checked i { display: block; }

/* =========================================
   GALLERY
   ========================================= */

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 24px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.3s;
}

.filter-chip.active, .filter-chip:hover {
    background: var(--accent-green);
    color: var(--bg-obsidian);
    border-color: var(--accent-green);
}

.gallery-masonry {
    column-count: 3;
    column-gap: 20px;
}

.gallery-card {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 1/1; /* Enforce square aspect ratio */
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-card:hover img { transform: scale(1.1); }

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-card:hover .gallery-info {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {
    .hero-headline { font-size: 3rem; }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-menu-btn { display: block; }
    
    .hero { flex-direction: column; justify-content: center; text-align: center; padding-top: 0; }
    .hero-content { margin: 0 auto; }
    
    .bento-grid { grid-template-columns: 1fr; }
    
    .timeline-line { left: 20px; transform: none; }
    .timeline-item { flex-direction: column; padding-left: 50px; padding-bottom: 40px; }
    .timeline-content { width: 100%; margin: 0 !important; text-align: left !important; }
    .timeline-year { right: 20px !important; left: auto !important; top: 20px; font-size: 3rem; }
    
    .gallery-masonry { column-count: 1; }
}

/* =========================================
   CUSTOM FIXES (User Requested)
   ========================================= */

/* Fix untuk teks yang menumpuk di Hero */
spline-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Di belakang teks */
}

.hero-content {
    position: relative;
    z-index: 10; /* Di atas Spline */
}

/* Fix Margin Solusi Bio-Tech yang menabrak */
h2.solusi-title {
    margin: 60px 0 40px 0 !important;
    display: block;
}

/* Fix Margin FAQ */
#faq-section h2 {
    margin-top: 80px !important;
    padding-bottom: 20px;
}

/* Fix Ikon POME yang menabrak border */
.card-icon-pome {
    padding-top: 30px !important; /* Changed to padding as requested */
    display: inline-block;
}

/* Utility Classes (Missing in original CSS) */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-20 { margin-bottom: 5rem; }
.mt-20 { margin-top: 5rem; }

/* Gallery Spacing Fix */
.gallery-filters {
    margin-top: 60px;
}

/* Timeline Spacing Fix */
.timeline-section-spacing {
    margin-top: 100px;
}

/* =========================================
   DECORATIONS
   ========================================= */

.decoration-leaf {
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 50vw;
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    transform: translate(20%, -20%);
}

.decoration-fruit {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 400px;
    max-width: 40vw;
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    transform: translate(-20%, 20%);
}
