/* Custom CSS for Desa Kemangsen Website */
:root {
    --primary-color: #054b74;
    --secondary-color: #978c71;
    --accent-color: #0a4580; /* Digunakan dalam gradient */
    --text-color: #212121;
    --bg-color: #FAFAFA;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark-gray: #424242;
}

/* Reset dasar dan pengaturan font utama */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* --- Komponen Bootstrap Kustom --- */
.bg-primary { background-color: var(--primary-color) !important; }

.btn { 
    transition: all 0.22s cubic-bezier(.4,.0,.2,1);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 0 rgba(0,0,0,0.04);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(5,75,116,0.08); }

.btn-sm { padding: 0.28rem 0.6rem; font-size: 0.9rem; border-radius: 6px; }

.btn-primary {
    background-color: var(--primary-color);
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--white);
}
.btn-primary:hover { background-color: #073f5a; }

.btn-warning {
    background-color: var(--secondary-color);
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--white);
}
.btn-warning:hover { filter: brightness(0.95); }

/* Action buttons for admin table */
.btn-action { padding: 0.35rem 0.6rem; min-width: 64px; text-align: center; }
.btn-edit {
    background: linear-gradient(180deg,#ffb347,#ffcc33);
    color: #2b2b2b;
    border: none;
    box-shadow: 0 6px 14px rgba(255,140,0,0.12);
}
.btn-edit:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(255,140,0,0.16); }
.btn-delete {
    background: linear-gradient(180deg,#ff6b6b,#ff3b30);
    color: #fff;
    border: none;
    box-shadow: 0 6px 14px rgba(255,59,48,0.12);
}
.btn-delete:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(255,59,48,0.18); }

/* Small icon inside button */
.btn .icon { display: inline-flex; align-items: center; justify-content: center; }

/* Spacing for action column */
.actions { display: flex; gap: 0.5rem; justify-content: center; }

/* finer visual details */
.topbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.breadcrumb { color: rgba(0,0,0,0.6); font-size:0.95rem; }
.breadcrumb a { color: rgba(255,255,255,0.92); text-decoration:none; padding:6px 8px; border-radius:6px; background: transparent; transition: background .18s; }
.breadcrumb a:hover { background: rgba(255,255,255,0.04); }

.data-card .muted { color: #6b7180; font-size:0.95rem; }

table tbody tr:nth-child(even) td { background: #fbfdff; }
table tbody td small { display:block; color: #6b7280; font-size:0.85rem; }

.badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:0.8rem; font-weight:700; color:#fff; background:rgba(0,0,0,0.12); }
.badge.info { background: linear-gradient(90deg,#2b9bd9,#1b6fa3); }
.badge.warn { background: linear-gradient(90deg,#f6a623,#e07b00); }

/* subtle header shadow */
.content h2 { display:block; padding:6px 0 12px 0; border-bottom: 1px solid rgba(20,45,60,0.04); }

@media (max-width: 900px) {
    .sidebar { width: 200px; }
    .content { margin-left: 220px; padding: 20px; }
}

@media (max-width: 600px) {
    .sidebar { position: relative; width: 100%; height: auto; box-shadow: none; }
    .content { margin-left: 0; padding: 16px; }
    table thead { display: none; }
    table, table tbody, table tr, table td { display: block; width: 100%; }
    table tr { margin-bottom: 12px; }
    table td { text-align: right; padding-left: 50%; position: relative; }
    table td::before { content: attr(data-label); position: absolute; left: 14px; width: calc(50% - 28px); text-align: left; font-weight: 600; color: var(--dark-gray); }
}

/* ===============================
   NAVBAR – FINAL POSITIONING
================================ */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo kiri, menu kanan */
}

/* Logo + Nama Desa */
.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
}
.navbar-brand img {
    max-height: 40px;
}
.navbar-brand div div {
    font-size: 1rem;
    line-height: 1.1;
    color: #fff;
}
.navbar-brand div small {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}

/* Menu Umum + Panel Admin */
.navbar-nav {
    display: flex;
    align-items: center;
    margin-left: auto; /* Dorong semua menu ke kanan */
}

/* Menu Umum */
.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.75rem;
    color: #ffffff !important;
    transition: all 0.3s ease;
    position: relative;
}
.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Panel Admin tetap utuh */
.nav-admin {
    margin-left: 26px;
    padding-left: 26px;
    border-left: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
}
.nav-admin .nav-link {
    position: relative;
    font-weight: 700;
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.45);
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.15),
        rgba(255,255,255,0.05)
    );
    backdrop-filter: blur(6px);
    transition: all 0.35s ease;
}
.nav-admin .nav-link::before {
    content: "🔒";
    margin-right: 8px;
    font-size: 0.9rem;
}
.nav-admin .nav-link:hover {
    background: linear-gradient(
        135deg,
        rgba(255,215,0,0.25),
        rgba(255,215,0,0.12)
    );
    color: #ffeb3b !important;
    box-shadow:
        0 0 0 1px rgba(255,215,0,0.6),
        0 10px 30px rgba(0,0,0,0.35);
    transform: translateY(-2px);
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 991px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-nav {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-admin {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 10px;
    }

    .nav-admin .nav-link {
        width: 100%;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.3);
    }
}

/* ===============================
   HERO SECTION – FIX FINAL
================================ */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100svh; /* FIX untuk HP */
    background-image: url("balai-desa.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 120px 20px 60px;
    color: #fff;
    overflow: hidden;
}

/* Overlay */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0,0,0,0.55),
        rgba(0,0,0,0.7)
    );
    z-index: 1;
}

