/* ============================================
   EVIDENCE VAULT — STYLES
   Dark case-file visualization theme
   ============================================ */

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

/* ── Custom Properties ── */
:root {
  --bg-base: #0b0f1a;
  --bg-surface: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263348;
  --bg-elevated: #283548;
  --bg-glass: rgba(30, 41, 59, 0.6);

  --border: #334155;
  --border-light: #475569;
  --border-accent: rgba(0, 150, 219, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --accent-cyan: #0096db;
  --accent-cyan-glow: rgba(0, 150, 219, 0.15);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.12);
  --accent-green: #22c55e;
  --accent-green-glow: rgba(34, 197, 94, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.12);
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-lime: #c3d62e;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0, 150, 219, 0.1);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --max-width: 1140px;
  --sidebar-width: 240px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: var(--accent-cyan);
  color: var(--bg-base);
}

a { color: var(--accent-cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: #38bdf8; }

img { max-width: 100%; height: auto; }

/* ── Layout ── */
.vault-layout {
  display: flex;
  min-height: 100vh;
}

.vault-sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.vault-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.vault-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── Sidebar ── */
.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-brand {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.sidebar-case {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.sidebar-nav {
  list-style: none;
  padding: 0 8px;
  flex: 1;
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  background: var(--accent-cyan-glow);
  color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-nav .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-footer .case-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-amber);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-footer .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: pulse 2s infinite;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.2rem;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.25;
}

.page-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.card-sm {
  padding: 18px;
}

.card-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.card h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link:hover { color: inherit; }

/* ── Stat Blocks ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-cyan {
  background: var(--accent-cyan-glow);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 150, 219, 0.25);
}

.badge-red {
  background: var(--accent-red-glow);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-green {
  background: var(--accent-green-glow);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-amber {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ── Exhibit Badge (clickable) ── */
.exhibit-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: var(--accent-cyan-glow);
  border: 1px solid rgba(0, 150, 219, 0.2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  transition: all 0.2s;
  text-decoration: none;
}

.exhibit-ref:hover {
  background: rgba(0, 150, 219, 0.25);
  color: #38bdf8;
}

/* ── Tables ── */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-elevated);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  color: var(--text-secondary);
  vertical-align: top;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(0, 150, 219, 0.04);
}

.data-table tbody tr:hover td {
  color: var(--text-primary);
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-red), var(--accent-amber));
}

.tl-item {
  position: relative;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s;
}

.tl-item:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-cyan);
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  z-index: 1;
}

.tl-item.violation::before { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red-glow); }
.tl-item.fact::before { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green-glow); }
.tl-item.filing::before { background: var(--accent-blue); }
.tl-item.milestone::before { background: var(--accent-amber); box-shadow: 0 0 12px var(--accent-amber-glow); width: 18px; height: 18px; left: -34px; top: 22px; }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.tl-item.violation .tl-date { color: var(--accent-red); }
.tl-item.fact .tl-date { color: var(--accent-green); }
.tl-item.filing .tl-date { color: var(--accent-blue); }
.tl-item.milestone .tl-date { color: var(--accent-amber); }

.tl-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tl-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tl-exhibits {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Phase markers ── */
.phase-marker {
  margin: 48px 0 24px;
  padding-left: 40px;
}

.phase-marker h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.phase-marker .phase-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

/* ── Tabs / Filters ── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }

.tab-btn.active {
  background: var(--accent-cyan-glow);
  color: var(--accent-cyan);
}

/* ── Search ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--accent-cyan);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar .search-icon {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Expandable / Accordion ── */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-header .arrow {
  color: var(--text-muted);
  transition: transform 0.3s;
  font-size: 0.8rem;
}

.accordion-item.open .accordion-header .arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-body-inner {
  padding: 0 20px 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
}

/* ── Narrative / Long-read ── */
.narrative-content {
  max-width: 720px;
}

.narrative-content h2 {
  font-size: 1.6rem;
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.narrative-content h2:first-of-type {
  border-top: none;
  margin-top: 0;
}

.narrative-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.narrative-content blockquote {
  border-left: 3px solid var(--accent-red);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--accent-red-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-primary);
  font-size: 1rem;
}

.narrative-content strong {
  color: var(--text-primary);
}

.narrative-content ul, .narrative-content ol {
  margin: 12px 0 20px 20px;
  color: var(--text-secondary);
}

.narrative-content li {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.pull-quote {
  text-align: center;
  padding: 40px 24px;
  margin: 40px 0;
  position: relative;
}

.pull-quote::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--accent-cyan);
  opacity: 0.15;
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  font-style: italic;
}

/* ── Filing cards ── */
.filing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.25s;
}

.filing-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-cyan);
}

.filing-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.filing-info { flex: 1; }

.filing-info h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.filing-info .filing-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.filing-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── Photo grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.photo-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.photo-thumb:hover {
  border-color: var(--accent-cyan);
}

.photo-thumb:hover img {
  transform: scale(1.05);
}

/* ── Utility ── */
.text-cyan { color: var(--accent-cyan); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-amber { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: var(--font-mono); }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ── Keyframes ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .vault-sidebar {
    position: fixed;
    left: -100%;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .vault-sidebar.open { left: 0; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
  }

  .sidebar-overlay.visible { display: block; }

  .sidebar-toggle { display: flex; }

  .vault-main {
    margin-left: 0;
  }

  .vault-content {
    padding: 70px 20px 60px;
  }

  .page-title { font-size: 1.6rem; }

  .stat-row { grid-template-columns: repeat(2, 1fr); }

  .card-grid { grid-template-columns: 1fr; }

  .tab-bar { gap: 2px; }
  .tab-btn { padding: 6px 12px; font-size: 0.75rem; }

  .timeline { padding-left: 32px; }
  .timeline::before { left: 12px; }
  .tl-item::before { left: -26px; width: 12px; height: 12px; }
  .tl-item.milestone::before { left: -28px; width: 14px; height: 14px; }
  .tl-item { padding: 16px 18px; }

  .phase-marker { padding-left: 32px; }
  .phase-marker h2 { font-size: 1.2rem; }

  .filing-card { flex-direction: column; gap: 10px; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  .narrative-content h2 { font-size: 1.3rem; }
  .narrative-content p { font-size: 0.9rem; }
  .pull-quote p { font-size: 1.1rem; }
}

@media (max-width: 380px) {
  .vault-content { padding: 70px 16px 50px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-number { font-size: 1.6rem; }
  .stat-block { padding: 14px 10px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Premium Enhancements ── */
.vault-sidebar {
    background: linear-gradient(to bottom, #0b0f1a, #111827);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.card {
    background: linear-gradient(145deg, #1e293b, #111827);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
}

.stat-block {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(0, 150, 219, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-block::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}

.page-title {
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.badge {
    text-transform: uppercase;
    font-size: 0.65rem;
    padding: 4px 12px;
}

/* Glassmorphism for the header */
.page-header {
    background: rgba(30, 41, 59, 0.3);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 48px;
}

/* Animation for the status dot */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
