@import url('https://fonts.googleapis.com/css2?family=Söhne:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #000000;
  --bg-secondary: #0d0d0d;
  --bg-tertiary: #1a1a1a;
  --bg-hover: #2a2a2a;
  --bg-card: #111111;
  --border: #2a2a2a;
  --border-light: #333333;
  --text-primary: #ffffff;
  --text-secondary: #8e8ea0;
  --text-muted: #565869;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.1);
  --green: #10a37f;
  --red: #ef4444;
  --blue: #3b82f6;
  --yellow: #f59e0b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100%;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ─── UTILITY ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-secondary); }
.bold { font-weight: 600; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}
.btn-primary:hover { background: #e5e5e5; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-green {
  background: var(--green);
  color: white;
}
.btn-green:hover { background: #0d8a6a; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-full { width: 100%; }

/* ─── INPUTS ─── */
.input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}
.input:focus { border-color: var(--border-light); }
.input::placeholder { color: var(--text-muted); }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-free { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.badge-student { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-teacher { background: rgba(16,163,127,0.2); color: #34d399; }
.badge-business { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-admin { background: rgba(239,68,68,0.2); color: #f87171; }
.badge-paid { background: rgba(16,163,127,0.2); color: #34d399; }
.badge-unpaid { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* ─── DIVIDER ─── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px; margin: 16px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* ─── TOAST ─── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 320px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── SPINNER ─── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TABS ─── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.tab.active { color: var(--text-primary); border-bottom-color: white; }
.tab:hover:not(.active) { color: var(--text-primary); }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 900; font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar-logo .logo-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav-item.active { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.user-info:hover { background: var(--bg-hover); }
.avatar {
  width: 34px; height: 34px;
  background: var(--bg-hover);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ─── MAIN LAYOUT ─── */
.app-layout {
  display: flex;
  height: 100vh;
}
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ─── CHAT ─── */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.chat-message {
  display: flex; gap: 14px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.chat-message.user { flex-direction: row-reverse; }
.message-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
  max-width: 85%;
}
.chat-message.user .message-bubble {
  background: var(--bg-hover);
}
.chat-input-area {
  padding: 16px 32px 24px;
  background: var(--bg-primary);
}
.chat-input-wrapper {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  transition: border-color 0.15s;
}
.chat-input-wrapper:focus-within { border-color: var(--border-light); }
.chat-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 200px;
  font-family: inherit;
  line-height: 1.6;
}
.chat-input-wrapper textarea::placeholder { color: var(--text-muted); }
.send-btn {
  width: 32px; height: 32px;
  background: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.send-btn:hover { background: #e5e5e5; }
.send-btn:disabled { background: var(--bg-hover); cursor: not-allowed; }
.send-btn svg { color: black; }

/* ─── HEADER ─── */
.page-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
}
.page-title { font-size: 16px; font-weight: 600; }

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-secondary); }

/* ─── PROGRESS BAR ─── */
.progress-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
  transition: width 0.3s;
}

/* ─── IMAGE GEN ─── */
.img-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.img-gen-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.img-gen-card img { width: 100%; height: 100%; object-fit: cover; }

/* ─── AUTH PAGE ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 42%), linear-gradient(180deg, #05070d 0%, #070a11 100%);
  padding: 40px 20px;
}
.auth-box {
  width: 100%;
  max-width: 460px;
  background: rgba(10, 14, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  padding: 42px 36px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 34px;
}
.auth-logo .logo-big {
  width: 64px; height: 64px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.auth-logo .logo-big svg {
  width: 28px;
  height: 28px;
  stroke: white;
}
.auth-logo h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.auth-logo p {
  color: #a7b5d1;
  font-size: 14px;
  line-height: 1.7;
  margin-top: 6px;
}
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .input-group label {
  color: #c8d2ec;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
}
.auth-switch {
  text-align: center;
  color: #9ba6c8;
  font-size: 13px;
  margin-top: 24px;
}
.auth-switch a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.role-option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.role-option:hover { border-color: var(--border-light); background: var(--bg-hover); }
.role-option.selected { border-color: white; background: rgba(255,255,255,0.05); }
.role-option .role-icon { font-size: 20px; margin-bottom: 4px; }
.role-option .role-label { font-size: 12px; font-weight: 500; }

/* ─── REFERRAL ─── */
.referral-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.referral-code {
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 600;
  flex: 1;
}

/* ─── CLASSROOM ─── */
.classroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.classroom-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.classroom-card:hover { border-color: var(--border-light); }
.classroom-card-header { margin-bottom: 12px; }
.classroom-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.classroom-card-sub { font-size: 12px; color: var(--text-secondary); }

/* ─── LANDING ─── */
.landing-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}
.landing-nav {
  padding: 20px 48px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.landing-hero {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 24px;
}
.hero-eyebrow {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-secondary);
}
.hero-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pricing-card:hover { border-color: var(--border-light); }
.pricing-card.featured { border-color: white; }
.pricing-badge {
  position: absolute; top: -10px; right: 16px;
  background: white; color: black;
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 1px;
}
.pricing-name { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 12px; }
.pricing-price { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.pricing-period { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.pricing-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.pricing-feature { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pricing-feature .check { color: var(--green); flex-shrink: 0; }

/* ─── AI CHAT DOTS ─── */
.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ─── TIMER ─── */
.timer-display {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.timer-display.warning { color: var(--yellow); border-color: rgba(245,158,11,0.3); }
.timer-display.danger { color: var(--red); border-color: rgba(239,68,68,0.3); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .landing-nav { padding: 16px 20px; }
  .pricing-grid { padding: 24px 16px; }
}
