/* ============================================
   BLOOTI LMS — Design System
   Primary: Black & White | Accent: #ff66c4
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=DM+Sans:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --primary:        #0a0a0a;
  --primary-soft:   #1a1a1a;
  --surface:        #ffffff;
  --surface-2:      #f8f8f8;
  --surface-3:      #f0f0f0;
  --border:         #e8e8e8;
  --border-dark:    #d0d0d0;
  --text-primary:   #0a0a0a;
  --text-secondary: #6b6b6b;
  --text-muted:     #a0a0a0;
  --accent:         #ff66c4;
  --accent-soft:    #fff0f9;
  --accent-hover:   #e850b0;
  --accent-muted:   rgba(255,102,196,0.12);
  --success:        #25d366;
  --success-soft:   #f0fdf4;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --danger-soft:    #fef2f2;
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 12px rgba(0,0,0,0.08);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.10);
  --transition:     0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

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

/* ── Layout: Sidebar + Main ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .brand-logo {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand .brand-name {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-brand .brand-role {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 24px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-left-color: rgba(255,255,255,0.2);
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-muted);
  border-left-color: var(--accent);
}
.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
  flex-shrink: 0;
}
.sidebar-link.active i { opacity: 1; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 28px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}
.card-body { padding: 20px 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card .stat-value {
  font-family: 'Geist', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ── Buttons ── */
.btn {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-muted); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-soft); color: #fff; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-dark);
}
.btn-outline:hover { background: var(--surface-3); color: var(--text-primary); }

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

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger-outline:hover { background: var(--danger-soft); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 4px; }

/* ── Forms ── */
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}
.form-label .required { color: var(--accent); margin-left: 2px; }

.form-control, .form-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: 'Geist', sans-serif;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid { border-color: var(--danger); }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 4px; display: block; }

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

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table thead th {
  background: var(--surface-2);
  padding: 12px 16px;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-success  { background: var(--success-soft); color: #15803d; }
.badge-warning  { background: #fffbeb; color: #b45309; }
.badge-danger   { background: var(--danger-soft); color: #dc2626; }
.badge-accent   { background: var(--accent-soft); color: var(--accent-hover); }
.badge-neutral  { background: var(--surface-3); color: var(--text-secondary); }

/* ── Progress Bar ── */
.progress-wrap { background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.progress-bar-fill {
  height: 6px;
  background: var(--accent);
  border-radius: 20px;
  transition: width 0.4s ease;
}
.progress-bar-fill.complete { background: var(--success); }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-soft); border-color: #fca5a5; color: #b91c1c; }
.alert-success { background: var(--success-soft); border-color: #86efac; color: #15803d; }
.alert-info    { background: var(--accent-soft); border-color: #f9a8d4; color: var(--accent-hover); }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  list-style: none;
  padding: 0;
}
.breadcrumb li + li::before { content: '/'; color: var(--border-dark); margin-right: 6px; }
.breadcrumb li.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ── Mobile Sidebar Toggle ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Drag Handle ── */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--transition);
}
.drag-handle:hover { color: var(--text-secondary); }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; background: var(--accent-soft) !important; }
.sortable-chosen { box-shadow: var(--shadow-md); }

/* ── Course Cards (Member) ── */
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.course-card .course-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 32px;
}
.course-card .course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-card .course-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.course-card .course-title {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.course-card .course-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
}
.course-card .progress-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

/* ── News Card ── */
.news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-item .news-date {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.news-item .news-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.news-item .news-body { font-size: 13px; color: var(--text-secondary); }

/* ── Chapter/Lesson Accordion ── */
.chapter-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.chapter-header {
  padding: 14px 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.chapter-header:hover { background: var(--surface-2); }
.chapter-header .chapter-title {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  flex: 1;
}
.chapter-header .chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
  font-size: 12px;
}
.chapter-header.open .chevron { transform: rotate(180deg); }
.chapter-body { background: var(--surface-2); display: none; }
.chapter-body.open { display: block; }

.lesson-item {
  padding: 11px 16px 11px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.lesson-item:hover { background: var(--surface); color: var(--text-primary); }
.lesson-item.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.lesson-item .lesson-check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
}
.lesson-item .lesson-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ── Utilities ── */
.text-accent    { color: var(--accent); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }
.font-heading   { font-family: 'Geist', sans-serif; }
.gap-2          { gap: 8px; }
.gap-3          { gap: 12px; }
.divider        { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
}


/* Modal styles moved to Bootstrap */


/* Pagination styling */
.pagination .page-item.active .page-link {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}
.pagination .page-link {
    color: #333;
}
.pagination .page-link:hover {
    color: #25d366;
}
.pagination + div,
.pagination ~ div {
    display: none;
}
p.text-sm.text-gray-700.leading-5 {
    display: none;
}

nav[role="navigation"] .justify-content-sm-between > div:first-child {
    margin-right: 3rem !important;
}
