/* -------------------------------------------------------------------------- */
/* 1. GLOBAL SCROLLBAR & BASE UTILITIES                                       */
/* -------------------------------------------------------------------------- */
::-webkit-scrollbar { 
    width: 8px; 
}

::-webkit-scrollbar-track { 
    background: #f1f1f1; 
}

::-webkit-scrollbar-thumb { 
    background: #94a3b8; 
    border-radius: 4px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: #0f172a; 
}

/* Animations */
.fade-in { 
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}
.fade-in.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

/* Gradient Text Utilities */
.text-gradient-green { 
    background: linear-gradient(to right, #47b76b, #86efac); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.text-gradient-orange { 
    background: linear-gradient(to right, #e87525, #fdba74); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.text-gradient-yellow { 
    background: linear-gradient(to right, #e9bf1f, #fde047); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* -------------------------------------------------------------------------- */
/* 2. MOBILE NAVIGATION & STICKY HEADER                                       */
/* -------------------------------------------------------------------------- */
.mobile-sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

/* ScrollSpy Chip Navigation Container */
.mobile-chip-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.mobile-chip-nav::-webkit-scrollbar { 
    display: none; 
}

/* The "Active Glow" state for Mobile Chips */
/* Using !important to override Tailwind utility classes */
.mobile-chip-nav a.active-chip {
    background-color: #E31E24 !important; /* Forces Klik Red */
    color: #ffffff !important;           /* Forces White Text */
    transform: scale(1.05);              /* Slight pop effect */
    box-shadow: 0 4px 10px rgba(227, 30, 36, 0.3);
    border: none;
    font-weight: 700;
}

/* -------------------------------------------------------------------------- */
/* 3. DESKTOP SIDEBAR & ACCORDION                                             */
/* -------------------------------------------------------------------------- */

/* Right-Side Navigation Panel Toggles */
.nav-square.active {
    background-color: #0f172a;
    color: white;
    border-left: 4px solid #e7342f;
}
.nav-square.active .icon-chevron {
    color: #e7342f;
    transform: rotate(180deg);
}
.nav-square:not(.active):hover {
    background-color: #f1f5f9;
}

/* Accordion Animation Logic */
.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out; /* Smooth slide up */
}

/* FIX: Increased max-height to accommodate long menus (like your new 1.16 list) */
.sub-menu.open {
    max-height: 4000px; 
    transition: max-height 0.8s ease-in; 
}

/* Desktop Sidebar Links (Left Side of Page) */
.desktop-link.text-klik-red,
.desktop-link.active-link { /* active-link class added by JS */
    color: #E31E24 !important;
    font-weight: 700 !important;
    border-left: 4px solid #E31E24 !important;
    padding-left: 12px;
    margin-left: -14px; /* Pulls the border back to align with the list */
    transition: all 0.3s ease;
}

/* Inline Links with Suffix Arrow Detail */
.inline-link {
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.inline-link:hover {
    color: #E31E24;
}

/* Internal Scrollbar for Left Desktop Sidebar (Fixes cutoff issues) */
.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 4px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #e7342f; 
}

/* Offset for Anchor Links (Prevents header from covering titles) */
.scroll-mt-32 { 
    scroll-margin-top: 8rem; 
} 
.scroll-mt-48 { 
    scroll-margin-top: 12rem; 
} 

/* -------------------------------------------------------------------------- */
/* 4. PRELOADER                                                               */
/* -------------------------------------------------------------------------- */
#preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050505;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader-logo {
    width: 150px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    animation: pulse 2s infinite; 
}

.preloader-text {
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.loading-bar {
    width: 0%;
    height: 2px;
    background-color: #e7342f;
    margin: 0 auto;
    animation: loadProgress 2s ease-in-out infinite;
    border-radius: 2px;
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loadProgress {
    0% { width: 0%; opacity: 1; }
    50% { width: 100%; opacity: 1; }
    100% { width: 0%; opacity: 0; }
}

/* -------------------------------------------------------------------------- */
/* 5. BACKGROUND UTILS                                                        */
/* -------------------------------------------------------------------------- */
/* Default: Mobile Background */
.hero-bg {
    background-image: url('../assets/mobile.png'); 
    background-size: cover;
    background-position: center;
}

/* Desktop: Switch to wide background at 768px width */
@media (min-width: 768px) {
    .hero-bg {
        background-image: url('../assets/hero4.png'); 
    }
}
