/* =========================================
    1. KONFIGURASI DASAR & VARIABEL
   ========================================= */
:root {
    --kodim-dark: #1b2614;
    --kodim-green: #2d3a26;
    --matahari-gold: #ffcc00;
    --white: #ffffff;
    --bg-light: #f4f7f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Open Sans', sans-serif; scroll-behavior: smooth; }
body { background-color: var(--bg-light); color: #333; overflow-x: hidden; }

/* =========================================
    2. NAVIGASI UTAMA (DESKTOP & GLOBAL)
   ========================================= */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8%; background: var(--kodim-dark); color: white;
    position: sticky; top: 0; z-index: 9999;
}

.logo { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.2rem; }
.logo span { color: var(--matahari-gold); }

.nav-links { display: flex; list-style: none; align-items: center; }
.nav-links li { position: relative; }
.nav-links li a {
    display: block; padding: 15px 20px; color: white;
    text-decoration: none; font-weight: 600; transition: 0.3s; cursor: pointer;
}

/* --- SISTEM DROPDOWN --- */
.dropdown-menu {
    position: absolute; top: 90%; left: 0;
    background: white; min-width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-top: 3px solid var(--matahari-gold);
    list-style: none; padding: 8px 0; z-index: 1000;
    border-radius: 0 0 8px 8px;
    /* Animasi */
    visibility: hidden; opacity: 0; transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}

.dropdown-menu.show-menu { visibility: visible; opacity: 1; transform: translateY(5px); pointer-events: auto; }

/* Sub-dropdown (Cucu) - Gaya Accordion */
.dropdown-menu .dropdown-menu {
    position: static !important; display: none;
    background: #f8f9f6; box-shadow: none; border-top: none; border-left: 3px solid #eee;
}
.dropdown-menu .dropdown-menu.show-menu { display: block !important; }

.dropdown-menu li a {
    color: var(--kodim-green) !important; font-weight: 500; font-size: 0.85rem;
    padding: 12px 25px !important; border-bottom: 1px solid #f0f0f0;
}
.dropdown-menu li a:hover { background-color: #f5f5f5; padding-left: 30px !important; }

.arrow { display: inline-block; transition: transform 0.3s ease; font-size: 0.8rem; margin-left: 5px; }
.rotate { transform: rotate(180deg); }

/* =========================================
    3. RESPONSIVE MOBILE (NAVIGASI)
   ========================================= */
.menu-toggle { display: none; flex-direction: column; cursor: pointer; gap: 6px; z-index: 10001; }
.bar { width: 30px; height: 3px; background-color: var(--matahari-gold); border-radius: 3px; transition: 0.3s; }

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .nav-links {
        position: fixed; top: 0; right: -100%; height: 100vh; width: 75%;
        background-color: var(--kodim-dark); flex-direction: column;
        justify-content: flex-start; align-items: flex-start; padding: 80px 0 40px 0;
        transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); backdrop-filter: blur(10px);
        z-index: 10000; overflow-y: auto;
    }
    .nav-links.active { right: 0; }
    .nav-links li { width: 100%; }
    .nav-links li a { font-size: 1.1rem; padding: 18px 30px; border-bottom: 1px solid rgba(255,255,255,0.05); }

    /* Feedback Warna Mobile */
    .nav-links li a:active, .nav-links li a:hover { background-color: var(--matahari-gold) !important; color: var(--kodim-dark) !important; }
    
    .nav-links .dropdown-menu {
        position: static !important; width: 100%; opacity: 1; visibility: visible; transform: none;
        background-color: rgba(255, 255, 255, 0.05) !important; border-left: 4px solid var(--matahari-gold) !important;
        display: none;
    }
    .nav-links .dropdown-menu.show-menu { display: block !important; }
    .nav-links .dropdown-menu li a { color: var(--white) !important; padding: 15px 45px !important; }
    
    .btn-login { display: block; width: 85%; margin: 20px auto; text-align: center; }
}

/* =========================================
    4. HERO & FEATURES
   ========================================= */
.hero { height: 65vh; background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1532938911079-1b06ac7ceec7?q=80&w=1500') center/cover; }
.hero-overlay { height: 100%; display: flex; align-items: center; padding: 0 8%; color: white; }
.hero-content h1 { font-family: 'Montserrat', sans-serif; font-size: 3rem; margin: 10px 0; }
.hero-content h1 span { color: var(--matahari-gold); }
.unit-tag { color: var(--matahari-gold); font-weight: bold; letter-spacing: 2px; font-size: 0.9rem; }

.features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; padding: 0 8%; margin-top: -60px; z-index: 10; position: relative;
}
.feature-card {
    background: white; padding: 40px; border-radius: 15px; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); transition: 0.3s;
}
.feature-card:hover { transform: translateY(-10px); }
.feature-card.highlighted { background: var(--kodim-green); color: white; }
.feature-icon { font-size: 3rem; margin-bottom: 15px; }

