/* ==========================================================================
   CSS VARIABLES & TEMA
   ========================================================================== */
:root {
    --primary-color: #0F7A5C;
    --secondary-color: #FFFFFF;
    --accent-color: #D4AF37;
    --bg-color: #F8F9FA;
    --text-color: #2D3436;
    --text-light: #636e72;
    --border-color: #e0e0e0;
    --footer-bg: #0a4f3c;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease-in-out;
    --font-main: 'Poppins', sans-serif;
}

/* Mode Gelap (Dark Mode) */
body.dark-mode {
    --primary-color: #17a57e;
    --secondary-color: #1e272e;
    --bg-color: #121212;
    --text-color: #f5f6fa;
    --text-light: #dcdde1;
    --border-color: #353b48;
    --footer-bg: #000000;
    --shadow-md: 0 5px 15px rgba(255,255,255,0.05);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--secondary-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: inherit;
    margin-bottom: 15px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    text-transform: uppercase;
}

.divider {
    height: 4px;
    width: 60px;
    background-color: var(--accent-color);
    margin: 0 auto;
    border-radius: 2px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0c6149;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Ripple Effect */
.btn-ripple .ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   LOADING SCREEN
   ========================================================================== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    background-color: transparent;
    padding: 20px 0;
}

header.scrolled {
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
    padding: 10px 0;
}

header.scrolled .nav-link { color: var(--text-color); }
header.scrolled .logo-text { color: var(--text-color); }
header.scrolled .btn-primary { background-color: var(--primary-color); }
header.scrolled #dark-mode-toggle, header.scrolled #print-btn { color: var(--text-color); }
header.scrolled .hamburger .bar { background-color: var(--text-color); }

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    color: #fff;
    line-height: 1.2;
}

.logo-text strong { font-size: 1.2rem; letter-spacing: 1px; }
.logo-text span { font-size: 0.85rem; }

.navbar { display: flex; }
.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: #fff;
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after { width: 100%; }

/* ==========================================================================
   DROPDOWN MENU STYLES (DIPERBAIKI)
   ========================================================================== */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute !important;
    top: 100%;
    left: 0;
    background-color: #FFFFFF !important; /* Dipaksa putih agar tidak transparan */
    min-width: 240px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease-in-out;
    z-index: 9999 !important;
    padding: 10px 0;
    margin-top: 10px;
    pointer-events: none;
}

/* Memunculkan Menu Saat di Hover pada Desktop */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.dropdown-menu li {
    width: 100%;
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #2D3436 !important; /* Dipaksa gelap agar terbaca */
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease-in-out;
}

.dropdown-menu a:hover {
    background-color: rgba(15, 122, 92, 0.08) !important;
    color: #0F7A5C !important;
    padding-left: 28px;
}

/* Penyesuaian Dropdown Saat Dark Mode Aktif */
body.dark-mode .dropdown-menu {
    background-color: var(--secondary-color) !important;
}
body.dark-mode .dropdown-menu a {
    color: var(--text-color) !important;
}
body.dark-mode .dropdown-menu a:hover {
    background-color: rgba(255,255,255,0.05) !important;
    color: var(--primary-color) !important;
}

