/* ============================================
   California Academy of Management
   Custom Styles
   ============================================ */

:root {
  --navy: #1a2b4a;
  --navy-light: #2d4a7a;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --blue: #3b82f6;
  --bg: #f0f4f8;
  --text: #1e293b;
  --muted: #64748b;
  --sidebar-width: 250px;
}

/* ---- Base ---- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

/* ---- Colors ---- */
.text-navy { color: var(--navy) !important; }
.text-gold { color: var(--gold) !important; }
.bg-navy { background-color: var(--navy) !important; }
.bg-gold { background-color: var(--gold) !important; }
.btn-navy {
  background-color: var(--navy);
  color: white;
  border: none;
}
.btn-navy:hover {
  background-color: var(--navy-light);
  color: white;
}
.btn-gold {
  background-color: var(--gold);
  color: var(--navy);
  border: none;
  font-weight: 600;
}
.btn-gold:hover {
  background-color: var(--gold-light);
  color: var(--navy);
}
.btn-outline-navy {
  border: 1px solid var(--navy);
  color: var(--navy);
  background: transparent;
}
.btn-outline-navy:hover {
  background-color: var(--navy);
  color: white;
}
.btn-outline-gold {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn-outline-gold:hover {
  background-color: var(--gold);
  color: var(--navy);
}
.badge-purple {
  background-color: #7c3aed;
  color: white;
}
.bg-navy-light { background-color: rgba(26, 43, 74, 0.08); }

/* ---- Sidebar Layout ---- */
#wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

#page-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.sidebar-brand {
  padding: 20px 20px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}

.nav-section {
  padding: 12px 20px 5px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  color: white;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--gold);
}
.sidebar-link.active {
  color: white;
  background: rgba(255,255,255,0.12);
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 0;
  margin-top: auto;
}

/* ---- Portal Top Bar ---- */
.portal-topbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---- Public Navbar ---- */
.navbar.bg-navy {
  background-color: var(--navy) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---- Hero Section ---- */
.hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, #2d4a7a 60%, #1e3a6e 100%);
  padding: 80px 0;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.min-vh-75 {
  min-height: 75vh;
}

/* ---- Hero Graphic ---- */
.hero-graphic {
  position: relative;
  padding: 40px;
}

.hero-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
}

.hero-badge {
  position: absolute;
  bottom: 20px;
  right: 10px;
  background: white;
  border-radius: 12px;
  padding: 15px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 3;
}

/* ---- Cards ---- */
.card {
  border-radius: 12px;
}

.subject-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
}

.feature-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.enrollment-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
}

.stat-card {
  transition: box-shadow 0.2s;
}

/* ---- Feature Icons ---- */
.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Step Circles ---- */
.step-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(26,43,74,0.3);
}

/* ---- Onboarding Steps ---- */
.step-indicator {
  display: flex;
  align-items: center;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1;
  flex-shrink: 0;
}
.step-indicator.active .step-dot {
  background: var(--navy);
  color: white;
}
.step-indicator.done .step-dot {
  background: #16a34a;
  color: white;
}

.step-line {
  width: 60px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 2px;
}
.step-indicator.done .step-line {
  background: #16a34a;
}

/* ---- Avatar ---- */
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.avatar-circle-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.8rem;
}

/* ---- Lesson Content ---- */
.lesson-content {
  line-height: 1.9;
  font-size: 1rem;
  color: var(--text);
}
.lesson-content h2, .lesson-content h3 {
  color: var(--navy);
  margin-top: 1.5em;
  font-weight: 700;
}
.lesson-content h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 8px;
}

/* ---- Active Lesson ---- */
.active-lesson {
  background: rgba(26,43,74,0.05) !important;
  font-weight: 600;
}

/* ---- Progress bars ---- */
.progress {
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  border-radius: 99px;
}
.bg-gold {
  background-color: var(--gold) !important;
}

/* ---- Status badges ---- */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ---- Report Card ---- */
.report-teaser-card {
  border-radius: 16px;
}

/* ---- Smaller text util ---- */
.smaller {
  font-size: 0.75rem;
}

/* ---- Mobile Sidebar ---- */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #page-content {
    margin-left: 0;
  }
}

/* ---- Table improvements ---- */
.table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

/* ---- Form improvements ---- */
.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,43,74,0.1);
}

/* ---- Cursor ---- */
.cursor-pointer { cursor: pointer; }

/* ---- Lesson Markdown Content (prose) ---- */
.prose {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.97rem;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--navy);
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.prose h1 { font-size: 1.5rem; border-bottom: 2px solid var(--gold); padding-bottom: 0.4rem; }
.prose h2 { font-size: 1.25rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3rem; }
.prose h3 { font-size: 1.05rem; color: var(--navy-light); }
.prose h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.prose p { margin-bottom: 1rem; }
.prose strong { color: var(--navy); font-weight: 600; }
.prose em { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li > ul, .prose li > ol { margin-top: 0.3rem; }
.prose blockquote {
  border-left: 4px solid var(--gold);
  background: #fffbeb;
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #92400e;
  font-style: italic;
}
.prose code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: 0.875rem; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}
.prose table th {
  background: var(--navy);
  color: white;
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prose table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.prose table tr:nth-child(even) td { background: #f8fafc; }
.prose table tr:hover td { background: #eff6ff; }
.prose hr {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 1.75rem 0;
}
.prose a { color: var(--blue); text-decoration: underline; }
.prose a:hover { color: var(--navy); }
