/* ============================================
   EduBot Dashboard - Complete Stylesheet
   Dark theme, responsive, developer aesthetic
   ============================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-root: #08081a;
  --bg-900: #0c0c20;
  --bg-800: #12122e;
  --bg-700: #1a1a42;
  --bg-600: #242460;
  --accent: #6c5ce7;
  --accent-hover: #5b4bd4;
  --accent-glow: rgba(108, 92, 231, 0.2);
  --green: #00d68f;
  --green-dim: rgba(0, 214, 143, 0.12);
  --red: #ff4d6a;
  --red-dim: rgba(255, 77, 106, 0.12);
  --yellow: #ffc048;
  --yellow-dim: rgba(255, 192, 72, 0.12);
  --blue: #48c9f0;
  --text: #e2e8f0;
  --text-dim: #6b7394;
  --text-muted: #3d4263;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-root);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

code {
  background: var(--bg-700);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--accent);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-root); }
::-webkit-scrollbar-thumb { background: var(--bg-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,92,231,0.08) 0%, transparent 60%);
}

.login-card {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo { text-align: center; margin-bottom: 36px; }
.logo-icon { font-size: 52px; margin-bottom: 12px; filter: drop-shadow(0 4px 12px rgba(108,92,231,0.3)); }
.logo h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.logo p { color: var(--text-dim); font-size: 14px; margin-top: 6px; }
.hint { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 20px; }

/* ============================================
   FORMS
   ============================================ */

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-msg {
  background: var(--red-dim);
  border: 1px solid rgba(255, 77, 106, 0.2);
  color: var(--red);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-success { background: var(--green); color: #000; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.15); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text-dim); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }

.loader {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-800);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header h1 .icon { font-size: 22px; }

.sidebar-header .tag {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-nav a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.sidebar-nav a .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-footer a:hover { background: var(--red-dim); color: var(--red); }

/* Main content */
.main {
  flex: 1;
  margin-left: 260px;
  padding: 36px 40px;
  max-width: 1100px;
}

.page-header { margin-bottom: 32px; }
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.page-header .subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h2 { font-size: 16px; font-weight: 600; color: #fff; }

/* ============================================
   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-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

.stat-card .stat-icon { font-size: 32px; opacity: 0.7; }
.stat-card.green .stat-value { color: var(--green); }

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-900);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: background var(--transition);
}

.toggle-row:hover { background: var(--bg-700); }

.toggle-label { font-size: 14px; color: var(--text); }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-600);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  outline: none;
  flex-shrink: 0;
}

.toggle.active { background: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle.active::after { transform: translateX(20px); }

/* ============================================
   LIST ITEMS
   ============================================ */

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-900);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: background var(--transition);
}

.list-item:hover { background: var(--bg-700); }

.list-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-emoji { font-size: 20px; flex-shrink: 0; }

.list-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.list-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   FORMS (INLINE)
   ============================================ */

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }

/* ============================================
   TABS
   ============================================ */

.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--bg-800);
  color: var(--text-dim);
  transition: all var(--transition);
}

.tab-btn:hover { color: #fff; background: var(--bg-700); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  max-width: 360px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }

/* ============================================
   MOBILE
   ============================================ */

.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.menu-toggle:hover { background: var(--accent-hover); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

.overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 24px 16px; padding-top: 70px; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { flex-direction: column; }
  .inline-form .form-group { min-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; border-radius: 20px; }
  .page-header h1 { font-size: 22px; }
}
