/* --- Google Font Modern --- */
@import url("https://googleapis.com");

:root {
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #3b82f6 100%);
  --primary-color: #10b981;
  --primary-dark: #065f46;
  --primary-light: #ecfdf5;
  --bg-main: #f4f7f6;
  --sidebar-bg: #0f172a; /* Gelap Premium */
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --sidebar-width: 290px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px -10px rgba(16, 185, 129, 0.15);
}

/* --- Reset & Global --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* --- Layout Container --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar Kiri (Gaya Premium Dark) --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.sidebar-header {
  padding: 20px 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.logo-icon {
  font-size: 2.2rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 6px rgba(16, 185, 129, 0.2));
}

.sidebar-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

/* Tombol Navigasi Menu Rata Kiri */
.menu-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.menu-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
  padding-left: 25px;
}

.menu-btn:hover i {
  transform: scale(1.15);
}

/* Tombol Menu Aktif */
.menu-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.sidebar-footer {
  padding: 10px;
  font-size: 0.8rem;
  color: #475569;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

/* --- Area Konten Utama --- */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 50px;
  flex-grow: 1;
  width: calc(100% - var(--sidebar-width));
  transition: opacity 0.3s ease-in-out;
}

/* Judul Konten */
h2 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 5px;
  background: var(--primary-gradient);
  border-radius: 10px;
  margin-top: 6px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 35px;
}

/* --- Style Banner Foto Desa Atas Beranda --- */
.desa-banner-container {
  width: 100%;
  height: 350px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.desa-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.desa-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
}

/* --- Style Tulisan Nama Desa Tengah --- */
.desa-title-center {
  text-align: center;
  margin-top: 30px;
  padding: 10px;
}

.desa-title-center h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 5px;
}

.desa-title-center p {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Komponen Grid & Cards --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 25px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 25px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  margin-top: 25px;
}

.card {
  background: #ffffff;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-accent {
  border-top: 5px solid var(--primary-color);
}
.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Organisasi Struktur */
.org-card {
  text-align: center;
}
.main-leader {
  max-width: 340px;
  margin: 0 auto;
  background: var(--primary-light);
  border: 2px dashed var(--primary-color);
}

/* Statistik Penduduk */
.stats-card {
  text-align: center;
}
.stats-card h3 {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  justify-content: center;
  margin-bottom: 5px;
}

/* Grafik Mock */
.bar-chart-mock {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 25px;
}
.bar-item span {
  font-weight: 600;
  font-size: 0.9rem;
}
.bar {
  height: 16px;
  border-radius: 50px;
  background: #e2e8f0;
  margin-top: 6px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}
.bg-primary {
  background: var(--primary-gradient);
}
.bg-secondary {
  background: var(--accent-gradient);
}

/* UMKM & Badge Produk */
.product-card {
  display: flex;
  flex-direction: column;
}
.product-img {
    background: var(--primary-light);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--primary-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.product-card:hover .product-img {
  transform: scale(1.05);
}
.badge {
  align-self: flex-start;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50px;
  font-size: 0.8rem;
  margin-top: auto;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Galeri Foto Premium Grid */
.gallery-item-premium {
  position: relative;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.gallery-item-premium img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* bikin pas tanpa gepeng */
    object-position: center; /* fokus tengah gambar */
    display: block;
}
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0) 100%);
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}
.gallery-overlay p {
  color: white !important;
  font-weight: 700;
  font-size: 1.1rem;
}
.gallery-item-premium:hover img {
  transform: scale(1.1);
}
.gallery-item-premium:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Formulir Interaktif & Input */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  background: #f8fafc;
  transition: all 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
.btn-submit {
  padding: 16px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.text-primary {
  color: var(--primary-color);
}
.text-center {
  text-align: center;
}

/* --- Sistem Animasi Fade In Lembut --- */
.tab-animation {
  animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsif Mobile Layar Lebar --- */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 15px;
  }
  .sidebar-header {
    margin-bottom: 5px;
  }
  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  .menu-btn {
    padding: 10px 16px;
    white-space: nowrap;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 25px;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
