/* Recruitment Agent Hub - Base Styles */
/* Themeable via CSS custom properties — see theme-loader.js for presets */

:root {
  /* ── LIGHT THEME — platform-wide default (was Tech View / navy). ─────────
   * White surface, near-black text, subtle gray borders, navy CTA buttons.
   * All var() consumers across the app will switch over automatically.
   * The four page-local light overrides (search-builder-override.css,
   * pipeline.css, hub-messenger.css, agent-peek.css) are now redundant but
   * harmless — they just re-assert the same values. */

  /* Backgrounds — white page, cool-gray panel steps for depth. */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-surface: #f3f4f6;
  --bg-hover: #e5e7eb;
  --bg-tertiary: #fafbfc;
  /* Text — near-black on white, WCAG AA body copy. */
  --text-primary: #111827;
  --text-secondary: rgba(17, 24, 39, 0.72);
  --text-muted: rgba(17, 24, 39, 0.55);
  --text-placeholder: rgba(17, 24, 39, 0.32);
  /* Headings */
  --h1-color: #0b1220;
  --h1-weight: 700;
  --h2-color: #0b1220;
  --h2-weight: 600;
  --h3-color: rgba(11, 18, 32, 0.88);
  --h3-weight: 500;
  --heading-prefix-color: #13131f;
  /* Accent — navy (platform CTA colour). Used for links, focus rings,
     active states, eyebrows. */
  --accent: #13131f;
  --accent-hover: #22273a;
  --accent-text: #ffffff;
  --accent-glow: rgba(19, 19, 31, 0.08);
  --accent-border: rgba(19, 19, 31, 0.22);
  /* Buttons — navy CTA, white writing. */
  --btn-bg: #13131f;
  --btn-text: #ffffff;
  --btn-hover: #22273a;
  --btn-border: rgba(19, 19, 31, 0.18);
  --btn-outline-bg: transparent;
  --btn-outline-text: #13131f;
  --btn-outline-border: rgba(19, 19, 31, 0.28);
  /* Modals */
  --modal-bg: #ffffff;
  --modal-border: rgba(17, 24, 39, 0.12);
  --modal-overlay: rgba(17, 24, 39, 0.45);
  --modal-header-bg: #f8f9fb;
  --modal-title-color: #0b1220;
  /* Borders — soft gray hairlines. */
  --border-color: #e5e7eb;
  --border-color-hover: #d1d5db;
  --border-color-active: #13131f;
  --border-color-subtle: rgba(17, 24, 39, 0.06);
  /* Nav (top strips on legacy pages; command-centre has its own rail CSS). */
  --nav-bg: #ffffff;
  --nav-text: rgba(17, 24, 39, 0.70);
  --nav-active: #13131f;
  --nav-hover: #0b1220;
  /* Cards — plain white with hairline border + soft shadow. */
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-hover-border: #d1d5db;
  --card-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
  --card-hover-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
  --card-radius: 12px;
  /* Inputs */
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus-border: #13131f;
  --input-text: #111827;
  /* Fonts — Fira Code UI, Inter modal body (unchanged). */
  --font-primary: 'Fira Code', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-headings: 'Fira Code', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-modal: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body-weight: 400;
  /* Badges */
  --badge-bg: #13131f;
  --badge-text: #ffffff;
  --badge-subtle-bg: rgba(19, 19, 31, 0.08);
  --badge-subtle-text: #13131f;
  /* Radius */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.14);
  /* Glass (barely-visible wash on light) */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-blur: 8px;
  --glass-border: rgba(17, 24, 39, 0.06);
  /* Chat bubbles */
  --chat-user-bg: #13131f;
  --chat-user-text: #ffffff;
  --chat-agent-bg: #f3f4f6;
  --chat-agent-text: #111827;
  /* Status */
  --color-success: #059669;
  --color-error: #dc2626;
  --color-warning: #d97706;
  /* Sidebar (command centre rail) — a step cooler than page bg. */
  --sidebar-bg: #f8f9fb;
  --sidebar-text: #111827;
  --sidebar-border: #e5e7eb;
  --sidebar-item-hover: #eef0f3;
  --sidebar-item-active: #e5e7eb;
  --sidebar-item-active-text: #13131f;
  /* Chat area */
  --chat-bg: #ffffff;
  --chat-input-bg: #ffffff;
  --chat-input-border: #d1d5db;
  --chat-input-focus: #13131f;
  --chat-send-bg: var(--btn-bg);
  --chat-send-text: var(--btn-text);
  /* Activity panel */
  --activity-bg: #f8f9fb;
  --activity-border: #e5e7eb;
  /* Heading prefix — navy "// " token ahead of headings */
  --heading-prefix: '';
  --heading-prefix-color: #13131f;
  /* App background — plain white (no grid on light theme; it reads noisy). */
  --app-bg-image: none;
  --app-bg-size: auto;
  /* Eyebrow (reusable label style) */
  --eyebrow-color: #13131f;
  --eyebrow-tracking: 0.22em;
  --hairline-gold: rgba(19, 19, 31, 0.10);
  --hairline-white: rgba(17, 24, 39, 0.08);
}

