/* ============================================================
   FileVault — Main Stylesheet
   ============================================================ */

:root {
  --bg-base:    #0f172a;
  --bg-card:    #1e293b;
  --bg-input:   #0f172a;
  --border:     #334155;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --accent:     #38bdf8;
  --accent-dark:#0284c7;
  --success:    #4ade80;
  --error:      #f87171;
  --warning:    #fbbf24;
  --radius:     8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ────────────────────────────────────────
   Layout
──────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ────────────────────────────────────────
   Navbar
──────────────────────────────────────── */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.badge-admin {
  font-size: 0.65rem;
  background: var(--warning);
  color: #000;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 0.25rem;
}

/* ────────────────────────────────────────
   Main Content
──────────────────────────────────────── */
.main { padding: 2rem 0; }

/* ────────────────────────────────────────
   Cards
──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* ────────────────────────────────────────
   Forms
──────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
label, .form-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.form-control {
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); opacity: 0.6; }
select.form-control { cursor: pointer; }

/* ────────────────────────────────────────
   Buttons
──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
  font-family: inherit;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary  { background: var(--accent); color: #0f172a; }
.btn-success  { background: var(--success); color: #0f172a; }
.btn-danger   { background: var(--error); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--border); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; padding: 0.7rem; font-size: 1rem; }

/* ────────────────────────────────────────
   Alerts
──────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-success { background: #052e16; border-color: #14532d; color: #4ade80; }
.alert-error   { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
.alert-info    { background: #0c1a4b; border-color: #1e3a8a; color: #93c5fd; }
.alert-warning { background: #431407; border-color: #7c2d12; color: #fcd34d; }

/* ────────────────────────────────────────
   Upload Zone
──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.04);
}
.upload-zone input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 3rem; margin-bottom: 1rem; }
.upload-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.35rem; }
.upload-hint { font-size: 0.85rem; color: var(--text-muted); }

/* Progress */
.progress-wrap { margin-top: 1.25rem; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar-bg {
  background: var(--border);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.2s;
  width: 0%;
}
.progress-text { font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* Upload Options */
.upload-options { margin-top: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .upload-options { grid-template-columns: 1fr; } }

/* ────────────────────────────────────────
   File Grid / Table
──────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.file-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.file-card:hover { border-color: var(--accent); }
.file-card-thumb {
  height: 140px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}
.file-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.file-card-body { padding: 0.75rem; }
.file-card-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}
.file-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.file-card-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ────────────────────────────────────────
   Table
──────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 0.65rem 0.9rem; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(51,65,85,0.5); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }
.filename-cell { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ────────────────────────────────────────
   View Page
──────────────────────────────────────── */
.file-preview { text-align: center; padding: 2rem; }
.file-preview img { max-width: 100%; max-height: 75vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.file-preview iframe { width: 100%; height: 75vh; border: none; border-radius: var(--radius); }
.file-icon-large { font-size: 6rem; }

.file-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  margin-top: 1.25rem;
}
.file-info-item { font-size: 0.85rem; }
.file-info-label { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 0.15rem; }

/* ────────────────────────────────────────
   Share Box
──────────────────────────────────────── */
.share-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.share-box input {
  flex: 1;
  padding: 0.5rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
.share-box input:focus { outline: none; }

/* ────────────────────────────────────────
   Stats Cards
──────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); }

/* ────────────────────────────────────────
   Auth Pages (Login)
──────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; font-weight: 700; color: var(--accent); }

/* ────────────────────────────────────────
   Password Gate
──────────────────────────────────────── */
.password-gate { max-width: 400px; margin: 4rem auto; text-align: center; }
.lock-icon { font-size: 4rem; margin-bottom: 1.25rem; }

/* ────────────────────────────────────────
   Pagination
──────────────────────────────────────── */
.pagination { display: flex; gap: 0.35rem; margin-top: 1.25rem; flex-wrap: wrap; }
.page-btn {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #0f172a; border-color: var(--accent); text-decoration: none; }

/* ────────────────────────────────────────
   Misc
──────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-title { font-size: 1.1rem; font-weight: 600; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ────────────────────────────────────────
   Responsive
──────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 1.25rem; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .navbar-nav .nav-link span { display: none; }
}