/* =========================================
    5. TABLE & FORM
   ========================================= */
.schedule-section { padding: 80px 8% 40px; }
.section-title { text-align: center; margin-bottom: 40px; font-family: 'Montserrat', sans-serif; color: var(--kodim-dark); text-transform: uppercase; }
.table-wrapper { background: white; border-radius: 12px; overflow-x: auto; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.responsive-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.responsive-table th { background: var(--kodim-dark); color: var(--matahari-gold); padding: 18px; text-align: left; }
.responsive-table td { padding: 18px; border-bottom: 1px solid #eee; }

.reg-section { padding: 60px 8%; background: #e9ede5; }
.container-reg { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; }
.reg-box { background: white; flex: 1; min-width: 320px; max-width: 500px; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.reg-header { padding: 25px; text-align: center; color: white; }
.reg-header.dark { background: var(--kodim-dark); }
.reg-header.gold { background: #f39c12; }
.army-form { padding: 30px; display: flex; flex-direction: column; gap: 15px; }
.army-form input, .army-form select { padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; }

/* =========================================
    6. LOKASI & PETA (INTEGRATED)
   ========================================= */
.location-section { 
    padding: 60px 8%; 
    background-color: #f8f9fa; 
}

.location-card { 
    display: grid; 
    grid-template-columns: 1fr 1.5fr; 
    background: white; 
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
}

.location-info { 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

/* Badge Unit di atas judul lokasi */
.unit-badge {
    display: inline-block;
    background-color: var(--kodim-green);
    color: var(--matahari-gold);
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    width: fit-content;
    border-left: 3px solid var(--matahari-gold);
}

/* List Detail Alamat */
.location-details {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.location-details li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #444;
    font-weight: 600;
}

.location-details li::before {
    content: "📍"; 
    position: absolute;
    left: 0;
    color: var(--kodim-green);
}

/* Box Peta */
.map-box iframe { 
    width: 100%; 
    height: 100%; 
    min-height: 400px; 
    border: none; 
    display: block;
}

/* Penyesuaian Responsif */
@media (max-width: 992px) { 
    .location-card { 
        grid-template-columns: 1fr; 
    } 
    
    .location-info {
        padding: 30px;
    }

    .map-box iframe { 
        min-height: 300px; 
    } 
}

/* =========================================
    7. GALERI & MODAL
   ========================================= */
.gallery-section { padding: 80px 8%; background: var(--white); }

.gallery-subtitle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: var(--kodim-green);
    border-bottom: 2px solid var(--matahari-gold);
    display: inline-flex;
    padding-bottom: 5px;
}

/* Grid Foto */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-item:hover img { transform: scale(1.1); }

.photo-desc {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(27, 38, 20, 0.8);
    color: var(--matahari-gold);
    padding: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
}

/* Galeri Video */
.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.video-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.video-card p {
    margin-top: 15px;
    font-weight: bold;
    color: var(--kodim-dark);
    text-align: center;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* Rasio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

/* Responsivitas Mobile */
@media (max-width: 768px) {
    .gallery-section { padding: 50px 5%; }
}

/* =========================================
   LIGHTBOX MODAL STYLE
   ========================================= */
.modal {
    display: none; /* Sembunyi secara default */
    position: fixed;
    z-index: 10002; /* Di atas navbar */
    padding-top: 100px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content-wrapper {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
}

.modal-content {
    width: 100%;
    border-radius: 10px;
    border: 3px solid var(--matahari-gold);
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: var(--matahari-gold);
    padding: 15px 0;
    font-weight: bold;
    font-size: 1.2rem;
}

.close-modal {
    position: absolute;
    top: 30px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover { color: var(--matahari-gold); }

/* Animasi Zoom Modal */
.modal-content, #caption {
    animation-name: zoom;
    animation-duration: 0.4s;
}

/* Tombol Navigasi Slide */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 20px;
    margin-top: -50px;
    color: var(--matahari-gold);
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    user-select: none;
    text-decoration: none;
    z-index: 10003;
}

.next { right: 20px; border-radius: 3px 0 0 3px; }
.prev { left: 20px; border-radius: 0 3px 3px 0; }

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Sembunyikan panah jika di mobile agar tidak menutupi gambar */
@media (max-width: 600px) {
    .prev, .next { font-size: 30px; padding: 10px; }
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

@media (max-width: 768px) {
    .modal-content-wrapper { width: 95%; }
}

/* =========================================
    8. FOOTER & TOMBOL UTAMA
   ========================================= */
.btn-login {
    background-color: transparent; border: 2px solid var(--matahari-gold); color: var(--matahari-gold) !important;
    padding: 8px 25px; border-radius: 5px; font-weight: bold; text-transform: uppercase; transition: 0.3s;
}
.btn-login:hover { background-color: var(--matahari-gold); color: var(--kodim-green) !important; }

.btn-reg-dark { background: var(--kodim-green); color: white; border: none; padding: 16px; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-reg-gold { background: var(--matahari-gold); color: var(--kodim-dark); border: none; padding: 16px; border-radius: 8px; cursor: pointer; font-weight: bold; }

footer { background: var(--kodim-dark); color: #777; text-align: center; padding: 50px 8%; }

/* =========================================
    9. REBOOT: CLASS BTN-PRIMARY (COMMANDER STYLE)
   ========================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--matahari-gold);
    color: var(--kodim-dark) !important; /* Paksa teks tetap gelap */
    padding: 16px 35px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 0px #b8962d; /* Bayangan solid di bawah agar tampak 3D */
    position: relative;
    top: 0;
    margin-top: 10px;
}

/* Efek saat Mouse Hover (Desktop) */
.btn-primary:hover {
    background-color: #f7c600;
    transform: translateY(-5px); /* Naik sedikit */
    box-shadow: 0 6px 0px #b8962d; /* Bayangan menebal */
}

/* Efek saat Ditekan (Click/Tap) */
.btn-primary:active {
    transform: translateY(2px); /* Turun seperti memencet tombol asli */
    box-shadow: 0 0px 0px #b8962d; /* Bayangan hilang */
    top: 2px;
}

/* Penyesuaian Mobile */
@media (max-width: 768px) {
    .btn-primary {
        width: 100%; /* Lebar penuh di layar HP */
        padding: 18px 20px;
        font-size: 0.95rem;
    }
}

/* =========================================
    10. Pagination Styling Custom
   ========================================= */
/* Merapikan Link Pagination Laravel agar menyatu dengan tema */
.pagination-container nav svg { width: 20px; }
.pagination-container nav div:first-child { display: none; }
.pagination-container nav div:last-child { box-shadow: none; border-radius: 10px; overflow: hidden; }

@media (max-width: 768px) {
    .news-header { text-align: center; justify-content: center; }
    .news-header h2 { font-size: 1.5rem; }
    .news-header div { align-items: center; display: flex; flex-direction: column; }
}

/* Mengatur jarak paragraf di dalam artikel agar tidak rapat */
.article-body p { margin-bottom: 25px; }
.article-body h2, .article-body h3 { 
    font-family: 'Montserrat', sans-serif; 
    color: var(--kodim-dark); 
    margin-top: 40px; 
    margin-bottom: 20px; 
    text-transform: uppercase;
    font-weight: 800;
}
@media (max-width: 768px) {
    h1 { font-size: 1.8rem !important; }
    .article-body { padding: 25px !important; font-size: 1.05rem !important; }
}

/* Efek Interaksi */
.info-card-wrapper:hover .info-card {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--kodim-green);
}
.info-card-wrapper:hover .icon-circle {
    background: var(--kodim-green) !important;
    color: white !important;
    transform: rotate(-10deg) scale(1.1);
}
.info-card-wrapper:hover .card-bar {
    transform: scaleX(1);
}
.info-card-wrapper:hover h4 {
    color: var(--kodim-green) !important;
}

@media (max-width: 768px) {
    h2 { font-size: 1.7rem !important; }
    .info-card { padding: 35px 20px !important; }
}

/* DOCUMENTS */
.doc-row:hover {
    background-color: #fcfdfc !important;
}
.doc-row:hover span {
    color: var(--kodim-green) !important;
}

/* Custom Styling untuk Galeri */
.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    background: #f0f0f0;
}
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--kodim-dark) 0%, rgba(13, 55, 30, 0.4) 50%, transparent 100%);
    opacity: 0;
    transition: 0.4s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    text-decoration: none;
}
.gallery-item:hover .gallery-img { transform: scale(1.15); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* Pagination Style */
.pagination { display: flex; gap: 8px; justify-content: center; list-style: none; margin-top: 50px; }
.page-item .page-link { padding: 12px 20px; background: white; border-radius: 12px; color: var(--kodim-dark); font-weight: 800; text-decoration: none; border: 1px solid #eee; }
.page-item.active .page-link { background: var(--kodim-green); color: white; border-color: var(--kodim-green); }