/* ==========================================================================
   VideoAuthenticator - Premium Dark Glassmorphic Design System
   ========================================================================== */

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

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 26, 43, 0.7);
  --bg-card-hover: rgba(28, 39, 64, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  
  --status-authentic: #10b981;
  --status-authentic-bg: rgba(16, 185, 129, 0.15);
  --status-suspicious: #f59e0b;
  --status-suspicious-bg: rgba(245, 158, 11, 0.15);
  --status-deepfake: #ef4444;
  --status-deepfake-bg: rgba(239, 68, 68, 0.15);
  --status-pending: #9ca3af;
  --status-pending-bg: rgba(156, 163, 175, 0.15);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --glass-backdrop: blur(16px) saturate(180%);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.10) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #38bdf8;
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 19, 33, 0.8);
  backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand span {
  background: linear-gradient(135deg, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */

.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  color: #fff;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

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

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-authentic {
  background: var(--status-authentic-bg);
  color: var(--status-authentic);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-suspicious {
  background: var(--status-suspicious-bg);
  color: var(--status-suspicious);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-deepfake {
  background: var(--status-deepfake-bg);
  color: var(--status-deepfake);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-pending, .badge-processing {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* ==========================================================================
   Alert Messages
   ========================================================================== */

.messages-container {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ==========================================================================
   Dashboard Statistics Cards
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.total { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.stat-icon.authentic { background: rgba(16, 185, 129, 0.15); color: var(--status-authentic); }
.stat-icon.deepfake { background: rgba(239, 68, 68, 0.15); color: var(--status-deepfake); }
.stat-icon.score { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }

.stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Filter & Search Toolbar
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(18, 26, 43, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pill:hover, .pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #fff;
}

/* ==========================================================================
   Video Grid Gallery
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 190px;
  background: #000;
  overflow: hidden;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: var(--text-dim);
}

.score-badge-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
}

.video-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-card-title {
  font-size: 1.1rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.video-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Form Controls & Authentication Pages
   ========================================================================== */

.auth-wrapper {
  max-width: 440px;
  margin: 3rem auto;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: rgba(11, 17, 30, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Dropzone Upload */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(18, 26, 43, 0.5);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 1.5rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.08);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ==========================================================================
   Detailed Forensic Report Dashboard
   ========================================================================== */

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.8rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.player-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
}

.player-container video {
  width: 100%;
  max-height: 480px;
  display: block;
}

/* Gauge Radial Score */
.gauge-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.gauge-circle {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) calc(var(--score-pct) * 1%),
    rgba(255, 255, 255, 0.08) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.gauge-circle::before {
  content: '';
  position: absolute;
  width: 135px;
  height: 135px;
  border-radius: 50%;
  background: var(--bg-dark);
}

.gauge-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.gauge-val {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.gauge-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Metrics Sub-Grid */
.metrics-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.metric-box {
  background: rgba(11, 17, 30, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 3px;
}

/* Forensic Table */
.forensic-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.forensic-table th, .forensic-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.forensic-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.code-hash {
  font-family: monospace;
  font-size: 0.82rem;
  color: #a5b4fc;
  word-break: break-all;
}

/* Code block pre */
pre.json-viewer {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: #38bdf8;
  font-size: 0.82rem;
  max-height: 250px;
  overflow-y: auto;
}