/* ── Command Centre — navy shell override ─────────────────────────────────
 * The Command Centre (command-center.html, detected by the .cc-layout root
 * div) keeps the old Tech View look: navy backgrounds, gold accents, grid +
 * radial-glow page bg, off-white text. Every other page stays on the global
 * light theme defined in :root above. Scoped via body:has(.cc-layout) so
 * iframed pages loaded inside the Centre still render their own light theme
 * (iframes have their own document — this selector doesn't cross the
 * boundary). */
body:has(.cc-layout) {
  --bg-primary: #0f1117;
  --bg-secondary: #151821;
  --bg-surface: #1b1f2e;
  --bg-hover: #22273a;
  --bg-tertiary: #0c0e14;

  --text-primary: #f0eedd;
  --text-secondary: rgba(240, 238, 221, 0.75);
  --text-muted: rgba(240, 238, 221, 0.52);
  --text-placeholder: rgba(240, 238, 221, 0.32);

  --h1-color: #f5f2e8;
  --h2-color: #f5f2e8;
  --h3-color: rgba(245, 242, 232, 0.85);
  --heading-prefix-color: #ffee96;

  --accent: #ffee96;
  --accent-hover: #ffe878;
  --accent-text: #13131f;
  --accent-glow: rgba(255, 238, 150, 0.12);
  --accent-border: rgba(255, 238, 150, 0.30);

  --btn-border: rgba(255, 238, 150, 0.35);
  --btn-outline-text: #ffee96;
  --btn-outline-border: rgba(255, 238, 150, 0.35);

  --modal-bg: rgba(15, 17, 24, 0.95);
  --modal-border: rgba(255, 238, 150, 0.18);
  --modal-overlay: rgba(0, 0, 0, 0.70);
  --modal-header-bg: rgba(255, 255, 255, 0.04);
  --modal-title-color: #f5f2e8;

  --border-color: rgba(255, 238, 150, 0.11);
  --border-color-hover: rgba(255, 238, 150, 0.40);
  --border-color-active: #ffee96;
  --border-color-subtle: rgba(255, 255, 255, 0.09);

  --nav-bg: rgba(13, 15, 20, 0.95);
  --nav-text: rgba(245, 242, 232, 0.65);
  --nav-active: #ffee96;
  --nav-hover: #f5f2e8;

  --card-bg: rgba(255, 255, 255, 0.028);
  --card-border: rgba(255, 238, 150, 0.14);
  --card-hover-border: rgba(255, 238, 150, 0.40);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 8px 32px rgba(255, 238, 150, 0.08);

  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 238, 150, 0.14);
  --input-focus-border: rgba(255, 238, 150, 0.60);
  --input-text: #f0eedd;

  --badge-bg: #ffee96;
  --badge-text: #13131f;
  --badge-subtle-bg: rgba(255, 238, 150, 0.10);
  --badge-subtle-text: #ffee96;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  --glass-bg: rgba(255, 255, 255, 0.025);
  --glass-border: rgba(255, 238, 150, 0.12);

  --chat-user-bg: #ffee96;
  --chat-user-text: #13131f;
  --chat-agent-bg: rgba(255, 255, 255, 0.035);
  --chat-agent-text: #f5f2e8;

  --color-success: #8bc987;
  --color-error: #e87677;
  --color-warning: #e6c178;

  --sidebar-bg: #0d0f15;
  --sidebar-text: #f0eedd;
  --sidebar-border: rgba(255, 238, 150, 0.11);
  --sidebar-item-hover: rgba(255, 255, 255, 0.045);
  --sidebar-item-active: rgba(255, 238, 150, 0.10);
  --sidebar-item-active-text: #ffee96;

  --chat-bg: #0d0f14;
  --chat-input-bg: rgba(255, 255, 255, 0.02);
  --chat-input-border: rgba(255, 238, 150, 0.12);
  --chat-input-focus: rgba(255, 238, 150, 0.50);

  --activity-bg: #12151c;
  --activity-border: rgba(255, 238, 150, 0.08);

  --app-bg-image:
    radial-gradient(circle at 20% 30%, rgba(212,168,67,0.04) 0%, transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(212,168,67,0.025) 0%, transparent 50%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  --app-bg-size: auto, auto, 40px 40px, 40px 40px;

  --eyebrow-color: #ffee96;
  --hairline-gold: rgba(255, 238, 150, 0.08);
  --hairline-white: rgba(255, 255, 255, 0.08);
}

