/* ===== RiotCity Evidence Vault — Full Stylesheet ===== */
/* Based on UI_STYLE_GUIDE.md */

:root {
  /* Accent */
  --accent: #FF7A1A;
  --accent-hover: #FF8C33;
  --accent-pressed: #E5660A;
  --accent-soft: rgba(255, 122, 26, 0.12);
  --accent-border: rgba(255, 122, 26, 0.35);

  /* Surfaces */
  --bg-0: #0B0D10;
  --bg-1: #111418;
  --bg-2: #171B20;
  --bg-3: #1E232A;
  --bg-4: #252B33;
  --bg-elevated: #1A1F26;

  /* Borders */
  --border: #262C34;
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-strong: #333A44;

  /* Text */
  --text-primary: #F5F6F7;
  --text-secondary: #B6BCC5;
  --text-muted: #7A828D;
  --text-disabled: #525861;

  /* Status */
  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, 0.15);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --info: #3B82F6;
  --info-soft: rgba(59, 130, 246, 0.15);
  --vip-gold: #E0B341;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Typography */
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.logo:hover { color: var(--text-primary); }

.logo-accent { color: var(--accent); }
.logo:hover .logo-accent { color: var(--accent); }

.header-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0B0D10;
}
.btn-primary:hover { background: var(--accent-hover); color: #0B0D10; }
.btn-primary:active { background: var(--accent-pressed); }

.btn-success {
  background: var(--success);
  color: #0B0D10;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #0B0D10; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent-border); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ===== INPUTS ===== */
.input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 120ms ease;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-disabled); }

.select {
  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='%237A828D' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.select option { background: var(--bg-3); color: var(--text-primary); }

.textarea { min-height: 80px; resize: vertical; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 20px 0 32px;
}
.hero-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
  display: flex;
  justify-content: center;
  padding-bottom: 64px;
}

.upload-card {
  background: linear-gradient(180deg, #1B2026 0%, #14181D 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 600px;
}

.upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  cursor: pointer;
  transition: all 180ms ease;
  background: var(--bg-2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone-content {
  text-align: center;
}

.upload-icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.upload-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.option-group { display: flex; flex-direction: column; gap: 6px; }

.option-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
  padding: 20px 0;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-filename {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.progress-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  background: var(--bg-3);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 150ms ease;
}

/* ===== UPLOAD RESULT ===== */
.upload-result {
  text-align: center;
}
.result-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.result-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #0B0D10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.result-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-link-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.result-link {
  text-align: left;
  font-size: 13px;
  color: var(--accent);
}
.result-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ===== VIEW PAGE ===== */
.view-page { padding-bottom: 48px; }

.video-container {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.video-player {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

/* Custom video controls */
.video-controls-custom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 20px 16px 12px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.video-container:hover .video-controls-custom { opacity: 1; }

.progress-bar-container {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 10px;
}
.progress-bar-container:hover { height: 6px; }
.progress-bar-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
}
.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.progress-bar-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 120ms;
}
.progress-bar-container:hover .progress-bar-handle { opacity: 1; }

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctl-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 120ms;
}
.ctl-btn:hover { color: var(--accent); }

.volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-slider {
  width: 70px;
  height: 4px;
  appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.time-display {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}

/* ===== QUALITY MENU ===== */
.quality-group {
  position: relative;
}
.quality-menu {
  position: absolute;
  bottom: 36px;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 110px;
  z-index: 20;
}
.quality-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.quality-item:hover { background: var(--bg-3); color: var(--accent); }
.quality-item.active { color: var(--accent); }
#qualityBtn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
}

/* ===== TRANSCODE BANNER ===== */
.transcode-banner {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,13,16,0.8);
  border: 1px solid var(--accent-border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 15;
}
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== IMAGE VIEWER ===== */
.image-viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.view-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

/* ===== FILE INFO CARD ===== */
.file-info-card {
  background: linear-gradient(180deg, #1B2026 0%, #14181D 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.file-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.file-name {
  font-size: 16px;
  font-weight: 600;
  word-break: break-all;
}
.file-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.meta-value {
  font-size: 14px;
  color: var(--text-secondary);
}
.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== PASSWORD PAGE ===== */
.password-page, .error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.lock-icon, .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.password-page h1, .error-page h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.password-page p, .error-page p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}
.password-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.error-msg {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}

/* ===== ADMIN PAGE ===== */
.admin-page { padding-bottom: 48px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(180deg, #1B2026 0%, #14181D 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon-accent { background: var(--accent-soft); }
.stat-icon-info { background: var(--info-soft); }
.stat-icon-success { background: var(--success-soft); }
.stat-info { display: flex; flex-direction: column; }
.stat-number {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-section {
  background: linear-gradient(180deg, #1B2026 0%, #14181D 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header-row .section-title { margin-bottom: 0; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-group.full-width { grid-column: 1 / -1; }
.setting-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.mime-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.mime-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ===== PERIOD EDITOR ===== */
.setting-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -2px 0 8px;
}
.period-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.period-row {
  display: grid;
  grid-template-columns: auto 1fr 120px auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.period-default {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.period-row .input { margin: 0; }
.period-label { min-width: 0; }
.period-hours { width: 100%; }
.period-remove {
  padding: 6px 10px;
  line-height: 1;
}
.period-empty {
  font-size: 13px;
  color: var(--text-disabled);
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}
.period-add-btn { margin-top: 0; }

@media (max-width: 560px) {
  .period-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "radio label remove"
      "radio hours remove";
  }
  .period-default { grid-area: radio; }
  .period-label { grid-area: label; }
  .period-hours { grid-area: hours; }
  .period-remove { grid-area: remove; }
}

/* ===== TABLE ===== */
.table-container { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
}
.data-table tr:hover td { background: var(--bg-3); }
.file-link { color: var(--accent); font-weight: 500; }
.empty-row {
  text-align: center;
  color: var(--text-disabled);
  padding: 32px 12px !important;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast-show { transform: translateY(0); opacity: 1; }
.toast-error { border-color: var(--danger); color: var(--danger); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .upload-options { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .file-meta { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 22px; }
  .header { margin-bottom: 20px; }
  .upload-zone { padding: 32px 16px; }
  .result-link-group { flex-direction: column; }
}
