/* ============================================================
   GC Africa — Shared Design System
   globals.css
   ============================================================ */

@import url("https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  /* Brand Colors */
  --gc-navy:       #0f172a;
  --gc-navy-mid:   #1e293b;
  --gc-navy-light: #334155;
  --gc-slate:      #475569;
  --gc-muted:      #64748b;
  --gc-border:     #e2e8f0;
  --gc-border-mid: #cbd5e1;
  --gc-bg:         #f8fafc;
  --gc-bg-mid:     #f1f5f9;
  --gc-white:      #ffffff;
  --gc-success:    #16a34a;
  --gc-success-bg: #dcfce7;
  --gc-warn:       #d97706;
  --gc-warn-bg:    #fef3c7;
  --gc-danger:     #dc2626;
  --gc-danger-bg:  #fee2e2;

  /* Button gradient */
  --gc-btn-grad: linear-gradient(45deg, #0f172a 0%, #1e293b 50%, #334155 100%);

  /* Font */
  --font: "Inter", Helvetica, sans-serif;

  /* Header height */
  --header-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--gc-bg);
  color: var(--gc-navy);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
button:focus-visible { outline: 2px solid #4a90e2 !important; }
img { max-width: 100%; }

/* ── Shared Header ── */
.gc-header {
  width: 100%;
  height: var(--header-h);
  background: var(--gc-white);
  border-bottom: 1px solid var(--gc-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
}

.gc-header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.gc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.gc-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gc-btn-grad);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.gc-brand-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--gc-navy);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.gc-brand-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--gc-bg-mid);
  color: var(--gc-slate);
  border: 1px solid var(--gc-border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Desktop Nav */
.gc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--gc-slate);
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.gc-nav-link:hover { color: var(--gc-navy); background: var(--gc-bg); }
.gc-nav-link.active { color: var(--gc-navy); background: var(--gc-bg-mid); font-weight: 600; }

/* Header right */
.gc-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.gc-btn-outline {
  background: transparent;
  border: 1px solid var(--gc-border-mid);
  color: var(--gc-navy-light);
}
.gc-btn-outline:hover { background: var(--gc-bg-mid); }
.gc-btn-primary {
  background: var(--gc-btn-grad);
  color: white;
  border: none;
}
.gc-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.gc-btn-success { background: var(--gc-success); color: white; }
.gc-btn-success:hover { background: #15803d; }
.gc-btn-ghost {
  background: transparent;
  border: 1px solid var(--gc-border);
  color: var(--gc-slate);
}
.gc-btn-ghost:hover { background: var(--gc-bg-mid); }
.gc-btn-sm { padding: 6px 14px; font-size: 13px; }
.gc-btn-lg { padding: 12px 28px; font-size: 15px; }

/* User avatar chip */
.gc-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.gc-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.gc-user-info { display: flex; flex-direction: column; }
.gc-user-name { font-size: 13px; font-weight: 600; color: var(--gc-navy); line-height: 1.2; }
.gc-user-role { font-size: 11px; color: var(--gc-muted); }

/* Hamburger */
.gc-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--gc-border);
  border-radius: 6px;
  padding: 7px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
}
.gc-hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--gc-navy);
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile nav */
.gc-mobile-nav {
  display: none;
  flex-direction: column;
  background: white;
  border-top: 1px solid var(--gc-border);
  padding: 12px 16px;
  gap: 4px;
  position: absolute;
  top: var(--header-h);
  left: 0; right: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 199;
}
.gc-mobile-nav.open { display: flex; }
.gc-mobile-nav .gc-nav-link { padding: 10px 12px; font-size: 15px; }
.gc-mobile-nav-divider { height: 1px; background: var(--gc-border); margin: 8px 0; }
.gc-mobile-nav-btns { display: flex; gap: 8px; padding: 4px 0; }

/* ── Sidebar layout (admin + learner inner pages) ── */
.gc-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.gc-sidebar {
  width: 240px;
  background: var(--gc-white);
  border-right: 1px solid var(--gc-border);
  padding: 20px 0;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.gc-sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gc-muted);
  padding: 12px 20px 6px;
  margin-top: 8px;
}
.gc-sidebar-section:first-child { margin-top: 0; }

.gc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gc-slate);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.gc-sidebar-link:hover { color: var(--gc-navy); background: var(--gc-bg); }
.gc-sidebar-link.active {
  color: var(--gc-navy);
  background: var(--gc-bg-mid);
  border-left-color: var(--gc-navy);
  font-weight: 600;
}
.gc-sidebar-link svg, .gc-sidebar-link .icon {
  width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7;
}

/* ── Main content ── */
.gc-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
  background: var(--gc-bg);
}

/* ── Page header ── */
.gc-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.gc-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gc-navy);
  letter-spacing: -0.3px;
  margin: 0 0 4px;
}
.gc-page-subtitle {
  font-size: 14px;
  color: var(--gc-muted);
  margin: 0;
}
.gc-page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Cards ── */
.gc-card {
  background: var(--gc-white);
  border: 1px solid var(--gc-border);
  border-radius: 12px;
  padding: 20px 24px;
}
.gc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gc-navy);
  margin: 0 0 16px;
}

/* Stat cards */
.gc-stat-card {
  background: var(--gc-white);
  border: 1px solid var(--gc-border);
  border-radius: 12px;
  padding: 20px;
}
.gc-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gc-navy);
  letter-spacing: -0.5px;
  line-height: 1;
}
.gc-stat-label {
  font-size: 13px;
  color: var(--gc-muted);
  margin-top: 4px;
}
.gc-stat-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.gc-stat-up { color: var(--gc-success); }
.gc-stat-down { color: var(--gc-danger); }