/* ── Command Centre — light-mode scope override ───────────────────────────
 * When the user toggles light mode, html[data-cc-theme="light"] is set.
 * We re-apply the platform light palette to the chat / iframe / results
 * containers ONLY. .cc-rail and .cc-sidebar are intentionally absent so
 * they keep inheriting from body:has(.cc-layout) above and stay navy.
 * Mirrors the scoped-var pattern Player 2 uses (player-2.css:28-67).
 * Pre-paint script in command-center.html sets the attribute BEFORE
 * stylesheet load to avoid theme flash. */
/* Body background flip — direct property overrides (NOT var redefinition)
 * so .cc-rail and .cc-sidebar children keep resolving their navy vars from
 * body:has(.cc-layout) above. Without this the body's dark grid image
 * shows through .cc-main's transparent surface and the toggle looks dead. */
html[data-cc-theme="light"] body {
  background-color: #ffffff;
  background-image: none;
  color: #111827;
}

/* Solid surface backgrounds for the chat / welcome / iframe area so the
 * navy body image can never bleed through. Each var() resolves against
 * the scoped block below. */
html[data-cc-theme="light"] .cc-main,
html[data-cc-theme="light"] .cc-chat,
html[data-cc-theme="light"] .cc-chat-header,
html[data-cc-theme="light"] .cc-messages,
html[data-cc-theme="light"] .cc-input-area,
html[data-cc-theme="light"] .cc-welcome {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
}

