/* ==========================================================================
   THEME: DESA KANDANGAN (PESANGGARAN, BANYUWANGI)
   PALETTE: BIRU & KUNING EMAS
   ========================================================================== */

:root {
  --primary-color: #0d47a1;
  --primary-hover: #1565c0;
  --primary-dark: #002171;
  
  --accent-color: #fbc02d;
  --accent-hover: #f9a825;
  
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --white: #ffffff;
  --border-color: #e2e8f0;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(13, 71, 161, 0.08);
  --shadow-lg: 0 10px 25px rgba(13, 71, 161, 0.15);
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Top Bar */
.top-bar {
  background-color: var(--primary-dark);
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 2px solid var(--accent-color);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-badge {
  background: rgba(251, 192, 45, 0.2);
  color: var(--accent-color);
  border: 1px solid rgba(251, 192, 45, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 8px var(--accent-color);
}

/* Header & Nav */
.navbar-header {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  transition: var(--transition);
}

.header-logo-img.logo-circle {
  border-radius: 50%;
}

.header-logo-img:hover {
  transform: scale(1.06);
}

.logo-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.1;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-item {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--primary-color);
}

.btn-admin-nav {
  background-color: var(--primary-color);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-admin-nav:hover {
  background-color: var(--primary-hover);
  color: var(--white);
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(rgba(0, 33, 113, 0.88), rgba(13, 71, 161, 0.92)), url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 4.5rem 0;
  text-align: center;
  border-bottom: 4px solid var(--accent-color);
}

.hero-tag {
  display: inline-block;
  background: rgba(251, 192, 45, 0.2);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.hero-section p {
  font-size: 1.05rem;
  color: #e2e8f0;
}

/* General Section */
section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: 800;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent-color);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* CAROUSEL / SLIDER BERITA */
.slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--accent-color);
  background: var(--primary-dark);
}

.slider-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

.slide-item {
  min-width: 100%;
  position: relative;
  height: 450px;
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 2rem 2rem;
  background: linear-gradient(transparent, rgba(0, 33, 113, 0.95));
  color: var(--white);
}

.slide-caption h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.slide-caption p {
  font-size: 0.95rem;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-color);
  color: var(--primary-dark);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.slider-btn:hover {
  background: var(--white);
  color: var(--primary-color);
  scale: 1.1;
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

.slider-dots {
  position: absolute;
  bottom: 15px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--accent-color);
  width: 28px;
  border-radius: 10px;
}

/* GRID CARD BERITA */
.news-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.news-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
}

.news-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-color);
  color: var(--accent-color);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.news-card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.news-card-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.8rem;
}

/* Modal UI & Admin Panel Tabs */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  border-top: 5px solid var(--accent-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 { color: var(--primary-color); }

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-logout {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-logout:hover {
  background: #dc2626;
}

/* Password Toggle Eye Icon */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
}

.btn-toggle-password:hover {
  color: var(--primary-color);
}

/* Tabs Panel Admin */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-tab {
  flex: 1 1 auto;
  padding: 0.6rem 0.6rem;
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-tab.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.admin-tab-content {
  display: none;
  text-align: left;
}

/* Container List Items Admin */
.admin-news-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-light);
}

.admin-news-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.admin-news-info {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.admin-news-info strong {
  font-size: 0.85rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-news-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-delete-news {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-news:hover {
  background: #dc2626;
}

/* Cards & Tables UI */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.news-tag {
  display: inline-block;
  background: rgba(13, 71, 161, 0.1);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border-left: 3px solid var(--accent-color);
}

.table-responsive {
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
}

.custom-table th {
  background: var(--primary-color);
  color: var(--white);
  padding: 1rem;
  border-bottom: 3px solid var(--accent-color);
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.form-container {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--accent-color);
  max-width: 650px;
  margin: 0 auto;
}

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 700; color: var(--primary-color); margin-bottom: 0.4rem; }
.form-control { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); }

.btn-submit {
  width: 100%;
  background: var(--accent-color);
  color: var(--primary-dark);
  border: none;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover { background: var(--accent-hover); }

/* Tombol Khusus WhatsApp Aspirasi */
.btn-submit.btn-wa {
  background: #25D366;
  color: #ffffff;
}

.btn-submit.btn-wa:hover {
  background: #1eb957;
}

/* Video YouTube Section */
.video-section {
  background-color: var(--bg-light);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  background-color: #000000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card-body {
  padding: 1rem;
}

.video-card-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.3;
}

/* Google Maps Styling */
.map-container {
  width: 100%;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--accent-color);
  overflow: hidden;
}

/* Link WhatsApp Footer */
.wa-link {
  color: #93c5fd;
  text-decoration: none;
  transition: var(--transition);
}

.wa-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Footer */
.footer-main {
  background: var(--primary-dark);
  color: #93c5fd;
  border-top: 4px solid var(--accent-color);
  padding: 3rem 0 1.5rem;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-brand h3 { color: var(--accent-color); }

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .slide-item { height: 320px; }
  .slide-caption h3 { font-size: 1.1rem; }
  .navbar { flex-direction: column; gap: 1rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .admin-tabs { flex-wrap: wrap; }
}