/* ── Grid utilities ── */
.gc-grid { display: grid; gap: 16px; }
.gc-grid-2 { grid-template-columns: repeat(2, 1fr); }
.gc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.gc-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Badges ── */
.gc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.gc-badge-green  { background: var(--gc-success-bg); color: #15803d; }
.gc-badge-yellow { background: var(--gc-warn-bg); color: #92400e; }
.gc-badge-red    { background: var(--gc-danger-bg); color: #b91c1c; }
.gc-badge-gray   { background: var(--gc-bg-mid); color: var(--gc-slate); }
.gc-badge-navy   { background: var(--gc-navy); color: white; }

/* ── Tables ── */
.gc-table { width: 100%; border-collapse: collapse; }
.gc-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gc-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  background: var(--gc-bg);
  border-bottom: 1px solid var(--gc-border);
}
.gc-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--gc-border);
  color: var(--gc-navy-light);
}
.gc-table tbody tr:hover { background: var(--gc-bg); }
.gc-table tbody tr:last-child td { border-bottom: none; }

/* ── Form elements ── */
.gc-form-group { margin-bottom: 16px; }
.gc-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gc-navy-light);
  margin-bottom: 6px;
}
.gc-input, .gc-select, .gc-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gc-border-mid);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gc-navy);
  background: var(--gc-white);
  transition: border-color 0.15s;
  outline: none;
}
.gc-input:focus, .gc-select:focus, .gc-textarea:focus {
  border-color: var(--gc-navy);
  box-shadow: 0 0 0 3px rgba(15,23,42,0.08);
}
.gc-textarea { resize: vertical; min-height: 80px; }

/* ── Progress bar ── */
.gc-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gc-border);
  border-radius: 10px;
  overflow: hidden;
}
.gc-progress-fill {
  height: 100%;
  background: var(--gc-navy);
  border-radius: 10px;
  transition: width 0.6s ease;
}
.gc-progress-fill.green { background: var(--gc-success); }

/* ── Breadcrumb ── */
.gc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gc-muted);
  margin-bottom: 16px;
}
.gc-breadcrumb a { color: var(--gc-slate); }
.gc-breadcrumb a:hover { color: var(--gc-navy); }
.gc-breadcrumb-sep { color: var(--gc-border-mid); }
.gc-breadcrumb-current { color: var(--gc-navy); font-weight: 500; }

/* ── Alert/notice ── */
.gc-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.gc-alert-success { background: var(--gc-success-bg); color: #15803d; border: 1px solid #bbf7d0; }
.gc-alert-warn    { background: var(--gc-warn-bg); color: #92400e; border: 1px solid #fde68a; }
.gc-alert-danger  { background: var(--gc-danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
.gc-alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Modal ── */
.gc-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gc-modal-overlay.open { display: flex; }
.gc-modal {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}
.gc-modal-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.gc-modal-subtitle { font-size: 14px; color: var(--gc-muted); margin: 0 0 20px; }
.gc-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  font-size: 20px; color: var(--gc-muted);
  cursor: pointer; line-height: 1;
  padding: 4px;
}

/* ── Divider ── */
.gc-divider { height: 1px; background: var(--gc-border); margin: 20px 0; }

/* ── Tabs ── */
.gc-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gc-border); margin-bottom: 20px; }
.gc-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gc-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.gc-tab:hover { color: var(--gc-navy); }
.gc-tab.active { color: var(--gc-navy); border-bottom-color: var(--gc-navy); font-weight: 600; }

/* ── Public (no-sidebar) page wrapper ── */
.gc-public-page { min-height: 100vh; }
.gc-section { padding: 64px 40px; }
.gc-section-inner { max-width: 1200px; margin: 0 auto; }
.gc-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gc-bg-mid);
  border: 1px solid var(--gc-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gc-slate);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gc-section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gc-navy);
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}
.gc-section-body {
  font-size: 16px;
  color: var(--gc-slate);
  line-height: 1.7;
  margin: 0 0 24px;
  max-width: 600px;
}

/* ── Lesson sidebar layout ── */
.gc-lesson-layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  min-height: calc(100vh - var(--header-h));
}
.gc-lesson-sidebar {
  border-right: 1px solid var(--gc-border);
  background: white;
  padding: 20px 0;
  overflow-y: auto;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}
.gc-lesson-main { padding: 28px 32px; background: var(--gc-bg); }
.gc-lesson-right {
  border-left: 1px solid var(--gc-border);
  background: white;
  padding: 20px;
  overflow-y: auto;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}

/* ── Footer ── */
.gc-footer {
  background: var(--gc-navy);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  margin-top: auto;
}
.gc-footer a { color: rgba(255,255,255,0.8); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .gc-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gc-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .gc-lesson-layout { grid-template-columns: 220px 1fr; }
  .gc-lesson-right { display: none; }
}

@media (max-width: 768px) {
  .gc-header-inner { padding: 0 16px; }
  .gc-nav { display: none; }
  .gc-hamburger { display: flex; }
  .gc-sidebar { display: none; }
  .gc-main { padding: 16px; }
  .gc-grid-2, .gc-grid-3, .gc-grid-4 { grid-template-columns: 1fr; }
  .gc-section { padding: 40px 16px; }
  .gc-section-title { font-size: 24px; }
  .gc-lesson-layout { grid-template-columns: 1fr; }
  .gc-lesson-sidebar { display: none; }
  .gc-page-header { flex-direction: column; align-items: flex-start; }
  .gc-user-info { display: none; }
}