/* Konten */
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.hero-title {
    position: relative;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 30px;
    letter-spacing: 0.6px;
    z-index: 2;

    /* STROKE HITAM PALING AMAN */
    text-shadow:
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000,
         0 0 12px rgba(0,0,0,0.9);

    /* ANIMASI SCROLL HALUS */
    will-change: transform, opacity;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 100svh;
        padding-top: 100px;
        background-position: center top;
    }

    .hero-title {
        font-size: 2rem;
    }

    .profil-hero {
        padding: 18px;
    }
}

/* ===============================
   CARD DI DALAM HERO
================================ */
.vm-card,
.stat-card {
    background: rgba(255,255,255,0.92);
    color: #222;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Statistik */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

/* ===============================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 768px) {
    .hero-section {
        min-height: 100vh;
        padding-top: 24vh;

        /* PENTING → JANGAN CONTAIN */
        background-size: cover;
        background-position: center;
    }

    .hero-content {
        padding: 0 12px;
    }
}

/* ===============================
   ANIMASI
================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease-out 0.5s both;
}

/* --- Gaya Section Umum --- */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}
.section-subtitle {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

/* --- Kartu (Card) Umum --- */
.service-card, .news-card, .potential-card, .contact-info, .contact-form {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.service-card:hover, .news-card:hover, .potential-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* --- Kartu Layanan (Service Card) --- */
/* ===============================
   Layanan Horizontal – FINAL CLEAN
================================ */

/* Container horizontal */
.layanan-container {
    display: flex;
    gap: 20px;                 /* jarak antar kartu */
    padding-bottom: 10px;       /* biar scroll tidak menempel */
    overflow-x: auto;           /* scroll horizontal aktif */
    scroll-padding: 0 20px;

    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE 10+ */
}

.layanan-container::-webkit-scrollbar {
    display: none;               /* Chrome, Safari, Opera */
}

/* Kartu layanan */
.service-card {
    min-width: 300px;            /* ukuran kartu tetap horizontal */
    flex: 0 0 auto;              /* supaya tidak mengecil */
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 15px; 
    background: var(--white);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

/* Icon layanan */
.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon { 
    transform: scale(1.1); 
}

.service-icon i { 
    font-size: 2rem; 
    color: var(--white); 
}

/* Judul kartu */
.service-card h4 { 
    color: var(--primary-color); 
    margin-bottom: 1.5rem; 
    font-size: 1.5rem; 
}

/* List layanan */
.service-list { 
    list-style: none; 
    padding: 0; 
    margin-bottom: 2rem; 
    text-align: left; 
}

.service-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    list-style: none;
    border: none;
    text-decoration: none;
}

.service-list li i {
    margin-right: 0.5rem;
    color: #28a745; 
    text-decoration: none;
}

/* Kartu Modern */
.modern-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.modern-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.modern-card:hover .modern-icon {
    transform: rotate(8deg) scale(1.1);
}

.modern-icon i {
    font-size: 2.2rem;
    color: #fff;
}

/* --- Kartu Berita (News Card) --- */
.news-card { overflow: hidden; }
.news-image { position: relative; height: 200px; overflow: hidden; }
.news-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.news-card:hover .news-image img { transform: scale(1.05); }
.news-date {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem;
    border-radius: 10px;
    text-align: center;
    min-width: 60px;
}
.news-date .day { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.news-date .month { display: block; font-size: 0.8rem; text-transform: uppercase; }
.news-content { padding: 1.5rem; }
.news-content h5 { color: var(--primary-color); margin-bottom: 1rem; font-size: 1.3rem; }
.news-content p { color: var(--dark-gray); margin-bottom: 1.5rem; line-height: 1.6; }

.news-image img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.news-image img:hover {
    transform: scale(1.05);
}


/* Galeri Desa */
.potential-card {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.potential-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.potential-card .potential-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #054b74, #0a4580);
  color: #fff;
  border-radius: 50%;
  margin: 0 auto 15px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.potential-card:hover .potential-icon {
  background: linear-gradient(135deg, #0a4580, #054b74);
  transform: scale(1.1);
}

.potential-card h5 {
  font-weight: 600;
  margin-bottom: 10px;
}

.potential-card p {
  font-size: 0.95rem;
  color: #555;
}

/* ===== GALERI MODAL PREVIEW ===== */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.gallery-modal img {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-caption {
    margin-top: 15px;
    text-align: center;
    color: #fff;
}

.modal-caption h5 {
    font-weight: 600;
    margin-bottom: 5px;
}

.modal-caption p {
    font-size: 14px;
    opacity: 0.9;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 35px;
    color: #fff;
    cursor: pointer;
}


/* --- Kontak --- */
.contact-info, .contact-form { padding: 2rem; }
.contact-item { display: flex; align-items: center; margin-bottom: 1.5rem; }
.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}
.contact-icon i { color: var(--white); font-size: 1.2rem; }
.contact-item h6 { color: var(--primary-color); margin-bottom: 0.25rem; font-weight: 600; }
.contact-item p { color: var(--dark-gray); margin: 0; line-height: 1.5; }
.form-control, .form-select {
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(5, 75, 116, 0.25);
}

/* === Kritik & Saran === */
.kritik-card {
    background: #f9fbff;
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    transition: 0.3s ease;
}

.kritik-card:hover {
    background: #eef3ff;
}

.contact-form h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.contact-form p {
    color: var(--dark-gray);
    font-size: 0.95rem;
}

/* Form button */
.contact-form .btn-primary {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--accent-color)
    );
    border: none;
    border-radius: 10px;
    padding: 0.8rem;
    font-weight: 600;
    transition: 0.3s ease;
}

.contact-form .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Scroll list kritik */
.contact-form .overflow-auto {
    max-height: 320px;
}

/* Responsive kecil */
@media (max-width: 768px) {
    .contact-info,
    .contact-form {
        padding: 1.5rem;
    }
}

/* Modern Blue Footer */
footer {
    background: linear-gradient(135deg, #054b74, #0a4580); /* Gradasi biru */
    border-radius: 20px 20px 0 0; /* Hanya atas melengkung */
    padding: 3rem 0;
    margin-top: 4rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    color: #fff;
    position: relative;
    z-index: 10;
}

footer h5, footer h6 {
    color: #fff;
    font-weight: 600;
}

footer p, footer a {
    color: #e0e0e0;
}

footer a {
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #ffd700; /* warna emas saat hover */
}

footer .social-links a {
    width: 40px;
    height: 40px;
    background: #fff;
    color: #054b74 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

footer .social-links a:hover {
    transform: scale(1.1);
    background: #ffd700;
    color: #054b74 !important;
}

footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.3);
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    color: rgba(255,255,255,0.7);
}

/* --- Desain Responsif --- */
@media (max-width: 768px) {
    .hero-section { height: auto; min-height: 80vh; padding-top: 100px; background-attachment: scroll; }
    .section-title { font-size: 2rem; }
    .stat-card { padding: 1.5rem 1rem; }
    .stat-card h4 { font-size: 2rem; }
    .service-card, .contact-info, .contact-form { padding: 1.5rem; }
    .hero-stats { margin-top: 2rem; }
}

/* --- Scrollbar Kustom (Opsional) --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1b5e5e; }

/* --- PROFIL DESA DI HERO (FINAL) --- */
.profil-hero {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(6px);
    margin-bottom: 35px;
}

/* Judul Profil */
.profil-hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;

    /* Stroke hitam tipis */
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

/* Teks Profil */
.profil-hero-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #f1f1f1;

    /* Stroke hitam tipis */
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

/* =====================================================
   STRUKTUR PEMERINTAHAN DESA – FINAL BOSS
===================================================== */

#struktur-desa{
    background: transparent;
}

.diagram{
    width: 100%;
    max-width: 1200px;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

/* BARIS STRUKTUR */
.struktur-row{
    display:flex;
    justify-content:center;
    gap:36px;
    margin-top:36px;
    flex-wrap:wrap;
}

/* KOTAK */
.box{
    background:#ffffff;
    border-radius:16px;
    padding:16px 22px;
    display:flex;
    align-items:center;
    gap:16px;
    min-width:300px;

    border:2px solid rgba(5,75,116,.25);
    box-shadow:0 14px 30px rgba(5,75,116,.18);

    font-family:"Poppins", sans-serif;
    font-size:14px;

    transition:.35s ease;
}

.box:hover{
    transform:translateY(-6px) scale(1.03);
    box-shadow:0 25px 55px rgba(5,75,116,.35);
}

/* FOTO */
.box img{
    width:70px;
    height:90px;
    object-fit:cover;
    border-radius:10px;
    border:2px solid #054b74;
    background:#fff;
}

/* TEKS */
.box b{
    display:block;
    font-weight:700;
    color:#054b74;
    margin-bottom:4px;
}

/* TENGAH */
.center{
    justify-content:center;
    text-align:center;
}

/* GARIS */
.line-v{
    width:4px;
    height:38px;
    background:linear-gradient(180deg,#054b74,#0a4580);
    border-radius:8px;
    margin:18px auto;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .diagram{
        min-width:900px;
    }
}   

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .org-photo {
        height: 160px;
    }
}

/* --- Galeri Desa Modern --- */
.gallery-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.18);
}

.gallery-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    transition: 0.4s ease;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.05);
}

