/* ========================================== */
/* 1. CSS VARIABLES (THEMING SYSTEM)          */
/* ========================================== */

/* Base Brand Colors (Identitas Utama - Tidak berubah berdasarkan tema) */
:root {
    --brand-primary: #F97316;
    --brand-primary-hover: #ea580c;
    --brand-primary-transparent: rgba(249, 115, 22, 0.1);
    --white-pure: #ffffff;

    /* Light Theme Variables (Default) */
    --bg-body: #F8FAFC;
    /* Background utama halaman */
    --bg-surface: #FFFFFF;
    /* Background card, navbar, form */
    --bg-section: #f1f5f9;
    /* Background seksi selang-seling */
    --text-main: #1F2937;
    /* Teks utama (Gelap) */
    --text-muted: #64748b;
    /* Teks sekunder/deskripsi */
    --border-color: #e2e8f0;
    /* Warna garis batas */
    --shadow-custom: 0 10px 30px rgba(0, 0, 0, 0.08);

    /* Overriding Bootstrap Native Variables */
    --bs-body-font-family: 'Poppins', sans-serif;
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-main);
}

/* Dark Theme Variables (Otomatis menyesuaikan device pengguna) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f172a;
        /* Slate 900 */
        --bg-surface: #1e293b;
        /* Slate 800 */
        --bg-section: #141f36;
        /* Slate 850 */
        --text-main: #f8fafc;
        /* Slate 50 */
        --text-muted: #94a3b8;
        /* Slate 400 */
        --border-color: #334155;
        /* Slate 700 */
        --shadow-custom: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    /* Menginversikan warna tombol close (X) Offcanvas di Dark Mode */
    .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }
}

/* ========================================== */
/* 2. GENERAL STYLES                          */
/* ========================================== */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 600;
}

p,
.text-muted-custom {
    color: var(--text-muted) !important;
}

/* Custom Background Utilities untuk menggantikan class Bootstrap */
.bg-custom-surface {
    background-color: var(--bg-surface) !important;
}

.bg-custom-section {
    background-color: var(--bg-section) !important;
}

/* Custom Buttons berbasis Brand Identity */
.btn-brand {
    background-color: var(--brand-primary);
    color: var(--white-pure);
    border: 2px solid var(--brand-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-brand:hover {
    background-color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    color: var(--white-pure);
    transform: translateY(-2px);
}

.btn-brand-outline {
    background-color: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-brand-outline:hover {
    background-color: var(--brand-primary);
    color: var(--white-pure);
    transform: translateY(-2px);
}

/* Custom Cards */
.card-custom {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-custom);
    transition: all 0.3s ease;
    color: var(--text-main);
}

.card-custom:hover {
    transform: translateY(-10px);
}

/* ========================================== */
/* 3. LAYOUT COMPONENTS                       */
/* ========================================== */

/* Top Bar */
.top-bar {
    background-color: var(--brand-primary);
    color: var(--white-pure);
    font-size: 0.85rem;
}

.top-bar a {
    color: var(--white-pure);
    transition: opacity 0.3s;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Navbar */
.navbar-custom {
    background-color: transparent;
    transition: all 0.3s ease;
    padding: 15px 0;
}

.navbar-custom.scrolled {
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-custom);
    padding: 10px 0;
}

.navbar-custom .navbar-brand {
    color: var(--text-main) !important;
}

.navbar-custom .nav-link {
    color: var(--text-main);
    font-weight: 500;
    margin: 0 10px;
    position: relative;
}

/* Mode terang saat Hero di paling atas */
.navbar-custom.hero-top .navbar-brand,
.navbar-custom.hero-top .nav-link {
    color: var(--white-pure) !important;
}

.navbar-custom .nav-link:hover {
    color: var(--brand-primary) !important;
}

.navbar-toggler {
    border-color: var(--border-color);
    background-color: var(--bg-surface);
}

/* Hero Banner */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: url('https://images.unsplash.com/photo-1521737711867-e3b97375f902?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    margin-top: -86px;
    /* Compensate for navbar height */
    padding-top: 86px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    color: var(--white-pure) !important;
    font-weight: 700;
}

.hero-desc {
    color: #cbd5e1 !important;
}

/* ========================================== */
/* 4. SECTIONS SPECIFIC STYLES                */
/* ========================================== */

/* Icon Container */
.icon-box {
    width: 70px;
    height: 70px;
    background-color: var(--brand-primary-transparent);
    color: var(--brand-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.card-custom:hover .icon-box {
    background-color: var(--brand-primary);
    color: var(--white-pure);
}

/* Stats Section */
.stat-item h2 {
    color: var(--brand-primary);
    font-weight: 700;
}

/* Timeline / Alur Kerja */
.timeline-wrapper {
    position: relative;
    padding: 2rem 0;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-step {
    position: relative;
    z-index: 1;
    background-color: var(--bg-surface);
    border: 2px solid var(--brand-primary);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: 0.3s;
}

.timeline-step:hover {
    background-color: var(--brand-primary);
    color: var(--white-pure);
}

.timeline-step:hover h6 {
    color: var(--white-pure) !important;
}

.timeline-step i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--brand-primary);
}

.timeline-step:hover i {
    color: var(--white-pure);
}

@media (max-width: 768px) {
    .timeline-wrapper::before {
        display: none;
    }

    .timeline-step {
        margin-bottom: 1rem;
    }
}

/* Portfolio */
.portfolio-card {
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}

.portfolio-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: 0.5s ease;
}

.portfolio-card:hover img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
    padding: 2rem 1.5rem 1.5rem;
    transition: 0.4s ease;
    color: var(--white-pure);
}

.portfolio-card:hover .portfolio-overlay {
    bottom: 0;
}

/* Forms */
.form-control {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem 1rem;
}

.form-control:focus {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem var(--brand-primary-transparent);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background-color: #020617;
    /* Tetap gelap di kedua tema */
    color: #94a3b8;
    padding: 4rem 0 2rem;
}

.footer h5 {
    color: var(--white-pure);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: 0.3s;
}

.footer a:hover {
    color: var(--brand-primary);
    padding-left: 5px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white-pure);
}

