:root {
  --bg: #0b0f19;
  --surface: #131a2a;
  --surface-hover: #192236;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #10b981;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
.bg-glow {
  position: fixed; top: -150px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(11, 15, 25, 0) 70%);
  pointer-events: none; z-index: -1;
}
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.topbar {
  border-bottom: 1px solid var(--border); background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20;
}
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 18px; margin-right: 8px; }
.badge-stub {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3);
}
.server-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-card {
  margin-top: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: center;
}
.hero-text h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.hero-text p { color: var(--text-muted); font-size: 14px; }
.upload-box {
  border: 2px dashed rgba(99, 102, 241, 0.4); border-radius: 12px; padding: 18px;
  text-align: center; cursor: pointer; background: rgba(99, 102, 241, 0.04); display: block;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--primary); background: rgba(99, 102, 241, 0.1); }
.upload-icon { font-size: 26px; margin-bottom: 4px; }
.upload-title { font-size: 13.5px; font-weight: 500; }
.upload-title span { color: #818cf8; text-decoration: underline; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.controls-bar { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); background: var(--surface-hover); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab .count { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.25); }
.search-wrap input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: 13px; width: 280px; outline: none;
}
.search-wrap input:focus { border-color: var(--primary); }
.files-grid {
  margin-top: 20px; margin-bottom: 64px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.file-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; justify-content: space-between;
}
.file-card:hover { border-color: rgba(99, 102, 241, 0.45); }
.card-top { display: flex; align-items: flex-start; gap: 12px; }
.file-badge {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.badge-photos { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-video { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-files { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.file-meta-wrap { min-width: 0; flex: 1; }
.file-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-filename { font-size: 11.5px; color: var(--text-muted); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-desc { font-size: 12.5px; color: var(--text-muted); margin: 10px 0; }
.media-thumb-preview {
  position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 10px;
  background: #090d16; aspect-ratio: 16 / 10; cursor: pointer; border: 1px solid var(--border);
}
.media-thumb-preview img, .media-thumb-preview video {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease;
}
.media-thumb-preview:hover img, .media-thumb-preview:hover video { transform: scale(1.03); }
.play-overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.zoom-overlay {
  position: absolute; right: 8px; bottom: 8px; background: rgba(11, 15, 25, 0.78);
  color: #f1f5f9; font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
}
.card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border); gap: 8px;
}
.file-specs { font-size: 11.5px; color: var(--text-muted); }
.card-actions { display: flex; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border-radius: 8px; font-size: 12.5px; font-weight: 500; text-decoration: none; cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); }
.modal-content {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 780px; padding: 18px; z-index: 2;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
#modalImagePreview, #modalVideoPlayer {
  width: 100%; border-radius: 8px; background: #000; max-height: 68vh; object-fit: contain;
}
.modal-footer { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.muted { font-size: 12.5px; color: var(--text-muted); }
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 0; font-size: 12.5px; color: var(--text-muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 768px) {
  .hero-card { grid-template-columns: 1fr; }
  .search-wrap input { width: 100%; }
}