/* BAGIAN TEKS BAWAH GAMBAR */
.gallery-caption {
    padding: 15px 18px;
    text-align: center;
    background: #fff;
}

.gallery-caption h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #054b74;
    margin-bottom: 6px;
}

.gallery-caption p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

/* VISI MISI MODERN & RINGKAS */
.visi-misi-wrapper {
    margin-top: 25px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.vm-card {
    background: rgba(255, 255, 255, 0.65);
    padding: 25px 25px;
    width: 280px;
    border-radius: 18px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
    text-align: center;
    transition: .3s;
    border: 1px solid rgba(255,255,255,0.4);
}

.vm-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.18);
}

.vm-icon {
    font-size: 32px;
    color: #0a5c83;
    margin-bottom: 10px;
}

.vm-card h4 {
    font-weight: 700;
    margin-bottom: 10px;
    color: #084d6b;
}

.vm-card p,
.vm-card ul li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #383838;
    margin: 0;
}

.vm-card ul {
    padding-left: 20px;
    text-align: left;
}

/* ===============================
   HERO STAT CARD - FINAL FIX
================================ */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;

    width: 100%;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 15px;

    align-items: stretch;
}

/* Kartu Statistik */
.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-radius: 18px;
    padding: 24px 20px;

    text-align: center;
    color: #ffffff;

    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);

    transition: all 0.35s ease;
}

