/* ========================================
   EdPrep - Main Stylesheet
   ======================================== */

/* ---- Google Font Import ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES (Design Tokens)
   ======================================== */
:root {
  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #DBEAFE;
  --secondary: #8B5CF6;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --dark: #0F172A;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --bg-main: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-sidebar: #F8FAFC;
  --bg-hover: #F1F5F9;
  --white: #FFFFFF;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 60px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1 { font-size: 32px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 18px; font-weight: 600; line-height: 1.4; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

/* ========================================
   GRID
   ======================================== */
.grid {
  display: grid;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #7C3AED;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-hover);
}

.btn-outline-white {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16A34A;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 20px;
}

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

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.show {
  display: block;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: #DCFCE7;
  color: var(--success);
}

.badge-warning {
  background: #FEF3C7;
  color: #B45309;
}

.badge-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.badge-purple {
  background: #EDE9FE;
  color: var(--secondary);
}

.badge-dark {
  background: var(--dark);
  color: white;
}

/* ========================================
   TABLES
   ======================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 14px;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--bg-sidebar);
}

/* ========================================
   SIDEBAR (Dashboard)
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--dark);
  color: #CBD5E1;
  z-index: 50;
  transition: width 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-logo {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: var(--topbar-height);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  width: 0;
}

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

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #94A3B8;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-nav li a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.sidebar-nav li a.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.sidebar-nav li a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-nav li a .nav-text {
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  display: none;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ========================================
   TOPBAR (Dashboard)
   ======================================== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
  transition: left 0.3s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: none;
  background: none;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 8px 14px;
  width: 280px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: none;
  background: none;
  position: relative;
}

.topbar-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.user-dropdown:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left 0.3s ease;
}

/* ========================================
   AI CHAT PANEL
   ======================================== */
.ai-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.3s ease;
}

.ai-panel.collapsed {
  transform: translateX(100%);
}

.ai-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.ai-title i {
  color: var(--secondary);
}

.ai-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  border: none;
  background: none;
  font-size: 14px;
}

.ai-close:hover {
  background: var(--bg-hover);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeInUp 0.3s ease;
}

