/* ==========================================================================
   CDN — Dark Theme Stylesheet
   Color Palette:
     --bg-primary    #0a0a0a   (deepest black)
     --bg-secondary  #111111
     --bg-tertiary   #1a1a1a   (cards)
     --bg-elevated   #222222
     --accent        #4a9eff   (interactive blue)
     --accent-hover  #6ab4ff
     --danger        #ef4444
     --success       #22c55e
   ========================================================================== */

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

/* ---------- Reset & Base ---------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: #4a9eff; text-decoration: none; }
a:hover { color: #6ab4ff; }

/* ---------- Scrollbars ---------- */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------- Abstract Animated Background ---------- */

.abstract-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0a0a0a;
  pointer-events: none;
  contain: strict;
  isolation: isolate;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  will-change: transform;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.shape-1 {
  width: 650px; height: 650px;
  background: radial-gradient(circle, #4a9eff 0%, rgba(74,158,255,0) 70%);
  top: -220px; left: -120px;
  animation: drift1 22s ease-in-out infinite;
}
.shape-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #7c3aed 0%, rgba(124,58,237,0) 70%);
  bottom: -120px; right: -80px;
  animation: drift2 28s ease-in-out infinite;
}
.shape-3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6,182,212,0) 70%);
  top: 45%; left: 55%;
  animation: drift3 32s ease-in-out infinite;
}
.shape-4 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139,92,246,0) 70%);
  bottom: -180px; left: 25%;
  animation: drift4 26s ease-in-out infinite;
}

@keyframes drift1 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  33%     { transform: translate3d(120px,60px,0) scale(1.08); }
  66%     { transform: translate3d(-40px,110px,0) scale(0.92); }
}
@keyframes drift2 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  33%     { transform: translate3d(-80px,-40px,0) scale(1.12); }
  66%     { transform: translate3d(60px,-80px,0) scale(0.88); }
}
@keyframes drift3 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(-100px,60px,0) scale(1.1); }
}
@keyframes drift4 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  40%     { transform: translate3d(80px,-50px,0) scale(1.06); }
  70%     { transform: translate3d(-60px,40px,0) scale(0.94); }
}

/* Dashboard uses subtler background */
.dashboard-bg .shape { opacity: 0.06; }

/* ---------- Login Page ---------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.login-card {
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

.login-header { text-align: center; margin-bottom: 36px; }

.login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #4a9eff 0%, #7c3aed 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(74,158,255,0.25);
}
.login-logo svg { width: 28px; height: 28px; color: #fff; }

.login-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

/* ---------- Form Inputs ---------- */

.input-group {
  position: relative;
  margin-bottom: 28px;
}

.input-group input {
  width: 100%;
  padding: 14px 0;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  outline: none;
  transition: border-color .3s ease;
}