.stat-card {
    opacity: 0;
    transform: translateY(40px);
    animation: statUp 0.9s ease-out forwards;
}

/* ANIMASI MUNCUL SATU-SATU */
.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.3s; }
.stat-card:nth-child(3) { animation-delay: 0.45s; }
.stat-card:nth-child(4) { animation-delay: 0.6s; }

@keyframes statUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon */
.stat-card i {
    font-size: 2.2rem;
    color: #1331d6;
    margin-bottom: 12px;
}

/* Angka */
.stat-card h4 {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 6px 0;
    line-height: 1.2;
}

/* Label */
.stat-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    letter-spacing: 0.3px;
}

/* Hover efek modern */
.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 22px 45px rgba(0,0,0,0.3);
}

/* ===============================
   RESPONSIVE STAT CARD
================================ */
@media (max-width: 992px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card h4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 20px 16px;
    }

    .stat-card h4 {
        font-size: 1.8rem;
    }
}

/* ===============================
   FLOATING ADMIN BUTTON – FINAL
================================ */
.admin-float {
    all: unset;
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 56px;
    height: 56px;

    background: #0d6efd;
    color: #ffffff;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    cursor: pointer;
    z-index: 999999;

    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    transition: 0.3s ease;
}

.admin-float i {
    font-size: 24px;
}