.ai-message.bot {
  align-self: flex-start;
  background: var(--bg-main);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-message.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message.bot .ai-avatar {
  width: 24px;
  height: 24px;
  background: var(--secondary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  margin-right: 6px;
  vertical-align: middle;
}

.ai-welcome {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-secondary);
}

.ai-welcome i {
  font-size: 40px;
  color: var(--secondary);
  margin-bottom: 12px;
  display: block;
}

.ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.ai-quick-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-quick-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

.ai-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ai-input-area input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.ai-input-area input:focus {
  border-color: var(--primary);
}

.ai-input-area button {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ai-input-area button:hover {
  background: var(--primary-dark);
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.ai-typing span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

/* ========================================
   AI FLOATING BUTTON
   ======================================== */
.ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.ai-fab:hover {
  background: #7C3AED;
  transform: scale(1.05);
}

.ai-fab.hidden {
  display: none;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  border: none;
  background: none;
  font-size: 16px;
}

.modal-close:hover {
  background: var(--bg-hover);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========================================
   TABS
   ======================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  padding: 20px 0;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.success {
  background: #DCFCE7;
  color: #166534;
}

.toast.error {
  background: #FEE2E2;
  color: #991B1B;
}

.toast.warning {
  background: #FEF3C7;
  color: #92400E;
}

.toast.info {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
}

.toast-close:hover {
  opacity: 1;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination .current {
  background: var(--primary);
  color: white;
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================
   STATS CARDS
   ======================================== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #DCFCE7; color: var(--success); }
.stat-icon.purple { background: #EDE9FE; color: var(--secondary); }
.stat-icon.orange { background: #FEF3C7; color: var(--warning); }
.stat-icon.red { background: #FEE2E2; color: var(--danger); }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-main);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* ========================================
   SUBJECT CARDS
   ======================================== */
.subject-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.subject-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.subject-card-header {
  height: 6px;
}

.subject-card-body {
  padding: 20px;
}

.subject-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.subject-card h4 {
  margin-bottom: 4px;
}

.subject-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.subject-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================
   QUESTION CARD
   ======================================== */
.question-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: var(--shadow-md);
}

.question-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.question-number {
  width: 28px;
  height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.question-text {
  flex: 1;
  margin: 0 16px;
  font-size: 14px;
}

.question-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.question-actions {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid #F1F5F9;
  background: var(--bg-sidebar);
}

.question-answer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  display: none;
}

.question-answer.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.answer-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 6px;
}

.explanation-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 12px;
  margin-bottom: 6px;
}

/* ========================================
   PRICING CARDS
   ======================================== */
.pricing-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}

.pricing-card:hover {
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.pricing-card.popular:hover {
  box-shadow: var(--shadow-xl);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0;
}

.pricing-card .price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-features {
  text-align: left;
  margin: 20px 0;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.pricing-features li i {
  color: var(--success);
  font-size: 14px;
}

.pricing-features li.not-included {
  opacity: 0.5;
}

.pricing-features li.not-included i {
  color: var(--text-muted);
}

/* ========================================
   ACCORDION (FAQ)
   ======================================== */
.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.accordion-header:hover {
  color: var(--primary);
}

.accordion-header i {
  transition: transform 0.3s ease;
  color: var(--text-muted);
  font-size: 14px;
}

.accordion-item.active .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-body {
  max-height: 300px;
  padding-bottom: 16px;
}

.accordion-body p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

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

.testimonial-card .quote {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-style: italic;
}

.testimonial-card .author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-card .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
}

.testimonial-card .author-name {
  font-weight: 600;
  font-size: 14px;
}

.testimonial-card .author-class {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================
   PRACTICE TEST INTERFACE
   ======================================== */
.test-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-main);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.test-timer.warning {
  background: #FEF3C7;
  color: #B45309;
  animation: pulse 1s infinite;
}

.test-timer.critical {
  background: #FEE2E2;
  color: var(--danger);
  animation: pulse 0.5s infinite;
}

.question-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.q-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.q-nav-btn:hover {
  border-color: var(--primary);
}

.q-nav-btn.current {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.q-nav-btn.answered {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.q-nav-btn.marked {
  border-color: var(--warning);
  background: #FEF3C7;
}

.mcq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.mcq-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mcq-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mcq-option .option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.mcq-option.selected .option-letter {
  background: var(--primary);
  color: white;
}

/* ========================================
   SECTIONS - LANDING PAGE
   ======================================== */
.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  margin-bottom: 8px;
}

.section-title p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1E293B 100%);
  color: white;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 16px;
  color: white;
}

.hero p {
  font-size: 16px;
  color: #CBD5E1;
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #94A3B8;
}

.hero-stars {
  color: #FBBF24;
}

.hero-visual {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.hero-preview-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.hero-preview-card h4 {
  color: white;
  font-size: 14px;
  margin-bottom: 8px;
}

.hero-preview-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.hero-preview-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* ---- Steps ---- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}

.step-card {
  text-align: center;
  padding: 32px 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.step-card h4 {
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---- Footer ---- */
.footer {
  background: var(--dark);
  color: #CBD5E1;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
}

.footer-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.footer-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  color: #94A3B8;
}

.footer-column h5 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #94A3B8;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-column ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 32px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: 13px;
  color: #64748B;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 13px;
  transition: all 0.2s;
}

.footer-social a:hover {
  background: var(--primary);
  color: white;
}

/* ========================================
   PUBLIC HEADER
   ======================================== */
.public-header {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  transition: box-shadow 0.2s;
}

.public-header.scrolled {
  box-shadow: var(--shadow);
}

.public-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.header-logo .logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================================
   AUTH PAGES (LOGIN/SIGNUP)
   ======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-visual {
  flex: 1;
  background: linear-gradient(135deg, var(--dark) 0%, #1E293B 50%, #312E81 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
}

.auth-visual h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.auth-visual p {
  color: #CBD5E1;
  font-size: 14px;
  line-height: 1.6;
}

.auth-form-container {
  width: 480px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  overflow-y: auto;
}

.auth-form-container .header-logo {
  margin-bottom: 32px;
}

.auth-form-container h2 {
  margin-bottom: 8px;
}

.auth-form-container .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-alt {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-alt a {
  font-weight: 500;
}

/* ========================================
   TRAIL BANNER
   ======================================== */
.trial-banner {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.trial-banner.expiring {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  border-color: #FCA5A5;
}

.trial-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #92400E;
}

.trial-banner.expiring .trial-banner-text {
  color: #991B1B;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}

.empty-state h4 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ========================================
   SPINNER / LOADING
   ======================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.spinner-dark {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   RESPONSIVE HELPERS
   ======================================== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar {
    left: 0;
  }
  .main-content {
    margin-left: 0;
  }
  .ai-panel {
    width: 100%;
    z-index: 60;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .auth-page {
    flex-direction: column;
  }
  .auth-visual {
    display: none;
  }
  .auth-form-container {
    width: 100%;
    padding: 32px 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .search-bar {
    display: none;
  }
  .pricing-card.popular {
    transform: none;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 28px;
  }
  .container {
    padding: 0 16px;
  }
}
