/* ── Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #181822;
  --bg-hover: #1e1e2e;
  --border: #2a2a3a;
  --border-light: #3a3a4e;
  --text: #e8e8f0;
  --text-muted: #8a8aa0;
  --text-dim: #5a5a70;
  --accent: #f0c040;
  --accent-dim: #c9a030;
  --success: #40d080;
  --warning: #f0a040;
  --danger: #f04060;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.site-header {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 24px; }
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.brand-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); background: rgba(240,192,64,0.1);
  padding: 3px 10px; border-radius: 20px; font-weight: 600;
}
.nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); padding: 8px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.nav-btn:hover { color: var(--text); background: var(--bg-hover); }
.nav-btn.active { color: var(--accent); border-color: var(--accent-dim); background: rgba(240,192,64,0.08); }
.tunnel-badge {
  font-size: 11px; color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border); padding: 5px 12px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; cursor: pointer; transition: all 0.2s;
}
.tunnel-badge:hover { border-color: var(--accent-dim); color: var(--accent); }
.refresh-indicator {
  font-size: 11px; color: var(--text-dim); margin-left: auto;
  display: flex; align-items: center; gap: 6px;
}
.refresh-indicator .dot {
  width: 6px; height: 6px; background: var(--success); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Views ── */
.main { padding: 32px 0; }
.view { display: none; }
.view.active { display: block; }

/* ── Session Card ── */
.session-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 24px; overflow: hidden;
  box-shadow: var(--shadow);
}
.session-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.session-title-group { flex: 1; }
.session-title {
  font-size: 20px; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}
.session-meta {
  display: flex; gap: 16px; color: var(--text-muted); font-size: 12px;
}
.session-meta span { display: flex; align-items: center; gap: 4px; }
.session-status {
  padding: 4px 12px; border-radius: 20px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-in_progress { background: rgba(240,160,64,0.12); color: var(--warning); }
.status-completed { background: rgba(64,208,128,0.12); color: var(--success); }
.status-approved { background: rgba(64,208,128,0.12); color: var(--success); }

/* ── Reference Section ── */
.session-refs {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; gap: 24px; flex-wrap: wrap;
}
.ref-block {
  flex: 1; min-width: 280px; max-width: 420px;
}
.ref-block h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 10px;
}
.ref-media {
  position: relative; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.ref-media img, .ref-media video {
  width: 100%; display: block; cursor: pointer; transition: transform 0.3s;
}
.ref-media:hover img, .ref-media:hover video { transform: scale(1.02); }
.ref-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5;
}
.ref-link {
  display: inline-block; margin-top: 6px; font-size: 11px;
  color: var(--accent); text-decoration: none;
}
.ref-link:hover { text-decoration: underline; }

/* ── Shots ── */
.shots-section { padding: 20px 24px; }
.shots-section h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 16px;
}
.shot-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 16px; overflow: hidden;
}
.shot-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.shot-name { font-weight: 600; font-size: 14px; }
.shot-duration {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-card); padding: 3px 10px; border-radius: 20px;
}
.shot-desc {
  padding: 10px 18px; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); line-height: 1.6;
}

/* ── Iterations ── */
.iterations-row {
  display: flex; gap: 16px; padding: 16px 18px;
  overflow-x: auto; scrollbar-width: thin;
}
.iteration-item {
  flex: 0 0 220px; position: relative;
  display: flex; flex-direction: column;
}
.iteration-thumb {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--border); background: var(--bg);
  aspect-ratio: 9/16; position: relative; cursor: pointer;
}
.iteration-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.iteration-item:hover .iteration-thumb { border-color: var(--accent-dim); }
.iteration-item.approved .iteration-thumb { border-color: var(--success); }
.iteration-item.approved::after {
  content: "✓ APPROVED"; position: absolute; bottom: 8px; right: 8px;
  background: var(--success); color: #000; font-size: 9px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; z-index: 2;
}
.iteration-label {
  font-size: 11px; color: var(--text-muted); margin-top: 8px;
  display: flex; justify-content: space-between;
}
.iteration-label .ver { font-weight: 600; color: var(--text); }
.iteration-prompt {
  margin-top: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); line-height: 1.5;
  max-height: 80px; overflow-y: auto;
  word-break: break-word;
}
.iteration-notes {
  margin-top: 6px;
  font-size: 10px; color: var(--text-dim); line-height: 1.4;
  max-height: 50px; overflow-y: auto;
}

/* ── Video Output ── */
.video-output {
  padding: 16px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 16px; align-items: flex-start;
}
.video-thumb-wrap {
  flex: 0 0 180px; position: relative; cursor: pointer;
}
.video-thumb-wrap video {
  width: 100%; border-radius: var(--radius-sm); border: 2px solid var(--success);
  display: block;
}
.video-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); border-radius: var(--radius-sm); pointer-events: none;
}
.video-play-overlay::after {
  content: "▶"; font-size: 28px; color: white;
  width: 48px; height: 48px; background: rgba(0,0,0,0.5);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  padding-left: 4px;
}
.video-meta { flex: 1; }
.video-meta h5 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--success); margin-bottom: 8px;
}
.video-meta-row {
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
  display: flex; gap: 8px;
}
.video-meta-row strong { color: var(--text); font-weight: 500; min-width: 70px; }
.video-prompt {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); line-height: 1.6; margin-top: 10px;
  max-height: 120px; overflow-y: auto;
}

/* ── Compare View ── */
.compare-empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.compare-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.compare-header h2 { font-size: 18px; }
.compare-header select {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px;
}
.compare-images {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.compare-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.compare-card img {
  width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover;
}
.compare-card-body { padding: 14px; }
.compare-card-body h4 { font-size: 13px; margin-bottom: 4px; }
.compare-card-body .time { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.compare-card-body .notes {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}

/* ── Assets Grid ── */
.assets-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.asset-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  transition: border-color 0.2s;
}
.asset-card:hover { border-color: var(--border-light); }
.asset-card img, .asset-card video {
  width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover;
}
.asset-card-body { padding: 12px; }
.asset-card-body h4 { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.asset-card-body p { font-size: 11px; color: var(--text-muted); }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; color: var(--text); font-size: 32px;
  cursor: pointer; width: 48px; height: 48px; line-height: 48px;
  border-radius: 50%; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.1); }
.lightbox-content {
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center;
}
.lightbox-content img, .lightbox-content video {
  max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-meta {
  margin-top: 16px; color: var(--text-muted); font-size: 13px;
  text-align: center; max-width: 600px;
}

/* ── Utils ── */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