.social-links a:hover {
    background-color: var(--brand-primary);
    padding-left: 0;
}

/* ========================================== */
/* 5. MEGA MENU & SPA ROUTING STYLES          */
/* ========================================== */
.offcanvas {
    background-color: var(--bg-surface);
    color: var(--text-main);
    transition: all 0.3s ease;

}
/* @media (max-width: 992px) {
    .offcanvas {
        width: 85% !important;
    }
} */
/* Mega Dropdown CSS */
@media (min-width: 992px) {
    .dropdown-mega .dropdown-menu {
        border-radius: 0 0 1rem 1rem;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        margin-top: 0;
        border: none;
        border-top: 3px solid var(--brand-primary) !important;
    }

    .dropdown-mega:hover>.dropdown-menu {
        display: block;
        left: 0;
        animation: fadeIn 0.3s ease;
    }
}

@media (max-width: 991.98px) {
    .dropdown-mega .dropdown-menu {
        border: none;
        box-shadow: none;
        background-color: transparent !important;
        padding: 0 !important;
        margin-top: 10px;
    }

    .mega-menu-item {
        padding: 0.2rem 0 !important;
        border: none !important;
    }

    .mega-menu-item:hover {
        box-shadow: none !important;
        background-color: transparent !important;
        transform: none !important;
    }

    .mega-menu-links a {
        border-bottom: none !important;
        padding: 6px 0 6px 2.8rem !important;
        /* Indent sub-menus di bawah text */
        font-size: 0.95rem;
    }
}

.mega-menu-item {
    transition: all 0.3s;
    border: 1px solid transparent;
}

.mega-menu-item:hover {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-custom);
}

.mega-menu-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 0;
    display: flex;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    transition: 0.3s;
    font-size: 0.9rem;
}

.mega-menu-links a:last-child {
    border-bottom: none;
}

.mega-menu-links a:hover {
    color: var(--brand-primary);
    padding-left: 8px;
}

/* SPA Pages Visibility */
.spa-page {
    display: none;
}

.spa-page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Page Headers */
.page-header {
    padding: 120px 0 60px;
    background: linear-gradient(to right, var(--bg-surface), var(--brand-primary-transparent));
    border-bottom: 1px solid var(--border-color);
}

/* Filter Buttons */
.filter-btn {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--brand-primary);
    color: var(--white-pure);
    border-color: var(--brand-primary);
}