.admin-float:hover {
    background: #084298;
    transform: scale(1.1) rotate(90deg);
}
   
.admin-float i {
    font-size: 24px;
}

.admin-float:hover {
    background: #084298;
    transform: scale(1.1) rotate(90deg);
}
{
    font-size: 24px !important;
    cursor: pointer;
    z-index: 999999 !important;

    box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

.admin-float i {
    font-size: 24px !important;
}

.admin-float:hover {
    background: #084298 !important;
    transform: scale(1.1) rotate(90deg);
}

/* ==============================
   FONT & UMUM
============================== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f6f9;
    color: #222;
}

/* ==============================
   PROFIL DESA
============================== */
.profil-box {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: 30px;
    max-width: 900px;
    margin: auto;
    color: #fff;
}

.profil-box h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.profil-box p {
    font-size: 16px;
    line-height: 1.9;
    text-align: justify;
    margin-bottom: 15px;
}

/* Supaya nyaman di HP */
@media (max-width: 768px) {
    .profil-box {
        padding: 20px;
    }

    .profil-box h2 {
        font-size: 24px;
    }

    .profil-box p {
        font-size: 15px;
    }
}

/* ============================
   MOBILE RESPONSIVE FIX
   ============================ */
@media (max-width: 768px) {

  /* Navbar */
  .navbar-brand div {
    line-height: 1.2;
  }

  .navbar-nav {
    text-align: center;
  }

  /* Hero */
  .hero-section {
    padding-top: 120px;
    padding-bottom: 60px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .profil-hero-text {
    font-size: 0.95rem;
  }

  /* Visi Misi */
  .visi-misi-wrapper {
    flex-direction: column;
    gap: 20px;
  }

  .vm-card {
    width: 100%;
  }

  /* Statistik */
  .hero-stats {
    flex-direction: column;
    gap: 15px;
  }

  .stat-card {
    width: 100%;
  }

  /* Layanan */
  .layanan-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .layanan-container .col-lg-4 {
    min-width: 85%;
  }

  /* Struktur desa */
  .struktur-row {
    flex-direction: column;
    align-items: center;
  }

  .box {
    width: 90%;
    margin-bottom: 15px;
    text-align: center;
  }

  /* Galeri */
  .gallery-img {
    height: 220px;
    object-fit: cover;
  }

  /* Kontak */
  .contact-info,
  .contact-form {
    padding: 20px;
  }

  /* Footer */
  footer {
    text-align: center;
  }

  .footer-container .col-lg-4 {
    margin-bottom: 20px;
  }

  /* Floating admin button */
  .admin-float {
    bottom: 15px;
    right: 15px;
  }

  .service-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.layanan-container {
    justify-content: center;
}

/* =============================
   RESPONSIVE MOBILE FIX
============================= */
@media (max-width: 768px) {

    /* SECTION LAYANAN */
    #layanan .service-card {
        padding: 20px;
        text-align: center;
    }

    #layanan .service-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }

    #layanan h4 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    #layanan .service-list {
        padding-left: 0;
        text-align: left;
    }

    #layanan .service-list li {
        font-size: 14px;
        margin-bottom: 6px;
    }

    /* Biar kolom rapih */
    #layanan .col-lg-4 {
        margin-bottom: 20px;
    }

    /* HERO */
    .hero-title {
        font-size: 28px;
        line-height: 1.3;
    }

    .profil-hero-text {
        font-size: 14px;
    }

    /* VISI MISI */
    .vm-card {
        margin-bottom: 20px;
    }

    /* STAT */
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* GALERI */
    .gallery-img {
        height: 220px;
        object-fit: cover;
    }

    /* FOOTER */
    footer {
        text-align: center;
    }

    footer .social-links a {
        margin: 0 8px;
    }
}

