/* public/css/alexandra.css — Alexandra AI agent panel styles.
   Design tokens and 5-screen mobile layout for NovaReelOS. */

/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
  --alex-bg:         #0E0E10;
  --alex-primary:    #3B82F6;
  --alex-text:       #FFFFFF;
  --alex-text-muted: #9CA3AF;
  --alex-surface:    #18181B;
  --alex-border:     #27272A;
  --alex-radius:     12px;
  --alex-pad:        16px;
  --alex-shadow:     0 4px 24px rgba(0,0,0,0.5);
}

/* ── Outer panel ────────────────────────────────────────────────────────────── */
.alex-panel {
  background: var(--alex-bg);
  color: var(--alex-text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.alex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--alex-pad);
  background: var(--alex-surface);
  border-bottom: 1px solid var(--alex-border);
  box-shadow: var(--alex-shadow);
}

.alex-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--alex-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.alex-header-info {
  flex: 1;
  min-width: 0;
}

.alex-header-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.alex-header-status {
  font-size: 13px;
  color: var(--alex-text-muted);
  margin-top: 2px;
}

.alex-header-status.routing {
  color: #FBBF24;
}

.alex-header-mode {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(59,130,246,0.15);
  color: var(--alex-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Screen tab nav ─────────────────────────────────────────────────────────── */
.alex-nav {
  display: flex;
  background: var(--alex-surface);
  border-bottom: 1px solid var(--alex-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.alex-nav::-webkit-scrollbar { display: none; }

.alex-nav-btn {
  flex: 1;
  min-width: 60px;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--alex-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.alex-nav-btn.active,
.alex-nav-btn:hover {
  color: var(--alex-primary);
  border-bottom-color: var(--alex-primary);
}

/* ── Screens ─────────────────────────────────────────────────────────────────── */
.alex-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: var(--alex-pad);
  overflow-y: auto;
  gap: 16px;
}

.alex-screen--active {
  display: flex;
}

/* ── Intent input bar ───────────────────────────────────────────────────────── */
.alex-intent-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alex-intent-bar textarea {
  width: 100%;
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  color: var(--alex-text);
  font-size: 15px;
  padding: 12px;
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.alex-intent-bar textarea:focus {
  border-color: var(--alex-primary);
}

.alex-intent-bar textarea::placeholder {
  color: var(--alex-text-muted);
}

.alex-intent-error {
  font-size: 13px;
  color: #EF4444;
  display: none;
}

.alex-intent-error.visible {
  display: block;
}

.alex-submit-btn {
  align-self: flex-end;
  background: var(--alex-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.alex-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Quick action grid ──────────────────────────────────────────────────────── */
.alex-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.alex-quick-item {
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: var(--alex-shadow);
}

.alex-quick-item:hover {
  border-color: var(--alex-primary);
  background: rgba(59,130,246,0.07);
}

.alex-quick-icon {
  font-size: 22px;
  line-height: 1;
}

.alex-quick-label {
  font-size: 11px;
  color: var(--alex-text-muted);
  text-align: center;
  line-height: 1.3;
}

/* ── Department chips ───────────────────────────────────────────────────────── */
.alex-dept-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.alex-dept-chips::-webkit-scrollbar { display: none; }

.alex-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--alex-border);
  background: var(--alex-surface);
  color: var(--alex-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.alex-chip.active {
  background: var(--alex-primary);
  color: #fff;
  border-color: var(--alex-primary);
}

/* ── Activity list ──────────────────────────────────────────────────────────── */
.alex-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alex-activity-item {
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--alex-shadow);
}

.alex-activity-intent {
  font-size: 14px;
  font-weight: 500;
}

.alex-activity-meta {
  font-size: 12px;
  color: var(--alex-text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alex-activity-dept {
  background: rgba(59,130,246,0.12);
  color: var(--alex-primary);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

.alex-empty {
  color: var(--alex-text-muted);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

/* ── Section headings ───────────────────────────────────────────────────────── */
.alex-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--alex-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* ── Routing timeline ───────────────────────────────────────────────────────── */
.alex-routing-header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alex-routing-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alex-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alex-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  transition: background 0.2s;
}

.status-pending  { background: #6B7280; }
.status-running  { background: #FBBF24; }
.status-complete { background: #22C55E; }
.status-error    { background: #EF4444; }

.alex-step-body {
  flex: 1;
  min-width: 0;
}

.alex-step-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.alex-step-dept {
  font-size: 12px;
  color: var(--alex-text-muted);
  margin-bottom: 6px;
}

.alex-step-bar-wrap {
  height: 4px;
  background: var(--alex-border);
  border-radius: 2px;
  overflow: hidden;
}

.alex-step-bar {
  height: 100%;
  background: var(--alex-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.alex-status-footer {
  font-size: 13px;
  color: var(--alex-text-muted);
  text-align: center;
  padding-top: 4px;
}

/* ── Analytics ──────────────────────────────────────────────────────────────── */
.alex-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.alex-metric-card {
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  padding: var(--alex-pad);
  box-shadow: var(--alex-shadow);
}

.alex-metric-title {
  font-size: 12px;
  color: var(--alex-text-muted);
  margin-bottom: 6px;
}

.alex-metric-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.alex-metric-delta {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.alex-metric-delta.positive { color: #22C55E; }
.alex-metric-delta.negative { color: #EF4444; }
.alex-metric-delta.neutral  { color: var(--alex-text-muted); }

.alex-recommendation {
  background: var(--alex-surface);
  border: 1px solid var(--alex-primary);
  border-radius: var(--alex-radius);
  padding: var(--alex-pad);
  box-shadow: var(--alex-shadow);
}

.alex-reco-summary {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--alex-text);
}

.alex-reco-action {
  background: var(--alex-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

/* ── Message/deal cards ─────────────────────────────────────────────────────── */
.alex-deal-card {
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  padding: var(--alex-pad);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--alex-shadow);
}

.alex-deal-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--alex-primary);
}

.alex-deal-brand {
  font-size: 16px;
  font-weight: 600;
}

.alex-deal-proposal {
  font-size: 14px;
  color: var(--alex-text-muted);
  line-height: 1.5;
}

.alex-deal-next {
  margin-top: 4px;
  background: none;
  border: 1px solid var(--alex-primary);
  border-radius: 8px;
  color: var(--alex-primary);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

/* ── Creator fit card ───────────────────────────────────────────────────────── */
.alex-fit-card {
  background: var(--alex-surface);
  border: 1px solid var(--alex-border);
  border-radius: var(--alex-radius);
  padding: var(--alex-pad);
  box-shadow: var(--alex-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.alex-fit-score-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--alex-primary) 0%, var(--alex-border) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.alex-fit-score-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--alex-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.alex-fit-estimates {
  display: flex;
  gap: 24px;
  justify-content: center;
  width: 100%;
}

.alex-fit-stat {
  text-align: center;
}

.alex-fit-stat-label {
  font-size: 12px;
  color: var(--alex-text-muted);
  margin-bottom: 4px;
}

.alex-fit-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--alex-text);
}

.alex-fit-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.alex-fit-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.alex-fit-btn-primary {
  background: var(--alex-primary);
  color: #fff;
}

.alex-fit-btn-secondary {
  background: none;
  border: 1px solid var(--alex-border) !important;
  color: var(--alex-text);
}

/* ── Loading spinner ─────────────────────────────────────────────────────────── */
.alex-loading {
  color: var(--alex-text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

/* ── Face C Avatar ───────────────────────────────────────────────────────────── */
.alex-face-c {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.alex-face-c.avatar-warm {
  background-image: url('https://pub-629428d185ca4960a0a73c850d32294b.r2.dev/company_188053/images/6407afeb-69cc-4fba-b9d3-49706384ef2e.png');
}

.alex-face-c.avatar-neural {
  background-image: url('https://pub-629428d185ca4960a0a73c850d32294b.r2.dev/company_188053/images/491033cd-3f12-4d5e-ba11-60e99e3c9a3a.png');
}

/* Override alex-header-avatar when Face C is active */
.alex-header-avatar.alex-face-c {
  background: none;
}

/* Face C Conductor Mode variant */
.alex-face-c--conductor {
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid #3B82F6;
}
