/* =========================================================
   Secure Lab File Transfer — Design System
   Dark glassmorphism • Emerald/Cyan accent palette
   ========================================================= */

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

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Background layers */
  --bg-base:      #050b14;
  --bg-surface:   #0d1a2a;
  --bg-elevated:  #111f33;
  --bg-hover:     #162640;

  /* Accent gradient — Emerald → Cyan */
  --accent-1:     #10b981;
  --accent-2:     #06b6d4;
  --accent-glow:  rgba(16, 185, 129, 0.25);
  --accent-grad:  linear-gradient(135deg, #10b981, #06b6d4);

  /* Danger / warning */
  --danger:       #f43f5e;
  --warning:      #f59e0b;
  --success:      #10b981;

  /* Text hierarchy */
  --text-primary:   #f0f9ff;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.08);
  --border-accent:rgba(16, 185, 129, 0.35);

  /* Glass effect */
  --glass-bg:     rgba(13, 26, 42, 0.75);
  --glass-blur:   blur(20px);

  /* Radii & spacing */
  --radius-sm:    8px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --radius-xl:    32px;

  /* Shadows */
  --shadow-glow:  0 0 40px rgba(16, 185, 129, 0.12);
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Animated Background Mesh ─────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(16, 185, 129, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(6, 182, 212, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout Helpers ───────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ─── Glass Card ───────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* ─── Navigation / Header ──────────────────────────────── */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(5, 11, 20, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.logo-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.logo-by {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  opacity: 0.85;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-secure {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ─── Hero Section ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 56px 0 40px;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #f0f9ff 20%, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero h1 span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
}

/* ─── Drag & Drop Zone ─────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(13, 26, 42, 0.5);
  backdrop-filter: blur(12px);
  padding: 60px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.drop-zone.drag-over {
  border-color: var(--accent-1);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.2), inset 0 0 40px rgba(16, 185, 129, 0.05);
  transform: scale(1.01);
}

.drop-zone.drag-over::before {
  opacity: 0.08;
}

.drop-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.drop-zone h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drop-zone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.drop-zone .file-types {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 16px;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--danger);
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Progress Bar ─────────────────────────────────────── */
.progress-wrap {
  margin: 24px 0;
  display: none;
}

.progress-wrap.visible { display: block; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 100px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* ─── Result Card ──────────────────────────────────────── */
.result-card {
  display: none;
  margin-top: 24px;
}

.result-card.visible { display: block; }

.result-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 600px) {
  .result-inner { grid-template-columns: 1fr; text-align: center; }
}

.qr-frame {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.qr-frame canvas,
.qr-frame img { width: 100%; height: 100%; display: block; }

.result-meta { flex: 1; }

.result-filename {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-all;
}

.result-size {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 16px;
}

.countdown-badge.urgent {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--danger);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.url-copy-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.url-input {
  flex: 1;
  padding: 9px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  cursor: text;
  user-select: all;
}

.burn-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 8px;
}

/* ─── Options Row ──────────────────────────────────────── */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: 0.3s;
  pointer-events: none;
}

.toggle input:checked + .toggle-track {
  background: rgba(16,185,129,0.3);
  border-color: var(--accent-1);
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked ~ .toggle-thumb {
  left: 21px;
  background: var(--accent-1);
  box-shadow: 0 0 8px var(--accent-1);
}

.toggle-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ─── Toast / Notification ─────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease forwards;
  max-width: 320px;
  backdrop-filter: blur(12px);
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.toast-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.toast-info {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ─── Form Controls ────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ─── Admin Dashboard Table ────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.data-table .filename-cell {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* ─── Stats Cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(13, 26, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-accent); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Admin Tabs ───────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  border: 1px solid var(--border);
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Login Page Specific ──────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .icon-large {
  width: 72px;
  height: 72px;
  background: var(--accent-grad);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ─── Countdown Timers in Table ─────────────────────────── */
.ttl-bar {
  width: 80px;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
}

.ttl-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s linear;
}

.ttl-fill.ok      { background: var(--accent-1); }
.ttl-fill.warning { background: var(--warning); }
.ttl-fill.danger  { background: var(--danger); }

/* ─── Empty State ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Utility Classes ──────────────────────────────────── */
.text-accent   { color: var(--accent-1); }
.text-muted    { color: var(--text-muted); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.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; }
.hidden        { display: none !important; }
.mono          { font-family: 'JetBrains Mono', monospace; }
