/* ============================================================
   URLKING Cloud Console — Premium Dark SaaS Theme
   (var names preserved for workers.html compatibility)
   ============================================================ */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #8b5cf6;
  --bg: #070b14;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-solid: #0e1626;
  --bg-card: rgba(148, 163, 184, 0.06);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -10px rgb(0 0 0 / 0.55);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,0.16) 0%, rgba(139,92,246,0.16) 100%);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 15% -5%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(ellipse 45% 35% at 90% 0%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 45% at 50% 110%, rgba(99, 102, 241, 0.07), transparent 65%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(99, 102, 241, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* ============ TOPBAR ============ */
.uk-topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.logo {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}

.logo-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 19px;
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.6);
}

.logo-text { font-size: 20px; font-weight: 800; letter-spacing: 0.4px; color: var(--text); }
.logo-text span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.uk-topbar-right { display: flex; align-items: center; gap: 12px; }

.pill-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.pill-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.link-quiet {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit;
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: 0.18s;
}
.link-quiet:hover { color: var(--text); background: var(--bg-card); }

/* ============ LAYOUT ============ */
.container { max-width: 1080px; margin: 0 auto; padding: 34px 22px 70px; }

/* ============ HERO ============ */
#promoSection {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 90% at 85% 10%, rgba(139, 92, 246, 0.18), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 52px 46px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}
#promoSection::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148,163,184,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 80% at 60% 20%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 60% 20%, black 20%, transparent 75%);
}

.promo-content { position: relative; z-index: 1; max-width: 620px; }
.promo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 2px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 7px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.promo-content h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800; line-height: 1.12; letter-spacing: -1px;
  margin-bottom: 16px;
}
.promo-content h1 .grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.promo-content p { color: var(--text-muted); font-size: 16px; max-width: 540px; margin-bottom: 28px; }

/* ============ BUTTONS ============ */
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad);
  color: white; font-weight: 700; font-family: inherit;
  border: none; border-radius: var(--radius-sm);
  padding: 12px 22px; font-size: 14px; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.55);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}
.btn-cta:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 10px 26px -8px rgba(99, 102, 241, 0.65); }
.btn-cta:active:not(:disabled) { transform: translateY(0); }
.btn-cta:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 18px; font-size: 13.5px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: 0.18s;
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); transform: translateY(-1px); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  background: var(--red-soft); color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 8px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 700; font-size: 13px; font-family: inherit;
  transition: 0.18s;
}
.btn-danger:hover { background: var(--red); color: white; border-color: var(--red); transform: translateY(-1px); }

.btn-nav {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13.5px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: 0.18s;
}
.btn-nav:hover:not(:disabled) { background: rgba(148, 163, 184, 0.12); }
.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============ SECTION HEADERS ============ */
#filesSection { display: none; animation: rise 0.45s ease both; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.section-head .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.select-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.select-wrap > span { font-size: 11px; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; }
.select-wrap select {
  background: transparent; border: none; color: var(--text);
  font-weight: 600; font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer;
}
.select-wrap select option { background: var(--surface-solid); color: var(--text); }

