/*
 * ReelMetrics Script Web — Bootstrap 5.3 palette customization
 *
 * Data-cinematic style: charcoal/amber on script-white, subtle motion.
 */

/* ── Shared design tokens ──────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  /* Primary */
  --charcoal: #1a1a1a;
  --slate: #4a5568;
  /* Secondary */
  --script-white: #fdfbf7;
  --light-gray: #f0f0f0;
  /* Accent */
  --amber: #ff9d00;
  --crimson: #e50914;
  /* Neutrals */
  --panel-white: #ffffff;
  /* Semantic aliases */
  --bg: var(--script-white);
  --panel: var(--panel-white);
  --text: var(--charcoal);
  --muted: var(--slate);
  --accent: var(--amber);
  --accent-hv: #e68f00;
  --border: var(--light-gray);
  /* Bootstrap overrides */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-hv);
  --bs-border-color: var(--border);
  --bs-heading-color: var(--text);
  --bs-card-bg: var(--panel);
  --bs-card-border-color: var(--border);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--script-white) 0%, #f5f0e6 100%);
  min-height: 100vh;
  position: relative;
}

/* Subtle film grain overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

/* ── Site header / nav ───────────────────────────────────────────────────── */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}

.site-footer small { color: var(--muted); }

.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.nav a:hover { color: var(--amber); }
.nav .brand { font-weight: 700; font-size: 1rem; color: var(--text); }
.nav .spacer { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  transition: all 0.15s ease-out;
}
.btn-primary:hover {
  background: var(--accent-hv);
  border-color: var(--accent-hv);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 157, 0, 0.35);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  border-radius: 6px;
}
.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 157, 0, 0.2);
}

/* ── Upload page specific ────────────────────────────────────────────────── */
.upload-header {
  padding: 4rem 0 2rem;
  text-align: center;
}
.upload-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 1rem;
}
.upload-lead {
  font-size: 1.2rem;
  color: var(--slate);
  max-width: 44rem;
  margin: 0 auto 2rem;
}
.upload-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Status page ─────────────────────────────────────────────────────────── */
.status-section {
  padding: 3rem 0;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.status-item {
  background: var(--panel-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
}
.status-item .label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.status-item .value {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--charcoal);
}

/* ── Report page ─────────────────────────────────────────────────────────── */
.report-section {
  padding: 3rem 0;
}
.report-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--panel-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}
.metric-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.metric-value {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--amber);
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--amber);
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  border: none;
}
.alert-info {
  background: rgba(49, 130, 206, 0.1);
  color: var(--charcoal);
}
.alert-success {
  background: rgba(56, 161, 105, 0.1);
  color: var(--charcoal);
}
.alert-warning {
  background: rgba(214, 158, 46, 0.1);
  color: var(--charcoal);
}
.alert-error {
  background: rgba(229, 62, 62, 0.1);
  color: var(--charcoal);
}

/* ── Utility classes ─────────────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-accent { color: var(--amber); }
.bg-panel { background: var(--panel-white); }

/* ── Scroll reveal (optional JS triggers .reveal) ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Progress timeline (platform_status.html) ───────────────────────────── */
.progress-timeline {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  position: relative;
}
.progress-timeline-track {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 4px;
  background: #e0e0e0;
  z-index: 0;
  transform: translateY(-50%);
}
.progress-timeline-step {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 20%;
}
.progress-timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0e0e0;
  border: 2px solid #a64b2a;
  margin: 0 auto 0.5rem;
}
.progress-timeline-dot.active {
  background: white;
}
.progress-timeline-dot.done {
  background: #a64b2a;
}
.progress-timeline-label {
  font-size: 0.85rem;
  color: #666;
}
.progress-timeline-label.active {
  color: black;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
