/* FileNova v2 — design system. Dark default, light via [data-theme="light"]. */
:root {
  --navy: #0a0f1e;
  --navy-2: #111832;
  --indigo: #4f46e5;
  --indigo-soft: #818cf8;
  --paper: #f8fafc;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: var(--navy);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --focus: 0 0 0 3px rgba(79, 70, 229, 0.45);
}
[data-theme="light"] {
  --bg: var(--paper);
  --card: rgba(10, 15, 30, 0.04);
  --border: rgba(10, 15, 30, 0.14);
  --text: #0a0f1e;
  --muted: #475569;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
.shell { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
@media (min-width: 768px) { .shell { padding: 40px 24px 80px; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.brand { font-weight: 700; font-size: 20px; text-decoration: none; color: var(--text); }
.brand .badge { font-size: 12px; background: var(--indigo); color: #fff; border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace; }
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-top: 16px; background: var(--card); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }
@media (min-width: 768px) { .card { padding: 24px; } }
.glass { backdrop-filter: blur(12px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-md);
  background: var(--indigo); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: transparent; color: var(--text);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.expiry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.expiry-grid button { min-height: 44px; border-radius: var(--radius-md); border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 14px; cursor: pointer; }
.expiry-grid button[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.room-code {
  font-family: "JetBrains Mono", monospace; font-size: 40px; font-weight: 700;
  letter-spacing: 8px; text-align: center; margin: 12px 0; user-select: all;
}
@media (min-width: 768px) { .room-code { font-size: 48px; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }
.share-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .share-grid { grid-template-columns: 1fr 1fr; } }
.qr-box { display: flex; justify-content: center; padding: 12px; }
.qr-box img, .qr-box canvas { border-radius: var(--radius-md); background: #fff; padding: 8px; }
/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 32px 16px; text-align: center; cursor: pointer; margin-top: 12px;
  transition: border-color 150ms ease, background 150ms ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--indigo); background: rgba(79, 70, 229, 0.08); }
.dropzone input[type="file"] { display: none; }
/* File rows + progress */
.file-row { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; margin-top: 12px; }
.file-row .name { font-weight: 600; overflow-wrap: anywhere; }
.progress { height: 8px; border-radius: 999px; background: rgba(127, 127, 127, 0.25); margin-top: 8px; overflow: hidden; }
.progress > div { height: 100%; width: 0%; background: var(--indigo); border-radius: 999px; transition: width 150ms linear; }
/* Status timeline */
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { display: flex; gap: 8px; align-items: center; padding: 6px 0; color: var(--muted); }
.timeline li.active { color: var(--text); font-weight: 600; }
.timeline li.done { color: var(--success); }
/* Toasts */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(92vw, 420px); }
.toast { background: var(--navy-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
[data-theme="light"] .toast { background: #fff; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
/* Skeletons */
.skeleton { border-radius: var(--radius-md); background: linear-gradient(90deg, rgba(127,127,127,0.15), rgba(127,127,127,0.3), rgba(127,127,127,0.15)); background-size: 200% 100%; animation: shimmer 1.2s infinite; min-height: 64px; margin-top: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* Gallery / lightbox */
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.thumb-grid img { width: 100%; height: 96px; object-fit: cover; border-radius: var(--radius-md); cursor: pointer; border: 1px solid var(--border); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-md); }
.lightbox img.zoomed { transform: scale(1.8); cursor: zoom-out; }
.lightbox button { position: absolute; top: 12px; right: 12px; min-height: 44px; min-width: 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--navy-2); color: #fff; font-size: 18px; cursor: pointer; }
/* Text snippets */
.snippet pre { max-height: 320px; overflow: auto; border-radius: var(--radius-md); margin: 8px 0 0; }
.snippet pre code { font-size: 13px; }
/* Waveform */
.wave { margin-top: 8px; }
audio { width: 100%; margin-top: 8px; }
/* Footer */
footer { margin-top: 32px; text-align: center; }
.hidden { display: none !important; }
