/* ============================================================
   AI Review Assistant — Global Design System (main.css)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --primary:        #6C63FF;
  --primary-dark:   #5A52D5;
  --primary-light:  #EEF0FF;
  --accent:         #FF6584;
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;

  --bg:             #FAFAFA;
  --surface:        #FFFFFF;
  --surface-2:      #F3F4F6;
  --border:         #E5E7EB;
  --text:           #111827;
  --text-muted:     #6B7280;
  --text-light:     #9CA3AF;

  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
  --shadow-glow:    0 0 0 4px rgba(108,99,255,.18);

  --font-sans:      'Inter', system-ui, sans-serif;
  --font-display:   'Plus Jakarta Sans', 'Inter', sans-serif;

  --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg:             #0F1117;
  --surface:        #1A1D27;
  --surface-2:      #252836;
  --border:         #2D3148;
  --text:           #F1F3F9;
  --text-muted:     #8B92A9;
  --text-light:     #555C74;
  --primary-light:  #1E1B4B;
  --shadow-md:      0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
p  { color: var(--text-muted); }

/* ---------- Utility Classes ---------- */
.container     { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center   { text-align: center; }
.text-primary  { color: var(--primary); }
.text-muted    { color: var(--text-muted); }
.font-bold     { font-weight: 700; }
.mt-1 { margin-top: 4px;  }
.mt-2 { margin-top: 8px;  }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 40px; }
.mb-1 { margin-bottom: 4px;  }
.mb-2 { margin-bottom: 8px;  }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 40px; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,.35);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 24px rgba(108,99,255,.5); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,.3);
}
.btn-success:hover { background: #059669; }

.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  transition: background var(--transition), border-color var(--transition);
}
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  transition: all var(--transition);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  transition: background var(--transition);
}
[data-theme="dark"] .navbar {
  background: rgba(26,29,39,0.85);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.navbar-brand .brand-dot { color: var(--primary); }
.navbar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.navbar-logo-placeholder {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.navbar-nav a:hover { color: var(--primary); background: var(--primary-light); }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--primary-light); color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand p { margin-top: 12px; font-size: 0.9rem; max-width: 280px; }
.footer-col h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a { color: var(--text-muted); font-size: 0.9rem; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,.4); }
  50%       { box-shadow: 0 0 0 10px rgba(108,99,255,0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.anim-fade-up  { animation: fadeInUp 0.5s ease forwards; }
.anim-fade     { animation: fadeIn 0.4s ease forwards; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ---------- Alert / Toast ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(108,99,255,.3); }

/* ---------- Section Headings ---------- */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 16px; }
.section-header p  { font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* ---------- KPI Cards (shared) ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.kpi-value { font-size: 2rem; font-weight: 800; font-family: var(--font-display); color: var(--text); line-height: 1; }
.kpi-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-trend { font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger);  }
