/* ==========================================================================
   TutorAI Marketplace — Design System
   Layered on top of Bootstrap's grid/utility classes (kept for layout
   stability across ~30 existing pages) but overrides colors, type, shadows,
   radius, and every visible component so nothing reads as "default
   Bootstrap." Custom components (hero, sidebar, tutor cards, pricing,
   testimonials) are original.
   ========================================================================== */

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

:root {
  /* ---- Brand palette ---- */
  --brand-50:  #f2f1fd;
  --brand-100: #e4e2fb;
  --brand-200: #c9c5f7;
  --brand-300: #a8a0f0;
  --brand-400: #8a7ce8;
  --brand-500: #6d5adf;   /* primary */
  --brand-600: #5a44d1;
  --brand-700: #4934ab;
  --brand-800: #3a2a87;
  --brand-900: #2a1e63;

  --accent-500: #14b8a6;  /* teal — success / earnings / growth */
  --accent-600: #0d9488;
  --gold-500:   #f5a524;  /* ratings / stars */
  --coral-500:  #f5476f;  /* alerts / danger accents */

  --ink-900: #14131f;
  --ink-800: #221f36;
  --ink-700: #363252;
  --ink-500: #6b6685;
  --ink-400: #918cab;
  --ink-200: #e2e0f0;
  --ink-100: #eeecf9;
  --ink-50:  #f7f6fd;

  --surface: #ffffff;
  --surface-alt: #faf9fe;

  /* ---- Type ---- */
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* ---- Shape / elevation ---- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 19, 31, 0.06), 0 1px 3px rgba(20, 19, 31, 0.04);
  --shadow-md: 0 4px 16px rgba(42, 30, 99, 0.08), 0 2px 6px rgba(42, 30, 99, 0.04);
  --shadow-lg: 0 16px 40px rgba(42, 30, 99, 0.14), 0 4px 12px rgba(42, 30, 99, 0.06);
  --shadow-glow: 0 0 0 4px rgba(109, 90, 223, 0.14);

  --gradient-brand: linear-gradient(135deg, #6d5adf 0%, #8a4fe0 50%, #a04fd6 100%);
  --gradient-warm: linear-gradient(135deg, #f5a524 0%, #f5476f 100%);
}

/* ---- Base ---- */
body {
  font-family: var(--font-body);
  color: var(--ink-800);
  background: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .display-font {
  font-family: var(--font-display);
  color: var(--ink-900);
  letter-spacing: -0.02em;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

/* ==========================================================================
   Public Navbar
   ========================================================================== */
.navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-100) !important;
  padding: 1rem 0;
}
.navbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.navbar .d-flex a {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--ink-700);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: all .15s ease;
}
.navbar .d-flex a:hover { background: var(--brand-50); color: var(--brand-700); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.5rem;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-outline-secondary, .btn-outline-primary {
  border: 1.5px solid var(--ink-200);
  color: var(--ink-700);
  background: #fff;
}
.btn-outline-secondary:hover, .btn-outline-primary:hover {
  border-color: var(--brand-400);
  color: var(--brand-700);
  background: var(--brand-50);
}
.btn-outline-success { border: 1.5px solid var(--accent-500); color: var(--accent-600); background: #fff; }
.btn-outline-success:hover { background: var(--accent-500); color: #fff; }
.btn-outline-danger { border: 1.5px solid var(--coral-500); color: var(--coral-500); background: #fff; }
.btn-outline-danger:hover { background: var(--coral-500); color: #fff; }
.btn-lg { padding: 0.9rem 2.1rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-link { font-weight: 600; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control, .form-select {
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  color: var(--ink-800);
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-glow);
}
.form-label { font-weight: 600; color: var(--ink-700); font-size: 0.9rem; margin-bottom: 0.4rem; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
  --bs-table-bg: transparent;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  border-bottom: 2px solid var(--ink-100);
  padding: 0.85rem 1rem;
}
.table tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-800);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--brand-50); }

/* ==========================================================================
   Alerts / Badges
   ========================================================================== */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.2rem;
  font-weight: 500;
}
.alert-success { background: #e6f9f4; color: var(--accent-600); }
.alert-danger  { background: #fde8ec; color: #c62a4c; }
.alert-info    { background: var(--brand-50); color: var(--brand-700); }
.alert-warning { background: #fef3e2; color: #b5730f; }

.badge { font-weight: 600; border-radius: var(--radius-pill); padding: 0.35em 0.85em; }
.bg-primary { background: var(--brand-500) !important; }
.bg-success { background: var(--accent-500) !important; }
.bg-secondary { background: var(--ink-400) !important; }

/* ==========================================================================
   Hero (public landing / marketing pages)
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 6rem;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  background: radial-gradient(circle at 30% 20%, rgba(109,90,223,0.16), transparent 60%),
              radial-gradient(circle at 80% 10%, rgba(20,184,166,0.14), transparent 55%);
  z-index: -1;
}
.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
}
.hero .lead { font-size: 1.2rem; color: var(--ink-500); max-width: 640px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--brand-200);
}

/* ==========================================================================
   Tutor cards (marketplace grid)
   ========================================================================== */
.tutor-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
  height: 100%;
}
.tutor-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tutor-card__avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  flex-shrink: 0;
}
.tutor-card__rating { color: var(--gold-500); font-weight: 700; font-size: 0.9rem; }
.tutor-card__price { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink-900); }
.match-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: linear-gradient(135deg, #e6f9f4, #e4e2fb);
  color: var(--accent-600);
  font-weight: 800; font-size: 0.82rem;
  padding: 0.3rem 0.75rem; border-radius: var(--radius-pill);
}

/* ==========================================================================
   Dashboard shell (sidebar + topbar)
   ========================================================================== */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--ink-900);
  color: #fff;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.dash-sidebar__brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  color: #fff; padding: 0 0.5rem;
}
.dash-sidebar__brand span { color: var(--brand-300); }
.dash-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.dash-nav a {
  display: flex; align-items: center; gap: 0.7rem;
  color: rgba(255,255,255,0.68);
  font-weight: 600; font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
}
.dash-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dash-nav a.active { background: var(--gradient-brand); color: #fff; }
.dash-main { flex: 1; min-width: 0; }
.dash-topbar {
  background: #fff; border-bottom: 1px solid var(--ink-100);
  padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between;
}
.dash-content { padding: 2rem; }
.dash-user-chip {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.06); border-radius: var(--radius-pill);
  padding: 0.5rem 0.9rem; color: #fff; font-size: 0.85rem; font-weight: 600;
  margin-top: auto;
}

/* Stat cards for dashboards */
.stat-card {
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  background: #fff;
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.stat-card__label { color: var(--ink-500); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-card__value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink-900); margin-top: 0.25rem; }

/* ==========================================================================
   Pricing / testimonials (landing page)
   ========================================================================== */
.pricing-card {
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--ink-100);
  background: #fff;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-sm);
}
.pricing-card--featured {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(1.03);
}
.testimonial-card {
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--ink-100);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Empty / loading states
   ========================================================================== */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; color: var(--ink-500); }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 37%, var(--ink-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
  .dash-sidebar { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 1050; transition: left .2s ease; }
  .dash-sidebar.is-open { left: 0; }
  .dash-content { padding: 1.25rem; }
}
@media (max-width: 576px) {
  .hero { padding: 3rem 0 4rem; }
  .pricing-card--featured { transform: none; }
}