.input-group input:focus { border-bottom-color: #4a9eff; }

.input-group label {
  position: absolute;
  top: 14px; left: 0;
  font-size: 15px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: -10px;
  font-size: 12px;
  color: #4a9eff;
  font-weight: 500;
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #4a9eff 0%, #3b82f6 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .3s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,158,255,0.3);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary.loading .btn-text { opacity: 0; }
.btn-primary.loading .btn-loader { display: block; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #e0e0e0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.06); }

.btn-danger {
  color: #ef4444;
}
.btn-danger:hover {
  color: #fff;
  background: rgba(239,68,68,0.15);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.btn-icon:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---------- Loader ---------- */

.btn-loader {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  position: absolute;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login Error / Lockout ---------- */

.login-error,
.login-lockout {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn .3s ease;
}

.login-error.visible,
.login-lockout.visible { display: block; }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
}

.login-lockout {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  color: #fcd34d;
}

/* ---------- Shake Animation ---------- */

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(6px); }
}

.shake { animation: shake .4s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* =====================================================================
   DASHBOARD LAYOUT
   ===================================================================== */

.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(10,10,10,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.nav-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #4a9eff, #7c3aed);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.nav-brand-icon svg { width: 18px; height: 18px; color: #fff; }

/* ---------- Dashboard Grid ---------- */

.dashboard-layout {
  display: flex;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(14,14,14,0.9);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 20px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
}

.folder-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
}
.tree-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.tree-item.active { background: rgba(74,158,255,0.12); color: #4a9eff; }
.tree-item svg { flex-shrink: 0; width: 16px; height: 16px; opacity: 0.6; }
.tree-item.active svg { opacity: 1; }

.tree-children { padding-left: 16px; }

/* ---------- Main Content ---------- */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .2s, background .2s;
}
.breadcrumb-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.breadcrumb-item:last-child { color: #fff; font-weight: 500; }

.breadcrumb-sep {
  color: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
}
.breadcrumb-sep svg { width: 14px; height: 14px; }

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- File Grid ---------- */

.file-grid-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.file-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
  user-select: none;
  position: relative;
}
.file-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.file-icon {
  width: 48px; height: 48px;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
}
.file-card:hover .file-icon { color: rgba(255,255,255,0.7); }
.file-icon svg { width: 42px; height: 42px; }

.file-info {
  text-align: center;
  width: 100%;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.file-size {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-family: 'JetBrains Mono', monospace;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-public {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.badge-onetime {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}
.empty-state p { margin-top: 16px; font-size: 15px; color: rgba(255,255,255,0.4); }
.empty-state .empty-sub { font-size: 13px; color: rgba(255,255,255,0.25); margin-top: 4px; }

/* ---------- Context Menu ---------- */

.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  background: rgba(22,22,22,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.context-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  color: rgba(255,255,255,0.8);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  text-align: left;
}
.context-item:hover { background: rgba(255,255,255,0.08); }
.context-item.danger { color: #ef4444; }
.context-item.danger:hover { background: rgba(239,68,68,0.12); }

.context-icon {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6;
}
.context-icon svg { width: 16px; height: 16px; }

.context-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 8px;
}

/* ---------- Modals ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  transform: translateY(8px) scale(0.97);
  transition: transform .2s ease;
}
.modal-overlay.visible .modal { transform: translateY(0) scale(1); }

.modal-sm { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-header h2 { font-size: 17px; font-weight: 600; color: #fff; }

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Standard input */
.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus {
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74,158,255,0.15);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select.input option { background: #1a1a1a; color: #fff; }

/* ---------- Drop Zone ---------- */

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  text-align: center;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: #4a9eff;
  background: rgba(74,158,255,0.04);
}
.drop-zone svg { width: 40px; height: 40px; color: rgba(255,255,255,0.25); margin-bottom: 12px; }
.drop-zone p { font-size: 14px; color: rgba(255,255,255,0.4); }

.upload-info { margin-top: 20px; }

.upload-filename {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-folder { margin-bottom: 14px; }
.upload-folder label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
}

/* Progress bar */
.upload-progress { margin-top: 14px; }

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a9eff, #7c3aed);
  border-radius: 3px;
  transition: width .3s ease;
}

.progress-text {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.45);
  text-align: right;
}

/* ---------- Link Display ---------- */

.link-display {
  display: flex;
  gap: 10px;
  align-items: center;
}
.link-display .input { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.link-display .btn-secondary { flex-shrink: 0; white-space: nowrap; }

.link-info {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ---------- Toast ---------- */

.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: none;
}
.toast.success { background: rgba(34,197,94,0.9); }
.toast.error { background: rgba(239,68,68,0.9); }
.toast.info { background: rgba(74,158,255,0.9); }

@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* =====================================================================
   PREVIEW PAGE (CDN Link)
   ===================================================================== */

.preview-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.preview-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  padding: 24px;
}

.preview-card {
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.preview-error svg { width: 64px; height: 64px; color: rgba(239,68,68,0.5); margin-bottom: 20px; }
.preview-error h2 { font-size: 20px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.preview-error p { font-size: 14px; color: rgba(255,255,255,0.4); }

.preview-file-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4);
}
.preview-file-icon svg { width: 64px; height: 64px; }

.preview-card h2 { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 6px; word-break: break-all; }

.preview-size {
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.35);
  margin-bottom: 28px;
}

.preview-card .btn-primary { width: auto; padding: 14px 36px; }

.preview-warning {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(245,158,11,0.7);
}

/* ---------- Responsive ---------- */

/* ---------- Stats Bar ---------- */

.stats-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  height: 44px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  z-index: 90;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: 12px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
}

.stat-value {
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
}

.stat-label {
  color: rgba(255,255,255,0.35);
}

.stat-logs-btn {
  margin-left: auto;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 6px 14px;
  color: rgba(255,255,255,0.5);
  transition: all .15s ease;
  font-family: inherit;
}
.stat-logs-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

/* ---------- Search Bar ---------- */

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 160px;
  max-width: 240px;
  transition: border-color .15s ease;
}
.search-bar:focus-within {
  border-color: rgba(74,158,255,0.4);
}

.search-bar svg {
  color: rgba(255,255,255,0.3);
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
.search-bar input::placeholder {
  color: rgba(255,255,255,0.25);
}

.search-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.search-clear:hover { color: rgba(255,255,255,0.7); }

/* ---------- Form Elements ---------- */

.form-group { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  font-weight: 500;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ---------- Logs Table ---------- */

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.logs-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-weight: 600;
  white-space: nowrap;
}
.logs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.logs-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.log-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.log-served {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
}
.log-fail {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}
.log-expired {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
}

.logs-empty {
  text-align: center;
  padding: 48px 24px;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
}

/* ---------- Pagination ---------- */

.logs-pagination {
  display: flex;
  gap: 4px;
  flex: 1;
}

.pagination-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all .15s ease;
}
.pagination-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.pagination-btn.active {
  background: rgba(74,158,255,0.2);
  border-color: rgba(74,158,255,0.3);
  color: #4a9eff;
}

/* ---------- Additional Badges ---------- */

.badge-hits {
  background: rgba(168,85,247,0.12);
  color: #c084fc;
}

.badge-pw {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
  font-size: 10px;
}

.file-path {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- QR Code Modal ---------- */

.qr-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
  border-radius: 14px;
  margin: 0 auto;
  max-width: 280px;
  box-shadow: 0 0 40px rgba(74, 158, 255, 0.06);
}

.qr-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
}

