/* ============================================
   THEME VARIABLES — dikontrol lewat JS (mode + tema developer)
   ============================================ */
:root {
  --bg: 3, 7, 18;              /* base background (dark) */
  --surface: 11, 18, 36;       /* card/glass surface (dark) */
  --border: 30, 41, 59;        /* border (dark) */
  --text: 226, 232, 240;       /* text utama (dark) */
  --text-muted: 148, 163, 184; /* text sekunder (dark) */

  --accent: #0284c7;           /* dikustom developer */
  --radius-lg: 1.5rem;         /* dikustom developer (preset) */
  --radius-md: 0.9rem;         /* dikustom developer (preset) */
  --glass-blur: 14px;          /* dikustom developer */
}

[data-theme="light"] {
  --bg: 248, 250, 252;
  --surface: 255, 255, 255;
  --border: 226, 232, 240;
  --text: 15, 23, 42;
  --text-muted: 100, 116, 139;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  background: linear-gradient(135deg, rgb(var(--bg)) 0%, rgba(var(--surface), 0.9) 100%);
  color: rgb(var(--text));
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 9999px;
  filter: blur(40px);
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
  animation: none;
}

body::before {
  top: -70px;
  right: -70px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent) 0%, transparent 72%);
}

body::after {
  left: -70px;
  bottom: -70px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent) 0%, transparent 72%);
}

/* ============================================
   GLASS / SURFACE HELPERS
   ============================================ */
.glass {
  background: linear-gradient(145deg, rgba(var(--surface), 0.78), rgba(var(--surface), 0.6));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(var(--border), 0.72);
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.16);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}

.glass-strong {
  background: rgba(var(--surface), 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(var(--border), 0.95);
  box-shadow: 0 14px 36px rgba(2, 8, 23, 0.22);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.navbar-glass {
  background: rgba(var(--bg), 0.86);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* ============================================
   TEXT / BORDER HELPERS
   ============================================ */
.text-main { color: rgb(var(--text)); }
.text-subtle { color: rgb(var(--text-muted)); }
.text-accent { color: var(--accent); }
.border-app { border-color: rgba(var(--border), 1); }
.bg-app { background: rgb(var(--bg)); }
.placeholder-subtle::placeholder { color: rgba(var(--text-muted), 0.7); }

/* ============================================
   RADIUS HELPERS (preset dari developer)
   ============================================ */
.rounded-app-lg { border-radius: var(--radius-lg); transition: border-radius 0.3s ease; }
.rounded-app-md { border-radius: var(--radius-md); transition: border-radius 0.3s ease; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-accent {
  background: var(--accent);
  color: #fff;
  transition: filter 0.2s ease, transform 0.15s ease, background-color 0.3s ease;
}
.btn-accent:hover { filter: brightness(1.12); }
.btn-accent:active { transform: scale(0.97); }

.btn-outline-accent {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.btn-outline-accent:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.glow-accent {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
              0 6px 20px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: box-shadow 0.3s ease;
}

/* ============================================
   INPUT FIELDS
   ============================================ */
.input-field {
  background: rgba(var(--surface), 0.6);
  border: 1px solid rgba(var(--border), 1);
  color: rgb(var(--text));
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, background-color 0.3s ease;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent);
}
.input-field::placeholder {
  color: rgba(var(--text-muted), 0.7);
}

/* ============================================
   PAGE TRANSITIONS (ringan, cuma opacity+translate)
   ============================================ */
.page-enter {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.page-exit {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.1s ease, transform 0.1s ease;
}

/* ============================================
   MODAL TRANSITION (fade + scale ringan)
   ============================================ */
.modal-panel {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.modal-panel.modal-open {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   ROM STATUS BADGES
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.rom-list-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.rom-card {
  min-width: 0;
  margin-bottom: 0;
}

.rom-detail-card {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto 1rem;
}

.rom-detail-card .detail-banner {
  aspect-ratio: 16 / 8.8;
}

.status-stable {
  color: #dcfce7;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.35);
}

.status-beta {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.35);
}

.status-not-stable {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--border), 1); border-radius: 4px; }

/* ============================================
   FEEDBACK SCROLLBAR
   ============================================ */
.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(var(--border), 0.6);
  border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 768px) {
  .rom-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1.35rem;
  }

  .rom-card {
    min-height: 100%;
    transform: translateY(0);
  }
}

@media (min-width: 1024px) {
  .rom-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1280px) {
  .rom-list-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
/* ============================================
   READ MORE TRANSITION
   ============================================ */
#tabContentInfo .glass .max-h-\\[120px\\] {
  transition: max-height 0.4s ease;
}

#tabContentInfo .glass .max-h-\\[120px\\] button {
  transition: all 0.2s ease;
}

#tabContentInfo .glass .max-h-\\[120px\\]:not(.max-h-\\[120px\\]) {
  max-height: none !important;
}
/* ============================================
   FILTER BUTTONS
   ============================================ */
.filter-btn {
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent), 0.08);
}

/* Scrollbar untuk filter */
.scrollbar-thin::-webkit-scrollbar {
  height: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(var(--border), 0.5);
  border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}