/* ================================================================
   style.css - Global styles, tema "Transparan White Bersih"
   Dipakai di semua halaman (login.css & admin.css menambah di atasnya)
   ================================================================ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.7);
  --border: rgba(15, 23, 42, 0.08);
  --text: #1c2233;
  --muted: #6b7280;
  --accent: #4f7cff;
  --accent-2: #7c5cff;
  --accent-soft: #eef2ff;
  --danger: #ef4444;
  --success: #22c55e;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.10);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

.hidden { display: none !important; }

/* ---------- Fade in animation ---------- */
.fade-in {
  animation: fadeIn 0.7s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 20px;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-accent { color: var(--accent); }

.nav-chips {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.nav-right { position: relative; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
}
.user-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.user-dropdown.open { display: flex; }
.dropdown-item {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.dropdown-item:hover { background: var(--accent-soft); color: var(--accent); }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px 32px 8px;
}
.hero-card {
  border-radius: var(--radius-lg);
  padding: 32px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease;
}
.hero-card:hover { transform: translateY(-3px); }
.hero-card h2 { margin: 0; font-size: 24px; }
.hero-card p { margin: 0; opacity: 0.9; font-size: 14px; max-width: 320px; }
.hero-cta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero-card-a { background: linear-gradient(135deg, #4f7cff, #2f4bcf); }
.hero-card-b { background: linear-gradient(135deg, #7c5cff, #d84fd0); }

/* ================================================================
   CONTENT SECTIONS / CARDS
   ================================================================ */
.content { padding: 20px 32px 60px; }
.content-section { margin-bottom: 36px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h3 { margin: 0; font-size: 19px; }
.see-all { font-size: 13px; font-weight: 600; color: var(--accent); }

.card-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}
.card-row::-webkit-scrollbar { height: 6px; }
.card-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.media-card {
  flex: 0 0 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: left;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.media-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: var(--accent-soft);
}
.media-card-body { padding: 12px; }
.media-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-date { font-size: 12px; color: var(--muted); }

.page-title { padding: 8px 0 20px; }
.page-title h1 { margin: 0 0 6px; font-size: 26px; }
.page-title p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.grid-card { flex: none; }

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
}

/* ================================================================
   MODAL
   ================================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
  padding: 20px;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.modal.open .modal-box { transform: scale(1); }
.modal-box img { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-body { padding: 20px; }
.modal-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.modal-body h3 { margin: 8px 0 10px; font-size: 20px; }
.modal-body p { margin: 0; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.85);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   TOAST
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 720px) {
  .navbar { flex-wrap: wrap; padding: 14px 18px; }
  .nav-chips { order: 3; width: 100%; justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; padding: 20px 18px 4px; }
  .content { padding: 16px 18px 40px; }
  .user-name { display: none; }
}