.qr-expiry-info {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 12px;
}

/* =====================================================================
   404 ERROR PAGE
   ===================================================================== */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 24px;
}

.error-card {
  position: relative;
  background: rgba(17, 17, 17, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 56px 48px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

/* ── Glitch 404 Number ── */

.error-code {
  font-size: 120px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  position: relative;
  display: inline-block;
  color: #fff;
  margin-bottom: 8px;
}

.error-code span {
  display: inline-block;
  position: relative;
}

.error-zero {
  background: linear-gradient(135deg, #4a9eff 0%, #7c3aed 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse404 3s ease-in-out infinite;
}

@keyframes pulse404 {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.error-code::before,
.error-code::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.error-code::before {
  color: rgba(74, 158, 255, 0.4);
  animation: glitch1 4s ease-in-out infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.error-code::after {
  color: rgba(124, 58, 237, 0.4);
  animation: glitch2 4s ease-in-out infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-4px, -2px); }
  94% { transform: translate(3px, 1px); }
  96% { transform: translate(-2px, 1px); }
  98% { transform: translate(2px, -1px); }
}

@keyframes glitch2 {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(3px, 2px); }
  92% { transform: translate(-4px, -1px); }
  94% { transform: translate(2px, 1px); }
  96% { transform: translate(-1px, -2px); }
}

/* ── Divider ── */

.error-divider {
  width: 64px;
  height: 3px;
  margin: 20px auto 24px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4a9eff, #7c3aed, #06b6d4);
  opacity: 0.6;
}

/* ── Text ── */

.error-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.error-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.7;
  margin: 0 0 32px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ── */

.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Floating Particles ── */

.error-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}

.p1 { width: 4px; height: 4px; background: #4a9eff; top: 20%; left: 15%; animation-delay: 0s; }
.p2 { width: 3px; height: 3px; background: #7c3aed; top: 70%; left: 80%; animation-delay: 1.2s; }
.p3 { width: 5px; height: 5px; background: #06b6d4; top: 40%; left: 90%; animation-delay: 2.4s; }
.p4 { width: 3px; height: 3px; background: #4a9eff; top: 80%; left: 20%; animation-delay: 3.6s; }
.p5 { width: 4px; height: 4px; background: #7c3aed; top: 10%; left: 70%; animation-delay: 4.8s; }
.p6 { width: 3px; height: 3px; background: #06b6d4; top: 60%; left: 40%; animation-delay: 6s; }

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(20px) scale(0); }
  20% { opacity: 0.6; transform: translateY(0) scale(1); }
  80% { opacity: 0.6; transform: translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .login-card { padding: 32px 24px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .toolbar { padding: 12px 16px; }
  .file-grid-wrapper { padding: 16px; }
  .stats-bar { padding: 0 12px; overflow-x: auto; }
  .search-bar { min-width: 120px; }
  .error-code { font-size: 80px; }
  .error-card { padding: 40px 28px; }
}

/* Reduce motion for users who prefer it & save GPU */
@media (prefers-reduced-motion: reduce) {
  .shape { animation: none !important; }
  .file-card { transition: none !important; }
  .context-menu { transition: none !important; }
  .modal-overlay, .modal { transition: none !important; }
  .toast { animation: none !important; }
}
