/*
 * Website Desa - Main CSS File
 * Design: Modern Formal
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary Colors - Hijau Pemerintahan */
    --hijau-tua: #2D5016;
    --hijau-tua-rgb: 45, 80, 22;
    --hijau-sedang: #4A7C2C;
    --hijau-sedang-rgb: 74, 124, 44;
    --hijau-muda: #7FB069;
    --hijau-muda-rgb: 127, 176, 105;
    --hijau-muda-light: #E8F5E9;

    /* Neutral Colors */
    --putih: #FFFFFF;
    --abu-terang: #F5F5F5;
    --abu-sedang: #E0E0E0;
    --abu-gelap: #2C3E50;
    --abu-text: #616161;

    /* Accent Colors */
    --merah-indonesia: #C62828;
    --merah-indonesia-rgb: 198, 40, 40;
    --kuning-warning: #FBC02D;
    --biru-info: #1976D2;
    --hijau-success: #388E3C;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;600;700&display=swap');

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--abu-gelap);
    font-weight: 400;
    background-color: var(--putih);
}

h1, h2, h3, h4, h5, h6,
.heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--abu-gelap);
    margin-bottom: 1rem;
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

.text-lg { font-size: 1.125rem; }
.text-base { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.font-light { font-weight: 300; }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Mobile Typography */
@media (max-width: 768px) {
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.75rem; }
    h3, .h3 { font-size: 1.5rem; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--hijau-tua);
    color: var(--putih);
}

.btn-primary:hover {
    background: var(--hijau-sedang);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--putih);
}

.btn-outline-primary {
    background: transparent;
    color: var(--hijau-tua);
    border: 2px solid var(--hijau-tua);
}

.btn-outline-primary:hover {
    background: var(--hijau-tua);
    color: var(--putih);
}

.btn-danger {
    background: var(--merah-indonesia);
    color: var(--putih);
}

.btn-danger:hover {
    background: #B71C1C;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--putih);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--putih);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card-accent {
    border-top: 3px solid var(--hijau-sedang);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.card-no-hover:hover {
    transform: none;
}

.card-header {
    padding: 20px;
    background: var(--hijau-muda-light);
    border-bottom: 1px solid var(--abu-sedang);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    background: var(--abu-terang);
    border-top: 1px solid var(--abu-sedang);
}

/* ============================================
   ICONS
   ============================================ */
.icon-box {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hijau-muda-light);
    border-radius: var(--radius-lg);
    color: var(--hijau-tua);
    font-size: 32px;
    margin-bottom: 16px;
}

.icon-box-sm {
    width: 48px;
    height: 48px;
    font-size: 24px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--hijau-sedang);
    color: var(--putih);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--hijau-tua);
    color: var(--putih);
}

.badge-danger {
    background: var(--merah-indonesia);
    color: var(--putih);
}

.badge-success {
    background: var(--hijau-success);
    color: var(--putih);
}

.badge-warning {
    background: var(--kuning-warning);
    color: var(--abu-gelap);
}

.badge-info {
    background: var(--biru-info);
    color: var(--putih);
}

/* ============================================
   SECTIONS
   ============================================ */
section {
    padding: 60px 0;
}

@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hijau-tua);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--hijau-sedang);
}

.section-subtitle {
    color: var(--abu-text);
    font-size: 1rem;
    margin-top: 20px;
}

/* Background Variants */
.bg-light-green {
    background-color: var(--hijau-muda-light);
}

.bg-dark-green {
    background-color: var(--hijau-tua);
    color: var(--putih);
}

.bg-gray {
    background-color: var(--abu-terang);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--putih);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 80, 22, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .hero-section {
        height: 350px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   QUICK ACCESS CARDS
   ============================================ */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 992px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .quick-access-grid {
        grid-template-columns: 1fr;
    }
}

.quick-access-card {
    text-align: center;
    padding: 30px 20px;
    transition: all var(--transition-base);
}

.quick-access-card:hover {
    transform: translateY(-5px);
}

.quick-access-card i {
    font-size: 48px;
    color: var(--hijau-tua);
    margin-bottom: 16px;
}

.quick-access-card h5 {
    color: var(--hijau-tua);
    font-weight: 600;
    margin-bottom: 10px;
}

.quick-access-card p {
    color: var(--abu-text);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ============================================
   BERITA / NEWS CARDS
   ============================================ */
.berita-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 992px) {
    .berita-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .berita-grid {
        grid-template-columns: 1fr;
    }
}

.berita-card {
    position: relative;
}

.berita-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.berita-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.berita-meta {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    color: var(--abu-text);
    margin-bottom: 10px;
}

.berita-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.berita-excerpt {
    color: var(--abu-text);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   UMKM CARDS
   ============================================ */
.umkm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 992px) {
    .umkm-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .umkm-grid {
        grid-template-columns: 1fr;
    }
}

.umkm-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.umkm-card:hover img {
    transform: scale(1.05);
}

/* ============================================
   LAYANAN ACCORDION
   ============================================ */
.layanan-item {
    margin-bottom: 16px;
    border: 1px solid var(--abu-sedang);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.layanan-header {
    background: var(--putih);
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-base);
}

.layanan-header:hover {
    background: var(--hijau-muda-light);
}

.layanan-header.active {
    background: var(--hijau-muda-light);
    border-bottom: 1px solid var(--abu-sedang);
}

.layanan-icon {
    width: 40px;
    height: 40px;
    background: var(--hijau-muda-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hijau-tua);
}

.layanan-body {
    padding: 20px;
    background: var(--abu-terang);
    display: none;
}

.layanan-body.show {
    display: block;
}

.persyaratan-list {
    list-style: none;
    padding: 0;
}

.persyaratan-list li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
}

.persyaratan-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--hijau-success);
}

/* ============================================
   STRUKTUR ORGANISASI
   ============================================ */
.struktur-tree {
    text-align: center;
}

.struktur-item {
    display: inline-block;
    margin: 20px;
    text-align: center;
}

.struktur-foto {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hijau-sedang);
    margin-bottom: 10px;
}

.struktur-kepala .struktur-foto {
    width: 150px;
    height: 150px;
    border-color: var(--hijau-tua);
    border-width: 4px;
}

.struktur-nama {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.struktur-jabatan {
    font-size: 14px;
    color: var(--abu-text);
}

/* ============================================
   FOOTER
   ============================================ */
.footer a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer h5, .footer h6 {
    color: var(--putih);
}

.footer iframe {
    width: 100%;
    height: 150px;
    border: none;
    border-radius: var(--radius-md);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
#backToTop {
    box-shadow: var(--shadow-lg);
}

#backToTop:hover {
    transform: translateY(-3px);
}

/* ============================================
   NAVBAR CUSTOMIZATION
   ============================================ */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    transition: all var(--transition-base);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--putih);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
}

.dropdown-item {
    padding: 10px 20px;
    transition: all var(--transition-base);
}

.dropdown-item:hover {
    background: var(--hijau-muda-light);
    color: var(--hijau-tua);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary-custom {
    color: var(--hijau-tua) !important;
}

.text-muted {
    color: var(--abu-text) !important;
}

.shadow-custom-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-custom-md {
    box-shadow: var(--shadow-md);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}