/* ============ PANELS (Scanner / Workers) ============ */
.uk-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.3s ease both;
}
.uk-panel.violet { border-color: rgba(99, 102, 241, 0.4); }
.uk-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 12px;
}
.uk-panel-head h3 {
  font-size: 16.5px; font-weight: 800;
  display: flex; align-items: center; gap: 9px;
}
.uk-panel-head h3.violet { color: #a5b4fc; }
.uk-panel-head h3.emerald { color: #6ee7b7; }
.uk-panel-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.panel-inline-form { display: flex; gap: 8px; flex: 1; min-width: 280px; max-width: 460px; }
.panel-inline-form input { flex: 1; }

/* ============ SCAN PROGRESS ============ */
.scan-status-text { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }

.progress-track {
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px; height: 10px; width: 100%;
  overflow: hidden; margin: 10px 0 4px;
}
.progress-fill {
  background: var(--grad);
  height: 100%; width: 0%;
  border-radius: 999px;
  transition: width 0.45s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ============ LIST ITEMS (files / infected / workers) ============ */
.uk-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.list-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: 0.2s;
}
.list-row:hover { border-color: rgba(99, 102, 241, 0.45); background: rgba(99, 102, 241, 0.06); transform: translateY(-1px); }

.row-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: grid; place-items: center;
  font-size: 20px;
}

.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.row-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* Status chips inside rows */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.4px;
  padding: 4px 10px; border-radius: 999px;
}
.chip.ok { background: var(--green-soft); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.35); }
.chip.bad { background: var(--red-soft); color: #fda4af; border: 1px solid rgba(244,63,94,0.35); }
.chip.warn { background: var(--amber-soft); color: #fcd34d; border: 1px solid rgba(245,158,11,0.35); }

/* Infected row variant */
.list-row.danger { background: var(--red-soft); border-color: rgba(244, 63, 94, 0.3); }
.list-row.danger:hover { border-color: rgba(244, 63, 94, 0.55); background: rgba(244, 63, 94, 0.16); }
.list-row.danger .row-title { color: #fecdd3; }
.list-row.danger .row-meta { color: #fda4af; }

/* All-safe banner */
.safe-banner {
  padding: 14px; text-align: center; border-radius: var(--radius-sm);
  background: var(--green-soft); border: 1px solid rgba(16,185,129,0.35);
  color: #6ee7b7; font-weight: 700; font-size: 13.5px;
}
.muted-banner {
  padding: 14px; text-align: center; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px dashed var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 13.5px; width: 100%;
}

/* ============ SKELETON LOADERS ============ */
.skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,0.06) 25%, rgba(148,163,184,0.14) 50%, rgba(148,163,184,0.06) 75%);
  background-size: 200% 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 70px;
  animation: sk 1.3s infinite;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ PAGINATION ============ */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 26px;
}
.page-info { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }

/* ============ MODALS ============ */
.uk-modal {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 7, 14, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 20px;
}
.uk-modal.open { display: flex; }

.uk-modal-card {
  width: 100%; max-width: 400px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.25s ease both;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.uk-modal-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.uk-modal-card .modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }

.field {
  text-align: left; margin-bottom: 18px;
}
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.field .hint { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }

.auth-input, .uk-input {
  width: 100%;
  background: rgba(7, 11, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 12px 15px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.auth-input::placeholder, .uk-input::placeholder { color: rgba(148, 163, 184, 0.55); font-weight: 500; }
.auth-input:focus, .uk-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}
.auth-input.left { text-align: left; }

select.uk-input { text-align-last: center; }
select.uk-input option { background: var(--surface-solid); color: var(--text); }

.btn-block { width: 100%; padding: 13px; font-size: 14.5px; }

.error-txt { display: none; color: #fda4af; font-size: 12.5px; font-weight: 700; margin-top: 12px; }

.link-btn {
  margin-top: 14px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 12.5px;
  font-family: inherit; text-decoration: underline;
}
.link-btn:hover { color: var(--text); }

/* ============ TOASTS ============ */
#toastBox {
  position: fixed; bottom: 22px; right: 22px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 44px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.28s ease both;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.out { animation: toastOut 0.25s ease both; }
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(24px); opacity: 0; } }

/* ============ FOOTER ============ */
.uk-footer {
  text-align: center; padding: 26px 0 8px;
  color: rgba(148, 163, 184, 0.55); font-size: 12px; font-weight: 600;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 48px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted);
}
.empty-state .big { font-size: 34px; margin-bottom: 10px; }
.empty-state p { font-weight: 600; font-size: 14px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .uk-topbar { padding: 0 16px; }
  .container { padding: 24px 14px 54px; }
  #promoSection { padding: 36px 24px; border-radius: 18px; }
  .uk-panel { padding: 16px; }
  .list-row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .panel-inline-form { min-width: 100%; }
  .pill-status.hide-sm { display: none; }
}

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