/* ==========================================================
   Reality Bot — Shared Visual System (V3 Premium Complete)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg-raised: #111116;
  --surface: rgba(28, 28, 36, 0.85);
  --surface-soft: #16161c;
  --border: #303038;
  --border-soft: #26262e;
  --text: #f4f1e8;
  --text-dim: #9c9ca8;
  --text-faint: #6b6b76;
  --accent: #ff4d6d;
  --accent-dim: #ff4d6d1a;
  --accent-strong: #ff2a4f;
  --violet: #7c5cfc;
  --violet-dim: #7c5cfc1a;
  --success: #3ddc97;
  --success-dim: #3ddc9719;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Background diatur transparan agar video terlihat */
  background: transparent;
}

body {
  min-height: 100vh;
  position: relative;
}

h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
a { color: inherit; }
::selection { background: var(--accent); color: #0a0a0f; }

/* ---------- Background Video & Layering ---------- */
#bg-video {
  position: fixed; top: 0; left: 0; 
  width: 100%; height: 100%;
  object-fit: cover; 
  object-position: right center; /* Karakter di kanan tetap kelihatan di desktop */
  z-index: 0; 
  opacity: 0.4; 
  pointer-events: none;
}

body::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.6) 0%, rgba(10, 10, 15, 0.9) 100%);
  z-index: 1; 
  pointer-events: none;
}

/* Semua konten halaman harus di z-index 2 ke atas */
.shell, .page, .topbar, .layout, .footer-credit, .admin-layout, .login-wrap {
  position: relative;
  z-index: 2;
}

/* ---------- Footer Credit ---------- */
.footer-credit {
  position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: var(--text-faint); z-index: 10; text-align: center;
  background: rgba(10, 10, 15, 0.8); padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border-soft); backdrop-filter: blur(8px);
}
.footer-credit a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- Tombol Musik Latar ---------- */
.music-btn {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 100;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.2s ease;
}
.music-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.music-btn svg { width: 20px; height: 20px; }
.music-btn.playing { background: var(--accent); color: #fff; border-color: var(--accent); }

.music-notif {
  position: fixed; top: 1.5rem; right: 5rem; z-index: 100;
  background: rgba(255, 77, 109, 0.9); color: #fff; padding: 0.6rem 1rem;
  border-radius: 12px; font-size: 0.8rem; font-weight: 600; display: none;
}

/* ---------- Focus & Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Primitives ---------- */
.surface {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.field {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--text-faint); }
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #12060a;
  box-shadow: 0 8px 24px -8px rgba(255, 77, 109, 0.55);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(255, 77, 109, 0.65);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-faint);
}

.btn-success {
  background: var(--success);
  color: #06231a;
}
.btn-success:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }

.btn-sm { padding: 0.55rem 0.95rem; font-size: 0.78rem; }
.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(255, 77, 109, 0.3);
  color: var(--accent);
}
.btn-danger-ghost:hover { background: var(--accent-dim); }

/* ---------- Spinner & Alerts ---------- */
.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.alert-error {
  background: var(--accent-dim);
  color: #ff8fa3;
  border: 1px solid rgba(255, 77, 109, 0.3);
}
.alert-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

/* ---------- Live-signal & Status ---------- */
.live-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.live-dot.is-live { background: var(--accent); }
.live-dot.is-live::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: pulse-ring 1.8s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
}
.status-pill.is-live {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(255, 77, 109, 0.3);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Data Table (Admin/Dashboard) ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th, .data-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.data-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td { color: var(--text); }
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tr:last-child td { border-bottom: none; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }