/**
 * TypeSetu Design System
 * Modern SaaS EdTech Aesthetic
 */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-hindi: 'Noto Sans Devanagari', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Light */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --success-color: #10b981;
  --success-subtle: #ecfdf5;
  --warning-color: #f59e0b;
  --warning-subtle: #fffbeb;
  --danger-color: #ef4444;
  --danger-subtle: #fef2f2;
  --info-color: #06b6d4;
  --info-subtle: #ecfeff;

  --sidebar-width: 260px;
  --navbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-subtle: #1e293b;
  --border-color: #273549;
  --border-subtle: #1e293b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary-color: #6366f1;
  --primary-hover: #818cf8;
  --primary-subtle: #1e1e38;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --success-color: #10b981;
  --success-subtle: #064e3b;
  --warning-color: #f59e0b;
  --warning-subtle: #451a03;
  --danger-color: #f43f5e;
  --danger-subtle: #4c0519;
  --info-color: #38bdf8;
  --info-subtle: #082f49;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.font-hindi {
  font-family: var(--font-hindi);
}

.fs-7 { font-size: 0.85rem !important; }
.fs-8 { font-size: 0.75rem !important; }
.fs-9 { font-size: 0.68rem !important; }

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease-in-out;
}

.app-main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  transition: margin-left 0.25s ease-in-out;
}

.top-navbar {
  height: var(--navbar-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.page-body {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar Styles */
.brand-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.brand-title {
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.sidebar-content {
  overflow-y: auto;
  flex: 1;
  padding: 0 0.75rem;
}

.sidebar-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem;
  text-transform: uppercase;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease-in-out;
  margin-bottom: 2px;
}

.app-sidebar .nav-link i {
  font-size: 1.1rem;
  color: var(--text-dim);
  transition: color 0.15s;
}

.app-sidebar .nav-link:hover {
  color: var(--primary-color);
  background-color: var(--primary-subtle);
}

.app-sidebar .nav-link:hover i {
  color: var(--primary-color);
}

.app-sidebar .nav-link.active {
  color: var(--primary-color);
  background-color: var(--primary-subtle);
  font-weight: 600;
}

.app-sidebar .nav-link.active i {
  color: var(--primary-color);
}

/* Header Elements */
.stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  transition: all 0.2s;
}

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

.streak-pill {
  background-color: var(--warning-subtle);
  border-color: rgba(245, 158, 11, 0.3);
  color: #b45309;
}

[data-bs-theme="dark"] .streak-pill {
  color: #fbbf24;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text-main);
  background-color: var(--border-color);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Modern Card Styling */
.card-modern {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.card-stat {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.card-stat .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}

/* Progress Bars */
.progress-bar-animated {
  transition: width 0.6s ease-in-out;
}

.badge-soft-primary { background-color: var(--primary-subtle); color: var(--primary-color); }
.badge-soft-success { background-color: var(--success-subtle); color: var(--success-color); }
.badge-soft-warning { background-color: var(--warning-subtle); color: var(--warning-color); }
.badge-soft-danger  { background-color: var(--danger-subtle);  color: var(--danger-color); }
.badge-soft-info    { background-color: var(--info-subtle);    color: var(--info-color); }

/* Landing Page Styles */
.hero-gradient {
  background: radial-gradient(circle at 50% 0%, var(--primary-glow) 0%, transparent 60%);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .app-main-content {
    margin-left: 0;
  }
  .page-body {
    padding: 1rem;
  }
}
