/* ============================================================
   TnError VPN — style.css v2
   FIX: mobile hamburger nav, admin mobile topbar, spinner,
        result copy layout, scrollbar, ::selection
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #0b0f1a;
  --bg2:        #111827;
  --bg3:        #1a2236;
  --card:       rgba(255,255,255,.04);
  --card-hover: rgba(255,255,255,.07);
  --border:     rgba(255,255,255,.08);
  --text:       #e2e8f0;
  --muted:      #64748b;
  --accent:     #6366f1;
  --accent2:    #818cf8;
  --green:      #22c55e;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-w:  240px;
  --header-h:   64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Selection ─────────────────────────────────────────────── */
::selection { background: rgba(99,102,241,.35); color: #fff; }

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: clamp(22px, 4vw, 32px); font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: clamp(18px, 3vw, 24px); font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
a  { color: var(--accent2); text-decoration: none; }
a:hover { color: #fff; }
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .88em;
  background: rgba(99,102,241,.12);
  padding: 2px 7px;
  border-radius: 6px;
  word-break: break-all;
}
small, .meta { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
textarea { resize: vertical; min-height: 80px; }

/* ── Layout ─────────────────────────────────────────────────── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-alt { background: var(--bg2); }
.section-title { text-align: center; margin-bottom: 40px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: border-color .2s;
}
.card:hover { border-color: rgba(99,102,241,.25); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  white-space: nowrap;
}
.btn:hover   { background: var(--accent2); transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: rgba(255,255,255,.08); }
.btn.danger  { background: rgba(239,68,68,.2); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.btn.danger:hover { background: rgba(239,68,68,.35); }
.btn.small   { padding: 7px 13px; font-size: 12px; border-radius: 8px; }

/* ── Form ────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; }
input[type=text], input[type=password], input[type=email],
input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
select option { background: var(--bg2); }
.input-addon {
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}
.alert.ok  { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); color: #86efac; }
.alert.bad { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); color: #fca5a5; }

/* ── Badge / Pill ────────────────────────────────────────────── */
.badge, .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge.ok, .pill { background: rgba(34,197,94,.15); color: #4ade80; }
.badge.danger    { background: rgba(239,68,68,.15);  color: #f87171; }

/* ── Table ───────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { background: rgba(255,255,255,.03); color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.row-actions { display: flex; gap: 6px; align-items: center; }

/* ── Stat block ──────────────────────────────────────────────── */
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat b { display: block; font-size: 28px; font-weight: 800; color: var(--accent2); }
.stat span { font-size: 13px; color: var(--muted); }

/* ── Header / Nav ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(11,15,26,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text) !important; }
.brand-name { font-size: 17px; font-weight: 800; }
.brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.menu { display: flex; align-items: center; gap: 4px; }
.menu a {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px; font-weight: 500;
  transition: color .15s, background .15s;
}
.menu a:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ── Hamburger (mobile) ──────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Menu Drawer ──────────────────────────────────────── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 24px;
  color: var(--muted);
  font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--text); background: rgba(255,255,255,.04); }

/* ── Maintenance Banner ──────────────────────────────────────── */
.maintenance-banner {
  background: rgba(245,158,11,.12);
  border-bottom: 1px solid rgba(245,158,11,.25);
  color: #fcd34d;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 70px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,.18) 0%, transparent 70%);
  text-align: center;
}
.hero-sub { color: var(--muted); font-size: 17px; margin-top: 12px; }
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 32px;
}
.hero-stats .stat {
  background: none; border: none; padding: 0;
  min-width: 90px;
}
.hero-stats .stat b { font-size: 34px; }

/* ── Services Grid ───────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.service-card  { text-align: center; cursor: pointer; display: block; color: var(--text) !important; }
.service-icon  { font-size: 32px; margin-bottom: 10px; }
.service-name  { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.service-count { margin-top: 10px; font-size: 12px; color: var(--accent2); font-weight: 600; }

/* ── Steps ───────────────────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.step-card  { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step-num   {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p  { color: var(--muted); font-size: 14px; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tab  {
  padding: 8px 16px; border-radius: 99px;
  background: var(--bg3); color: var(--muted);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  transition: all .2s;
}
.tab:hover  { color: var(--text); background: rgba(255,255,255,.08); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Server Grid ─────────────────────────────────────────────── */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.server-card { display: flex; flex-direction: column; gap: 14px; }
.server-card.server-full { opacity: .65; }
.server-head { display: flex; align-items: center; gap: 12px; }
.flag { width: 40px; height: 28px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.server-meta { flex: 1; }
.server-name { font-weight: 700; font-size: 15px; }

/* Slot bar */
.slot-bar-wrap { display: flex; align-items: center; gap: 10px; }
.slot-bar { flex: 1; height: 5px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.slot-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.slot-fill.warn   { background: var(--yellow); }
.slot-fill.danger { background: var(--red); }

/* Server detail rows */
.server-detail { display: flex; flex-direction: column; gap: 6px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.detail-row span:first-child { color: var(--muted); }

/* ── Result grid (create / status page) ──────────────────────── */
.result-grid { display: flex; flex-direction: column; gap: 8px; }
.result-row  {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 10px;
  flex-wrap: wrap;
}
.result-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; min-width: 90px; }
.result-val-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.result-val { flex: 1; word-break: break-all; font-size: 13px; }

/* Copy button states */
.copy-btn { flex-shrink: 0; }

/* ── Loading spinner ─────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p + p { margin-top: 4px; }

/* ── Admin Layout ─────────────────────────────────────────────── */
.admin-body { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  padding: 20px 0;
  z-index: 200;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.admin-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.admin-nav-item:hover  { background: rgba(255,255,255,.06); color: var(--text); }
.admin-nav-item.active { background: rgba(99,102,241,.15); color: var(--accent2); }
.admin-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  max-width: 100%;
}
.admin-main h1 { margin-bottom: 24px; }

/* Admin mobile topbar — hidden on desktop */
.admin-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  align-items: center; justify-content: space-between;
}
.admin-mobile-nav {
  display: none;
  flex-direction: column;
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 250;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.admin-mobile-nav.open { display: flex; }
.admin-mobile-nav a {
  padding: 14px 20px;
  color: var(--muted);
  font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.admin-mobile-nav a:hover, .admin-mobile-nav a.active { color: var(--accent2); background: rgba(99,102,241,.08); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Public nav → hamburger */
  .menu     { display: none; }
  .hamburger { display: flex; }

  .grid2 { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 20px; }

  .server-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  /* Admin → hide sidebar, show topbar */
  .admin-sidebar { display: none; }
  .admin-topbar  { display: flex; }
  .admin-main    { margin-left: 0; padding: 20px 16px; margin-top: var(--header-h); }
}

@media (max-width: 600px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .wrap  { padding: 0 14px; }
  .hero  { padding: 50px 0 40px; }
  .section { padding: 40px 0; }
  .stat b  { font-size: 22px; }
  .hero-stats .stat b { font-size: 28px; }
  .tabs { gap: 6px; }
  .tab  { padding: 7px 12px; font-size: 12px; }
  .result-row { flex-direction: column; align-items: flex-start; }
  .result-label { min-width: unset; }
  .table th, .table td { padding: 8px 10px; }
  .row-actions { flex-wrap: wrap; }
  .btn.small { display: inline-flex; } /* override lama yang sembunyikan .btn.small di mobile */
}
