/* getclassroom — Draper Brand System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #1a1a2e;
  --bg-mid: #16213e;
  --primary: #0f3460;
  --accent: #e94560;
  --accent-glow: rgba(233,69,96,0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--surface-alt); color: var(--text); line-height: 1.6; }
.view { display: none; }
.view.active { display: block; }

/* ── Buttons ── */
.btn { padding: 12px 28px; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600; transition: all 0.2s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #d63851; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233,69,96,0.3); }
.btn-secondary { background: transparent; color: var(--surface); border: 2px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { border-color: white; background: rgba(255,255,255,0.1); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary); color: white; }

/* ── Landing ── */
.landing-header {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--primary) 100%);
  color: white; padding: 40px 20px;
}
.landing-header .container { max-width: 640px; }
.landing-header h1 { font-size: 3.2rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -1px; }
.landing-header .tagline { font-size: 1.15rem; color: rgba(255,255,255,0.75); margin-bottom: 40px; line-height: 1.7; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.price { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* ── Auth Cards ── */
.auth-card {
  max-width: 400px; margin: 80px auto; padding: 40px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.auth-card h2 { margin-bottom: 24px; color: var(--text); font-size: 1.5rem; }
.auth-card input {
  width: 100%; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px; font-family: inherit; transition: border-color 0.2s;
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,52,96,0.1); }
.auth-card .btn { width: 100%; padding: 14px; font-size: 16px; }
.auth-card p { text-align: center; margin-top: 16px; color: var(--text-light); font-size: 14px; }
.auth-card a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-card a:hover { text-decoration: underline; }

/* ── Onboarding ── */
.onboard-card {
  max-width: 560px; margin: 60px auto; padding: 40px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.onboard-card h2 { color: var(--text); font-size: 1.5rem; margin-bottom: 6px; }
.onboard-card > p { color: var(--text-light); margin-bottom: 28px; font-size: 15px; }
.onboard-card label { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 6px; color: var(--text); }
.onboard-card input, .onboard-card select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: var(--surface);
}
.onboard-card input:focus, .onboard-card select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,52,96,0.1); }
.onboard-step { display: none; }
.onboard-step.active { display: block; }

/* ── Dashboard Layout ── */
#dashboard.active { display: flex; min-height: 100vh; }

/* ── Sidebar — Dark like landing ── */
.sidebar {
  width: 240px; background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
  padding: 20px 0; display: flex; flex-direction: column;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h2 { font-size: 1.1rem; color: white; font-weight: 700; }
.nav-items { flex: 1; padding: 8px 0; }
.nav-item {
  display: block; padding: 11px 20px; color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 14px; font-weight: 500; border-left: 3px solid transparent; transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(255,255,255,0.08); border-left-color: var(--accent); color: white; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer a { color: rgba(255,255,255,0.35); text-decoration: none; font-size: 13px; }
.sidebar-footer a:hover { color: rgba(255,255,255,0.7); }

.main-content { flex: 1; padding: 28px; overflow-y: auto; background: var(--surface-alt); }

/* ── Dashboard Welcome Banner ── */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius); padding: 32px; margin-bottom: 24px; color: white;
}
.dashboard-welcome h2 { font-size: 1.6rem; font-weight: 700; color: white; }
.welcome-sub { color: rgba(255,255,255,0.65); font-size: 15px; margin-top: 4px; }

/* ── Stat Cards — Coloured top borders ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px; cursor: pointer;
  border: 1px solid var(--border); box-shadow: var(--shadow); transition: all 0.2s;
  border-top: 3px solid var(--primary); position: relative; overflow: hidden;
}
.stat-card:nth-child(1) { border-top-color: var(--accent); }
.stat-card:nth-child(2) { border-top-color: var(--primary); }
.stat-card:nth-child(3) { border-top-color: var(--success); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-number { font-size: 2.4rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-card:nth-child(1) .stat-number { color: var(--accent); }
.stat-card:nth-child(3) .stat-number { color: var(--success); }
.stat-label { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 8px; }
.stat-detail { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Quick Actions ── */
.quick-actions { margin-bottom: 24px; }
.quick-actions h3 { font-size: 1rem; color: var(--text); margin-bottom: 12px; }
.action-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.action-btn {
  background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 16px 24px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-light); transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.action-icon { font-size: 18px; font-weight: 700; color: var(--accent); }

/* ── Cards & Card Header ── */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.card h3 { margin-bottom: 16px; color: var(--text); font-size: 1.1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { margin-bottom: 0; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
thead th { background: var(--surface-alt); }
.table-wrap { overflow-x: auto; }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 400; }
td button { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; cursor: pointer; color: var(--text-light); font-size: 13px; }
td button:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon {
  background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.4;
  transition: opacity 0.2s; padding: 4px 8px;
}
.btn-icon:hover { opacity: 1; }

/* ── Empty States ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { color: var(--text-muted); font-size: 15px; max-width: 300px; margin: 0 auto; }

/* ── Status Badges ── */
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; text-transform: capitalize;
}

/* ── Flashcard Grid ── */
.flashcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.flashcard-item {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); transition: all 0.2s;
  border-left: 4px solid var(--primary);
}
.flashcard-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.flashcard-item:nth-child(even) { border-left-color: var(--accent); }
.flashcard-deck { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 8px; }
.flashcard-q { font-weight: 600; color: var(--text); margin-bottom: 8px; font-size: 15px; }
.flashcard-a { color: var(--text-light); font-size: 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.flashcard-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.flashcard-subject { font-size: 12px; color: var(--text-muted); }

/* ── Settings ── */
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-label strong { display: block; color: var(--text); font-size: 14px; }
.settings-label span { font-size: 13px; color: var(--text-muted); }
.settings-select {
  padding: 8px 12px; font-size: 15px; border-radius: 8px;
  border: 1px solid var(--border); font-family: inherit; background: var(--surface);
}
.settings-select:focus { outline: none; border-color: var(--primary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26,26,46,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 32px;
  width: 90%; max-width: 480px; box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--accent);
}
.modal h3 { margin-bottom: 20px; color: var(--text); }
.modal label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; color: var(--text-light); }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,52,96,0.1); }
.modal .btn { margin-top: 16px; margin-right: 8px; }
.modal .btn-secondary { color: var(--text-light); border-color: var(--border); }
.modal .btn-secondary:hover { background: var(--surface-alt); border-color: var(--text-muted); }

/* ── Responsive — Mobile First ── */
@media (max-width: 768px) {
  .landing-header h1 { font-size: 2.2rem; }
  .landing-header .tagline { font-size: 1rem; margin-bottom: 28px; }
  .cta-buttons { flex-direction: column; gap: 12px; padding: 0 20px; }
  #dashboard.active { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: none; padding: 0; }
  .nav-items { display: flex; padding: 0; }
  .nav-item { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 12px 16px; font-size: 13px; }
  .nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-header, .sidebar-footer { display: none; }
  .main-content { padding: 16px; }
  .onboard-card, .auth-card { margin: 16px; padding: 28px 20px; }
  .dashboard-welcome { padding: 24px 20px; margin-bottom: 16px; }
  .dashboard-welcome h2 { font-size: 1.3rem; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { padding: 20px; }
  .stat-number { font-size: 2rem; }
  .action-grid { flex-direction: column; }
  .action-btn { width: 100%; justify-content: center; }
  .card { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-header .btn-sm { width: 100%; text-align: center; }
  .flashcard-grid { grid-template-columns: 1fr; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .modal { padding: 24px 20px; width: 95%; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}
