/* =========================================
   1. BASE & RESET
   ========================================= */
html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    box-sizing: border-box;
    overflow-x: hidden; /* Mencegah scroll horizontal yang tidak diinginkan */
}

/* Custom Scrollbar (Opsional - Agar lebih elegan) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================
   2. MODERN LOADING SCREEN
   ========================================= */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: #ffffff; /* Default Light Mode */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Support Dark Mode untuk Loading Screen */
.dark #loading-screen {
    background-color: #020617; /* Slate-950 */
}

/* Class untuk menyembunyikan loading (Di-toggle oleh JS) */
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Logo Animation - Breathing Effect */
.modern-logo {
    width: 100px; 
    height: auto;
    margin-bottom: 30px;
    animation: breath 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(0, 74, 173, 0.1));
}

@keyframes breath {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Modern Dots Animation */
.loading-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: bounce-modern 1.4s infinite ease-in-out both;
}

/* Warna dots sesuai branding Genius */
.dot:nth-child(1) { animation-delay: -0.32s; background-color: #004aad; /* Blue */ }
.dot:nth-child(2) { animation-delay: -0.16s; background-color: #00bfff; /* Cyan */ }
.dot:nth-child(3) { animation-delay: 0s;     background-color: #ffde00; /* Yellow */ }

@keyframes bounce-modern {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Text Caption Style */
.loading-caption {
    margin-top: 25px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: #64748b; /* Slate 500 */
    text-transform: uppercase;
    animation: fadeText 2s infinite;
}
.dark .loading-caption { color: #94a3b8; }

@keyframes fadeText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =========================================
   3. ANIMASI SCROLL REVEAL (JS Helper)
   ========================================= */
.reveal-section {
    opacity: 0;
    transform: translateY(30px); /* Jarak naik dikit aja biar elegan */
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   4. UTILITIES (Glassmorphism & Buttons)
   ========================================= */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.dark .glass {
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-gradient {
    background: linear-gradient(135deg, #004aad 0%, #00bfff 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Efek Shine pada Button */
.btn-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}
.btn-gradient:hover::after {
    left: 100%;
}

/* Sembunyikan Scrollbar tapi tetap bisa digeser (Untuk Widget/Overflow) */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   5. FIX BUG & OVERRIDES
   ========================================= */

/* FIX BUG FAQ: 
   Memaksa konten FAQ tetap terlihat (opacity 1) agar tidak bentrok 
   dengan animasi Scroll Reveal, tapi tetap membiarkan transisi slide-down berjalan. */
.faq-answer {
    opacity: 1 !important;      
    transform: none !important; 
}

/* Elemen teks di dalam FAQ dipaksa muncul */
.faq-answer p, 
.faq-answer li, 
.faq-answer div,
.faq-answer ul,
.faq-answer ol {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important; 
}

/* Fix posisi Navbar agar tidak tertutup konten saat Anchor Link diklik */
html {
    scroll-padding-top: 100px;
}