/* ===== RzHost custom CSS — pelengkap Tailwind CDN ===== */
:root {
  --bg: #0a0a0a;
  --surface: #171717;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --primary: #fde047; /* yellow-300 */
  --primary-glow: #fef08a;
  --primary-foreground: #0a0a0a;
  --danger: #ef4444;
  --success: #10b981;
}

* { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
/* Cegah flicker tombol auth sebelum status user diketahui */
[data-guest-only], [data-user-only] { visibility: hidden; }
.auth-ready [data-guest-only], .auth-ready [data-user-only] { visibility: visible; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus, a:focus { outline: none; }
button:focus-visible, a:focus-visible, .btn:focus-visible, .menu-btn:focus-visible, .tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.18);
}

.bg-grid {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(253, 224, 71, 0.08) 1px, transparent 0);
  background-size: 32px 32px;
}

.glow {
  box-shadow: 0 0 40px -10px rgba(253, 224, 71, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-glow);
  box-shadow: 0 0 20px -5px rgba(253, 224, 71, 0.6);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }

.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  outline: none;
  transition: border 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.15);
}
label.lbl {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.card-hover { transition: all 0.2s ease; }
.card-hover:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-yellow { background: rgba(253, 224, 71, 0.15); color: var(--primary); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-gray { background: var(--surface-2); color: var(--text-muted); }

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 90vw;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0.5rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  min-width: 240px;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.5);
  animation: slideIn 0.2s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1.125rem;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary-foreground);
  font-weight: 900;
  box-shadow: 0 0 20px -5px rgba(253, 224, 71, 0.5);
}
.nav-links { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.nav-link i { width: 16px; text-align: center; font-size: 0.95rem; }
.nav-link:hover { color: var(--text); background: var(--surface-2); transform: translateY(-1px); }
.nav-link.active { color: var(--primary); background: var(--surface-2); }

/* User dropdown menu */
.user-menu { position: relative; display: inline-flex; }
.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu-trigger:hover { background: var(--surface); border-color: var(--primary); }
.user-menu-trigger > i { font-size: 0.95rem; color: var(--text-muted); }
.user-menu-trigger .user-menu-caret { font-size: 0.7rem; transition: transform 0.18s; }
.user-menu.open .user-menu-trigger .user-menu-caret { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.4);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 50;
}
.user-menu.open .user-menu-dropdown { display: flex; }
.user-menu-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.user-menu-item i { width: 16px; color: var(--text-muted); font-size: 0.875rem; }
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item:hover i { color: var(--primary); }
@media (max-width: 768px) {
  .user-menu { width: 100%; display: flex; flex-direction: column; }
  .user-menu-trigger { width: 100%; justify-content: space-between; }
  .user-menu-dropdown { position: static; box-shadow: none; margin-top: 0.35rem; width: 100%; }
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* Mobile menu toggle */
.menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 0.5rem; }
@media (max-width: 768px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem;
    gap: 0.4rem;
  }
  .nav-links.open { display: flex; animation: navSlideDown 0.22s ease-out; }
  .nav-links .nav-link { padding: 0.7rem 0.9rem; border-radius: 0.55rem; }
  .nav-links > div { margin-top: 0.35rem; padding-top: 0.6rem; border-top: 1px solid var(--border); flex-direction: column; align-items: stretch; width: 100%; }
  .site-header-inner { position: relative; }
}
@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  padding: 4rem 0;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Spec list */
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin: 1rem 0; }
.spec-item { display: flex; justify-content: space-between; font-size: 0.8125rem; }
.spec-item .k { color: var(--text-muted); }
.spec-item .v { color: var(--text); font-weight: 600; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tbl th, .tbl td { text-align: left; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab {
  padding: 0.625rem 1rem;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden !important; touch-action: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { padding: 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 0.5rem; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Global animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

main, .container > h1, .container > p { animation: fadeInUp 0.45s ease-out both; }
.card { animation: fadeInUp 0.4s ease-out both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

.modal-overlay.open { animation: fadeIn 0.2s ease-out; }
.modal-overlay.open .modal { animation: scaleIn 0.22s ease-out; }

.btn { transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn i { transition: transform 0.2s ease; }
.btn:hover:not(:disabled) i { transform: scale(1.12); }

.nav-link i, .user-menu-item i { transition: transform 0.2s ease; }
.nav-link:hover i, .user-menu-item:hover i { transform: scale(1.15); }

.toast { animation: scaleIn 0.2s ease-out, fadeIn 0.2s ease-out; }

.tab { transition: color 0.2s ease, border-color 0.2s ease; }
.tab:hover { color: var(--text); }

.badge { transition: transform 0.2s ease; }
.card:hover .badge { transform: scale(1.05); }

/* Pagination icon-only buttons */
.pagination-btn {
  width: 42px; height: 42px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.55rem;
  flex-shrink: 0;
}
.pagination-btn i { font-size: 1rem; }
@media (max-width: 768px) {
  .nav-auth-btn { width: 100%; padding: 0.7rem 0.9rem; font-size: 0.875rem; }
}