/* ==========================================================================
   HEADER ACTIONS & MOBILE MENU
   ========================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#dark-mode-toggle, #print-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff;
    transition: var(--transition);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #064030 100%);
    position: relative;
    padding-top: 80px;
}

.hero.parallax {
    background-attachment: fixed;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.hero-content h1 {
    font-size: 3rem;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content .subtitle {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    display: block;
    margin: 0 auto;
}

.floating {
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================================
   GRID LAYOUTS & COMPONENTS
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.align-center { align-items: center; }

/* Carousel */
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}
.carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.slide {
    min-width: 100%;
    padding: 60px 20px;
    text-align: center;
    color: #fff;
}
.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* Search Box */
.search-box {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.search-form { display: flex; gap: 10px; margin-top: 20px; }
.search-form input {
    flex: 1; padding: 15px; border: 1px solid var(--border-color); border-radius: 5px; font-family: inherit; background: var(--secondary-color); color: var(--text-color);
}

/* Layanan Cards */
.card-layanan {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
}
.card-layanan:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--accent-color);
}
.icon-box {
    width: 80px;
    height: 80px;
    background: rgba(15, 122, 92, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

/* Alur Permohonan (Horizontal Timeline) */
.timeline-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
}
.timeline-step { flex: 1; position: relative; z-index: 2; }
.step-icon {
    width: 70px; height: 70px; background: var(--secondary-color); color: var(--primary-color);
    border-radius: 50%; border: 3px solid var(--primary-color);
    display: flex; justify-content: center; align-items: center; font-size: 1.8rem; margin: 0 auto 15px;
}
.step-number {
    position: absolute; top: -5px; right: calc(50% - 40px); background: var(--accent-color);
    color: #fff; width: 25px; height: 25px; border-radius: 50%; font-weight: bold;
}
.timeline-connector {
    color: var(--border-color); font-size: 2rem;
}

/* Statistik */
.stats-grid { text-align: center; }
.stat-item h2 { font-size: 3rem; display: inline-block; margin: 10px 0 0; }
.stat-item span { font-size: 2rem; font-weight: bold; }
.stat-icon { font-size: 2.5rem; color: var(--accent-color); }

/* Keunggulan */
.keunggulan-card { text-align: center; padding: 20px; }
.keunggulan-card i { color: var(--primary-color); margin-bottom: 20px; }

/* Berita Cards */
.berita-card {
    background: var(--secondary-color); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.berita-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.berita-card img { width: 100%; height: 200px; object-fit: cover; }
.berita-content { padding: 20px; }
.berita-content .date { color: var(--accent-color); font-size: 0.9rem; font-weight: 500; }
.berita-content h3 { margin: 10px 0; font-size: 1.2rem; }
.read-more { font-weight: 600; display: inline-block; margin-top: 15px; }
.pengumuman-card { border: 2px solid var(--accent-color); background: var(--primary-color); color: white; }
.pengumuman-card h3 { color: white; }
.pengumuman-badge { background: var(--accent-color); color: white; display: inline-block; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; margin-bottom: 10px; }

/* FAQ Accordion */
.accordion-item { border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.accordion-header {
    width: 100%; text-align: left; background: var(--secondary-color); color: var(--text-color);
    padding: 15px 20px; font-size: 1.1rem; font-weight: 500; border: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; font-family: inherit;
}
.accordion-content {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: var(--bg-color);
}
.accordion-content p { padding: 15px 20px; }
.accordion-header.active { color: var(--primary-color); }
.accordion-header.active i { transform: rotate(180deg); transition: transform 0.3s; }

/* Kontak */
.kontak-card { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.icon-lingkaran {
    width: 50px; height: 50px; background: var(--primary-color); color: white;
    border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; flex-shrink: 0;
}
.map-container { height: 100%; min-height: 300px; border-radius: 10px; overflow: hidden; }

/* Footer */
footer { background: var(--footer-bg); color: #fff; padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #dcdde1; }
.footer-links a:hover { color: var(--accent-color); padding-left: 5px; }
.social-links { display: flex; gap: 15px; }
.social-links a {
    width: 40px; height: 40px; background: rgba(255,255,255,0.1); display: flex; justify-content: center; align-items: center; border-radius: 50%; color: white;
}
.social-links a:hover { background: var(--accent-color); }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; color: #dcdde1; }

/* Floating Buttons */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px; background: var(--primary-color); color: white;
    width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 1.5rem; cursor: pointer;
    box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: var(--transition); z-index: 99;
}
#back-to-top.show { opacity: 1; visibility: visible; }
#back-to-top:hover { background: var(--accent-color); transform: translateY(-5px); }

.floating-wa {
    position: fixed; bottom: 30px; left: 30px; background: #25D366; color: white;
    width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 2rem; box-shadow: var(--shadow-lg); z-index: 99; transition: var(--transition);
}
.floating-wa:hover { transform: scale(1.1); }

/* Animasi Scroll */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.appear { opacity: 1; transform: translateY(0); }
.fade-in-up { animation: slideUp 1s ease-out forwards; }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-content h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .header-actions .btn { display: none; }
    .hamburger { display: block; }
    
    .nav-menu {
        position: fixed; top: -100%; left: 0; flex-direction: column; background-color: var(--secondary-color);
        width: 100%; text-align: left; transition: 0.3s; box-shadow: var(--shadow-md); padding: 30px 0; gap: 0;
        max-height: 80vh; overflow-y: auto;
    }
    .nav-menu.active { top: 70px; }
    
    .nav-link { color: var(--text-color); display: block; padding: 15px 25px; border-bottom: 1px solid var(--border-color); }
    .nav-link::after { display: none; }
    
    header .logo-text, header #dark-mode-toggle, header #print-btn { color: var(--text-color); }
    header .hamburger .bar { background-color: var(--text-color); }
    
    /* Perbaikan Mobile Dropdown */
    .dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none !important; /* Disembunyikan dulu di mobile, nunggu diklik */
        background-color: rgba(0,0,0,0.03) !important;
        padding: 0 !important;
        margin-top: 0 !important;
        min-width: 100%;
    }
    
    body.dark-mode .dropdown-menu {
        background-color: rgba(255,255,255,0.03) !important;
    }
    
    .dropdown.active .dropdown-menu {
        display: block !important;
    }
    
    .dropdown-menu a {
        padding: 12px 25px 12px 40px !important;
        border-bottom: 1px solid var(--border-color);
    }
    
    .hero-container { grid-template-columns: 1fr; text-align: center; padding-top: 50px; }
    .hero-buttons { justify-content: center; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .timeline-horizontal { flex-direction: column; gap: 30px; }
    .timeline-connector { transform: rotate(90deg); }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-logo, .social-links { justify-content: center; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2rem; }
    .search-form { flex-direction: column; }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    header, footer, .hero, .banner-carousel, .floating-wa, #back-to-top, .search-section, .video-profil {
        display: none !important;
    }
    body { background-color: white; color: black; }
    .container { width: 100%; margin: 0; }
    .card-layanan, .berita-card { page-break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}