/* =========================================================
   IPDN Kalbar - Info App
   Tema: Material Design ala Android, mobile-first
   ========================================================= */

:root {
  --primary: #0D47A1;
  --primary-dark: #08306B;
  --primary-light: #5472D3;
  --accent: #FFC107;
  --bg: #F1F3F6;
  --surface: #FFFFFF;
  --text-primary: #1C1C1E;
  --text-secondary: #6B7280;
  --divider: #E5E7EB;
  --success: #2E7D32;
  --danger: #C62828;
  --radius: 14px;
  --shadow-1: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: 76px; /* ruang untuk bottom nav */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ---------- APP BAR ---------- */
.app-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-2);
}

.app-bar .title-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-bar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-bar .subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.app-bar .icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  font-size: 18px;
  flex-shrink: 0;
}
.app-bar .icon-btn:active { background: rgba(255,255,255,0.3); }
.back-btn { margin-right: 4px; }

/* ---------- CONTENT ---------- */
.content { padding: 16px; }
.content.no-pad-top { padding-top: 0; }

/* ---------- CARD ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-body { padding: 16px; }

/* ---------- BERITA / INFORMASI CARD ---------- */
.info-card { display: block; }
.info-card .thumb {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #DCE3EE;
}
.info-card .thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.info-card .badge-row {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #E3EAFD;
  color: var(--primary);
}
.badge.orange { background: #FFF3CD; color: #8A6300; }
.badge.gray { background: #EEF0F3; color: var(--text-secondary); }
.badge.green { background: #E1F0E2; color: var(--success); }
.badge.red { background: #FBE3E3; color: var(--danger); }

.info-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.35;
}
.info-card p.excerpt {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-secondary);
}

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  display: flex;
  z-index: 30;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 0 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.bottom-nav a .icon { font-size: 21px; display: block; margin-bottom: 2px; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  bottom: 88px;
  right: calc(50% - 240px + 20px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #3A2E00;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-2);
  z-index: 25;
}
@media (max-width: 520px) {
  .fab { right: 20px; }
}

/* ---------- FORM ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  font-size: 14.5px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { min-height: 140px; resize: vertical; }
select.form-control { appearance: none; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.btn:active { background: var(--primary-dark); }
.btn.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--danger); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- LOGIN PAGE ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 55%, #061B3C 100%);
}
.login-logo {
  text-align: center;
  color: #fff;
  margin-bottom: 32px;
}
.login-logo .emblem {
  width: 76px; height: 76px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
}
.login-logo h2 { margin: 0; font-size: 19px; font-weight: 700; }
.login-logo p { margin: 4px 0 0; font-size: 12.5px; opacity: 0.85; }

.login-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: var(--shadow-2);
}
.login-card h3 { margin: 0 0 18px; font-size: 16px; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert.error { background: #FBE3E3; color: var(--danger); }
.alert.success { background: #E1F0E2; color: var(--success); }

.demo-hint {
  margin-top: 18px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  line-height: 1.6;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- LIST ROW (users/bagian admin) ---------- */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: 600; font-size: 14.5px; }
.list-row .sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.list-row .actions { display: flex; gap: 8px; }
.list-row .actions a { font-size: 12px; color: var(--primary); font-weight: 600; }
.list-row .actions a.del { color: var(--danger); }

/* ---------- DETAIL INFORMASI ---------- */
.detail-photo {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 14px;
  object-fit: cover;
  max-height: 260px;
}
.photo-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.photo-gallery img {
  width: 110px; height: 110px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.detail-title { font-size: 20px; font-weight: 700; line-height: 1.4; margin: 4px 0 8px; }
.detail-content { font-size: 14.5px; line-height: 1.8; color: #333; white-space: pre-line; }

/* ---------- TOP TABS (filter bagian) ---------- */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 16px 14px;
}
.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--divider);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- STAT GRID (dashboard superadmin) ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 22px 0 10px;
  color: var(--text-primary);
}

.file-hint { font-size: 11.5px; color: var(--text-secondary); margin-top: 6px; }

/* ---------- MODAL KONFIRMASI (pengganti alert/confirm bawaan browser) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  animation: modal-slide-up 0.18s ease-out;
}
@keyframes modal-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 520px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 18px; padding: 22px 20px; }
}

.modal-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #FBE3E3;
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.modal-message {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; margin: 0; }
