/**
 * AI Spotlight — Shared Base Styles
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  /* AI Spotlight Brand Colors */
  --color-primary:   #FF6B35;
  --color-secondary: #EC4899;
  --color-gradient:  linear-gradient(135deg, #FF6B35, #EC4899);
  --color-dark:      #1A1A2E;
  --color-surface:   #F8F9FA;
  --color-card:      #FFFFFF;
  --color-border:    #E5E7EB;
  --color-text:      #374151;
  --color-muted:     #9CA3AF;

  /* Status Colors */
  --success: #10B981;
  --danger:  #EF4444;
  --warning: #F59E0B;
  --info:    #3B82F6;

  /* Gray Scale */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic aliases */
  --primary:       var(--color-primary);
  --accent:        var(--color-secondary);
  --text-primary:  var(--color-text);
  --text-muted:    var(--color-muted);
  --bg-primary:    var(--color-card);
  --bg-secondary:  var(--color-surface);
  --border:        var(--color-border);
  --error:         var(--danger);
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 100vh;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.3;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 24px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-gradient);
  color: white;
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45); color: white; }

.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--gray-50); color: var(--color-dark); }

.btn-danger {
  background: #FEE2E2;
  color: var(--danger);
  border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FECACA; }

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ── Spotlight CTA Button ────────────────────────────────── */
.btn-spotlight {
  background: var(--color-gradient);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
  transition: all 0.18s;
  text-decoration: none;
}
.btn-spotlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
  color: white;
}

/* ── Tables ──────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--color-border);
  background: var(--gray-50);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr { cursor: pointer; transition: background 0.15s; }
.table-hover tbody tr:hover { background: #FFF7F5; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-muted   { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(236,72,153,0.15)); color: var(--color-primary); }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--color-dark); margin-bottom: 6px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

select.form-control { cursor: pointer; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 18px; font-weight: 700; color: var(--color-dark); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: background 0.15s;
}
.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 12px; }

/* ── Alerts / Toasts ─────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Page Layout ─────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-dark);
}
.page-subtitle {
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 4px;
}

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  gap: 16px;
  color: var(--color-muted);
  font-size: 14px;
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--color-dark); margin-bottom: 8px; }
.empty-state-desc { font-size: 14px; }

/* ── Status dots ─────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot-success { background: var(--success); }
.status-dot-danger  { background: var(--danger); }
.status-dot-warning { background: var(--warning); animation: pulse 1.5s infinite; }
.status-dot-muted   { background: var(--color-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Toast Notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast-success { background: #065F46; color: white; }
.toast-error   { background: #991B1B; color: white; }
.toast-info    { background: var(--color-dark); color: white; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Gradient Text ───────────────────────────────────────── */
.gradient-text {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Utility ─────────────────────────────────────────────── */
.text-muted   { color: var(--color-muted); }
.text-primary { color: var(--color-primary); }
.text-dark    { color: var(--color-dark); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.mt-4         { margin-top: 16px; }
.mb-4         { margin-bottom: 16px; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1       { flex: 1; }
.hidden       { display: none !important; }
.w-100        { width: 100%; }