/* =========================
   MOBILE RESPONSIVE FIX
========================= */
@media (max-width: 768px) {

    /* Navbar */
    .navbar-brand div {
        font-size: 14px;
        line-height: 1.2;
    }

    .navbar-toggler {
        border: none;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Hero */
    .hero-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .profil-hero-text {
        font-size: 14px;
    }

    /* Visi Misi */
    .visi-misi-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    /* Layanan */
    .service-card {
        padding: 20px;
        text-align: center;
    }

    .service-list {
        padding-left: 0;
    }

    .service-list li {
        font-size: 14px;
        text-align: left;
    }

    /* Statistik */
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stat-card {
        width: 100%;
    }

    /* Struktur Desa */
    .struktur-row {
        flex-direction: column;
        align-items: center;
    }

    .box {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Galeri */
    .gallery-card img {
        height: auto;
    }

    /* Footer */
    footer {
        text-align: center;
    }

    footer .row > div {
        margin-bottom: 20px;
    }
}

/* ===========================
   MOBILE CLEAN UI
=========================== */
@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    /* Navbar */
    .navbar-brand strong {
        font-size: 14px;
    }

    .navbar-brand small {
        font-size: 12px;
    }

    /* Hero */
    .hero-title {
        font-size: 22px;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .profil-hero-text {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Visi Misi */
    .visi-misi-wrapper {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .vm-card {
        padding: 18px;
        border-radius: 12px;
    }

    /* Layanan */
    #layanan .service-card {
        padding: 20px;
        border-radius: 14px;
        text-align: left;
    }

    #layanan h4 {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .service-list li {
        font-size: 14px;
        margin-bottom: 6px;
    }

    /* Statistik */
    .hero-stats {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
        border-radius: 12px;
    }

    /* Struktur */
    .struktur-row {
        flex-direction: column;
        gap: 15px;
    }

    .box {
        width: 100%;
        text-align: center;
        padding: 15px;
    }

    /* Galeri */
    .gallery-card img {
        border-radius: 12px;
    }

    /* Kontak */
    .contact-info,
    .contact-form {
        padding: 20px;
    }

    /* Footer */
    footer {
        text-align: center;
    }

    footer ul {
        padding-left: 0;
    }
}

/* =========================
   ANTI GESER KANAN-KIRI
========================= */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Pastikan semua elemen tidak keluar layar */
* {
    box-sizing: border-box;
}

/* Cegah row bootstrap bikin overflow */
.row {
    margin-left: 0;
    margin-right: 0;
}

/* Gambar tidak boleh lebih besar dari layar */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Card & section aman */
.service-card,
.box,
.stat-card,
.gallery-card {
    max-width: 100%;
    overflow: hidden;
}

/* =========================
   MOBILE CLEAN LAYOUT
========================= */
@media (max-width: 768px) {

    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    body {
        font-size: 14px;
    }

    /* ================= NAVBAR ================= */
    .navbar {
        padding: 8px 0;
    }

    .navbar-brand {
        font-size: 14px;
        line-height: 1.2;
    }

    .navbar-toggler {
        border: none;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    .navbar-collapse {
        background: #0d6efd;
        border-radius: 10px;
        margin-top: 10px;
        padding: 10px 0;
    }

    .navbar-nav .nav-link {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    /* ================= HERO ================= */
    .hero-title {
        font-size: 22px;
        line-height: 1.4;
        text-align: center;
    }

    .profil-hero-text {
        text-align: center;
        font-size: 14px;
    }

    /* ================= LAYANAN ================= */
    .service-card {
        padding: 18px;
        border-radius: 12px;
        margin-bottom: 15px;
    }

    .service-card h4 {
        font-size: 16px;
        text-align: center;
    }

    .service-list {
        padding-left: 0;
    }

    .service-list li {
        font-size: 14px;
        margin-bottom: 6px;
    }

    /* ================= STATISTIK ================= */
    .hero-stats {
        flex-direction: column;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
        border-radius: 12px;
    }

    /* ================= STRUKTUR ================= */
    .struktur-row {
        flex-direction: column;
        gap: 12px;
    }

    .box {
        width: 100%;
        padding: 15px;
    }

    /* ================= GALERI ================= */
    .gallery-card img {
        width: 100%;
        height: auto;
        border-radius: 10px;
    }

    /* ================= FOOTER ================= */
    footer {
        text-align: center;
        font-size: 13px;
    }
}
/* Navbar mobile agar sejajar */
.navbar .container {
    flex-wrap: nowrap !important;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-toggler {
    margin: 0;
    padding: 6px 10px;
    height: 40px;
    align-self: center;
}

@media (max-width: 768px) {

    /* Container struktur */
    #struktur-desa {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .struktur-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* Box tiap jabatan */
    .box {
        width: 100%;
        max-width: 220px;
        padding: 8px 6px;
        margin: 0 auto;
        text-align: center;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    }

    /* Foto */
    .box img {
        width: 65px;
        height: 65px;
        object-fit: cover;
        border-radius: 50%;
        margin-bottom: 6px;
    }

    /* Nama & jabatan */
    .box b {
        font-size: 12px;
        display: block;
        margin-bottom: 2px;
    }

    .box div {
        font-size: 11px;
        line-height: 1.3;
    }

    /* Garis penghubung */
    .line-v {
        height: 18px;
        margin: 6px auto;
    }
}

@media (max-width: 768px) {

    /* RESET TOTAL STRUKTUR */
    #struktur-desa,
    #struktur-desa .container,
    #struktur-desa .diagram {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* SEMUA BARIS JADI TENGAH */
    .struktur-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    /* BOX PERANGKAT */
    .box {
        width: 90% !important;
        max-width: 240px !important;
        margin: 8px auto !important;
        padding: 10px !important;
        text-align: center !important;
        position: static !important;
        transform: none !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    }

    /* FOTO */
    .box img {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        object-fit: cover;
        margin-bottom: 6px;
    }

    /* TEKS */
    .box b {
        font-size: 13px;
        display: block;
    }

    .box div {
        font-size: 12px;
        line-height: 1.3;
    }

    /* GARIS */
    .line-v {
        height: 14px;
        margin: 6px auto;
    }
}

@media (max-width: 768px) {

    .diagram {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        padding: 20px 10px !important;
        margin: 0 auto !important;
    }

    .struktur-row {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .box {
        width: 90% !important;
        max-width: 260px !important;
        margin: 10px auto !important;
        text-align: center;
    }
}
/* ============================
   NAVBAR MOBILE FINAL FIX
============================ */
@media (max-width: 768px) {

    /* Navbar jadi satu baris */
    .navbar .container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* Logo + teks */
    .navbar-brand {
        display: flex !important;
        align-items: center !important;
        gap: 8px;
        margin: 0;
    }

    /* Tombol (burger / admin) ke kanan */
    .navbar-toggler,
    .nav-admin {
        margin-left: auto !important;
    }
}

    /* Biar navbar tetap rapi */
    .navbar {
        padding: 10px 15px;
    }
}
/* ============================
   MOBILE RESPONSIVE FIX
============================ */

    /* Hilangkan sidebar */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        transition: 0.3s ease;
        z-index: 999;
    }

    /* Konten full layar */
    .content {
        margin-left: 0 !important;
        padding: 20px;
    }

    /* Topbar rapih */
    .topbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* Grid grafik jadi 1 kolom */
    .graph-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* Chart tidak melebar */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Ukuran font lebih nyaman */
    .topbar h2 {
        font-size: 20px;
    }

    .topbar p {
        font-size: 13px;
    }

    /* Tombol logout */
    .logout-btn {
        width: 100%;
        justify-content: center;
    }
}

}