html[data-cc-theme="light"] .cc-main,
html[data-cc-theme="light"] .cc-chat,
html[data-cc-theme="light"] .cc-messages,
html[data-cc-theme="light"] .cc-input-area,
html[data-cc-theme="light"] .cc-modal-overlay,
html[data-cc-theme="light"] .cc-activity-panel,
html[data-cc-theme="light"] .cc-player2,
html[data-cc-theme="light"] .cc-welcome {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-surface: #f3f4f6;
  --bg-hover: #e5e7eb;
  --bg-tertiary: #fafbfc;
  --text-primary: #111827;
  --text-secondary: rgba(17, 24, 39, 0.72);
  --text-muted: rgba(17, 24, 39, 0.55);
  --text-placeholder: rgba(17, 24, 39, 0.32);
  --h1-color: #0b1220;
  --h2-color: #0b1220;
  --h3-color: rgba(11, 18, 32, 0.88);
  --heading-prefix-color: #13131f;
  --accent: #13131f;
  --accent-hover: #22273a;
  --accent-text: #ffffff;
  --accent-glow: rgba(19, 19, 31, 0.08);
  --accent-border: rgba(19, 19, 31, 0.22);
  --btn-border: rgba(19, 19, 31, 0.28);
  --btn-outline-text: #13131f;
  --btn-outline-border: rgba(19, 19, 31, 0.28);
  --modal-bg: #ffffff;
  --modal-border: rgba(17, 24, 39, 0.12);
  --modal-overlay: rgba(17, 24, 39, 0.45);
  --modal-header-bg: #f8f9fb;
  --modal-title-color: #0b1220;
  --border-color: #e5e7eb;
  --border-color-hover: #d1d5db;
  --border-color-active: #13131f;
  --border-color-subtle: rgba(17, 24, 39, 0.06);
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-hover-border: #d1d5db;
  --card-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
  --card-hover-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus-border: #13131f;
  --input-text: #111827;
  --badge-bg: #13131f;
  --badge-text: #ffffff;
  --badge-subtle-bg: rgba(19, 19, 31, 0.08);
  --badge-subtle-text: #13131f;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(17, 24, 39, 0.06);
  --chat-user-bg: #13131f;
  --chat-user-text: #ffffff;
  --chat-agent-bg: #f3f4f6;
  --chat-agent-text: #111827;
  --color-success: #059669;
  --color-error: #dc2626;
  --color-warning: #d97706;
  --chat-bg: #ffffff;
  --chat-input-bg: #ffffff;
  --chat-input-border: #d1d5db;
  --chat-input-focus: #13131f;
  --activity-bg: #f8f9fb;
  --activity-border: #e5e7eb;
  --hairline-gold: rgba(19, 19, 31, 0.10);
  --hairline-white: rgba(17, 24, 39, 0.08);
  --app-bg-image: none;
  --app-bg-size: auto;
}

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

body {
  font-family: var(--font-primary);
  font-weight: var(--font-body-weight);
  background-color: var(--bg-primary);
  background-image: var(--app-bg-image);
  background-size: var(--app-bg-size);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Reusable homepage primitives — available on every page ──────────────
 * Eyebrow label (gold, uppercase, with short rule) — use for section headers.
 * Hairline — 1px gold divider for panel edges. Keep decorations sparse. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-primary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--eyebrow-color);
  text-transform: uppercase;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--eyebrow-color);
  opacity: 0.6;
  flex-shrink: 0;
}
.hairline { border-top: 1px solid var(--hairline-gold); }
.hairline-v { border-left: 1px solid var(--hairline-white); }

/* Navigation */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur));
}

nav .logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

nav .nav-links {
  display: flex;
  gap: 24px;
  flex: 1;
  justify-content: center;
}

nav .nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.2s, background 0.2s;
}

nav .nav-links a:hover {
  color: var(--nav-hover);
  background: var(--bg-hover);
}

nav .nav-links a.active {
  color: var(--nav-active);
  font-weight: 600;
  background: var(--bg-hover);
}

nav .nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: navSlideIn 0.3s ease-out;
}

@keyframes navSlideIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 20px;
    opacity: 1;
  }
}

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

nav .logout-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}

nav .logout-btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px;
}

.page-title {
  font-size: 24px;
  font-weight: var(--h1-weight);
  font-family: var(--font-headings);
  margin-bottom: 8px;
  color: var(--h1-color);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-placeholder);
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* Login page */
.login-container {
  max-width: 400px;
  margin: 120px auto;
  padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-container h1 {
  font-size: 22px;
  font-family: var(--font-headings);
  margin-bottom: 24px;
  text-align: center;
  color: var(--accent);
}

.login-container input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--input-text);
  font-size: 14px;
  font-family: var(--font-primary);
}

.login-container input:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-container button {
  width: 100%;
  padding: 12px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.login-container button:hover {
  background: var(--btn-hover);
}

.login-error {
  color: var(--color-error);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
