/* ============================================================
   assets/css/style.css — cra.my.id
   ============================================================ */

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

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080812;
  --surface:   #0f0f1e;
  --card:      #14142a;
  --card2:     #1a1a35;
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);
  --primary:   #7c3aed;
  --primary-l: #a78bfa;
  --accent:    #06b6d4;
  --grad:      linear-gradient(135deg, #7c3aed, #06b6d4);
  --grad-text: linear-gradient(135deg, #a78bfa, #38bdf8);
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --success:   #10b981;
  --danger:    #ef4444;
  --warn:      #f59e0b;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,.45);
  --glow:      0 0 30px rgba(124,58,237,.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-l); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 99px; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4 { font-weight: 700; line-height: 1.25; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s ease; white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,.6); color:#fff; }
.btn-secondary {
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--card); border-color: var(--primary); color: var(--text); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: rgba(16,185,129,.15); color: var(--success); border: 1px solid rgba(16,185,129,.3); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Cards / Glass ───────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Form elements ───────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-size: .875rem; font-weight: 500; color: var(--muted); }
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.2); }
.form-control::placeholder { color: var(--muted); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .875rem; font-weight: 500; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-info    { background: rgba(6,182,212,.12); border: 1px solid rgba(6,182,212,.3); color: #67e8f9; }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 600;
}
.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-muted   { background: rgba(148,163,184,.1); color: var(--muted); }
.badge-primary { background: rgba(124,58,237,.2); color: var(--primary-l); }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: rgba(8,8,18,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  font-size: 1.25rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.navbar-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--muted); font-size: .875rem; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-link:hover, .nav-link.active { background: rgba(124,58,237,.15); color: var(--primary-l); }

/* ── Dashboard layout ────────────────────────────────────── */
.dash-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .875rem; font-weight: 500;
  transition: all .2s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(124,58,237,.15); color: var(--primary-l);
}
.sidebar-link .icon { font-size: 1.1rem; }
.sidebar-sep { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.dash-main { flex: 1; padding: 32px; overflow-y: auto; }

/* ── Stats cards ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── File table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing:.05em; padding: 10px 16px; border-bottom: 1px solid var(--border); text-align: left; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody td { padding: 12px 16px; vertical-align: middle; }
.file-name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.file-icon { font-size: 1.2rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Upload area ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: all .2s; position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary); background: rgba(124,58,237,.05);
}
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-zone h3 { font-size: 1.1rem; margin-bottom: 6px; }
.upload-zone p  { color: var(--muted); font-size: .875rem; }

/* ── Progress ────────────────────────────────────────────── */
.progress { background: var(--surface); border-radius: 99px; height: 8px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s ease; }

/* ── Hero (landing) ──────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 24px 60px;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .18;
  animation: blobFloat 8s ease-in-out infinite alternate;
}
.blob-1 { width: 500px; height: 500px; background: var(--primary); top: -120px; left: -120px; }
.blob-2 { width: 400px; height: 400px; background: var(--accent); bottom: -100px; right: -100px; animation-delay: 2s; }
.blob-3 { width: 300px; height: 300px; background: #ec4899; top: 40%; left: 40%; animation-delay: 4s; }

@keyframes blobFloat { 0%{transform:translate(0,0) scale(1)} 100%{transform:translate(30px,20px) scale(1.05)} }

.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.3);
  padding: 6px 16px; border-radius: 99px;
  font-size: .8rem; font-weight: 600; color: var(--primary-l);
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin-bottom: 16px; }
.hero p  { font-size: 1.1rem; color: var(--muted); margin-bottom: 40px; max-width: 480px; margin-inline: auto; }

/* ── Service cards (landing) ─────────────────────────────── */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }
.service-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: all .3s; position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity .3s;
}
.service-card:hover { border-color: var(--border2); transform: translateY(-4px); box-shadow: var(--glow); }
.service-card:hover::before { opacity: 1; }
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }
.service-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.service-card p  { color: var(--muted); font-size: .875rem; margin-bottom: 20px; }

/* ── Shortlink result ────────────────────────────────────── */
.result-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 14px;
}
.result-box .result-url { flex: 1; font-size: .875rem; color: var(--primary-l); word-break: break-all; }
.copy-btn { flex-shrink: 0; }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: radial-gradient(ellipse at 20% 50%, rgba(124,58,237,.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(6,182,212,.08) 0%, transparent 60%);
}
.login-card { width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo span { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo p { color: var(--muted); font-size: .875rem; margin-top: 4px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal { background: var(--card); border: 1px solid var(--border2); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 480px; transform: scale(.96); transition: transform .2s; }
.modal-backdrop.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--card2); border-radius: 99px; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; bottom: 3px; left: 3px;
  background: var(--muted); border-radius: 50%; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { text-align: center; padding: 32px 24px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); margin-top: auto; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary-l); }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); min-width: 240px; max-width: 360px;
  animation: slideInRight .25s ease;
}
.toast.success { border-color: rgba(16,185,129,.4); }
.toast.error   { border-color: rgba(239,68,68,.4); }
@keyframes slideInRight { from{transform:translateX(110%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .sidebar { display: none; }
  .dash-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Hamburger ───────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text); padding: 6px; border-radius: var(--radius-sm);
  transition: background .2s;
}
.hamburger:hover { background: rgba(255,255,255,.06); }
.hamburger svg { display: block; }

/* Mobile nav drawer */
.mobile-nav-backdrop {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.mobile-nav-backdrop.open { display: block; }

.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: 260px; background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.mobile-nav-backdrop.open .mobile-nav {
  transform: translateX(0);
}
.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.mobile-nav-header span {
  font-size: 1rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.mobile-nav-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px;
}
.mobile-nav-close:hover { color: var(--text); }

.mobile-nav-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  margin-bottom: 16px; font-size: .875rem; font-weight: 500;
}
.mobile-nav-sep {
  border: none; border-top: 1px solid var(--border);
  margin: 10px 0;
}
.mobile-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .875rem; font-weight: 500;
  transition: all .2s; margin-bottom: 2px;
  background: none; border: none; cursor: pointer;
  width: 100%; text-decoration: none;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  background: rgba(124,58,237,.15); color: var(--primary-l);
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  /* Sembunyikan items navbar di mobile karena sudah masuk hamburger */
  .navbar-nav { display: none; }
  .sidebar { display: none; }
  .dash-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-sm     { font-size: .8rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
