/**
 * CAMPUS FORMULA – Custom CSS
 * ============================
 * Brand: Primary #fabf2c | Dark #212529
 * Tenant can override --cf-accent via PHP-injected <style> in header.php
 *
 * Structure:
 *   1. CSS Variables & Reset
 *   2. Typography
 *   3. Layout (wrapper, sidebar, main)
 *   4. Navbar
 *   5. Sidebar
 *   6. Cards & UI Components
 *   7. Skeleton Loaders
 *   8. Practice Module
 *   9. Mock Exam Module
 *  10. Daily Dose
 *  11. Leaderboard
 *  12. Results
 *  13. Notifications
 *  14. Badges & Pills
 *  15. Utilities
 *  16. Responsive
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS Variables & Reset
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --cf-accent: #fabf2c;
  --cf-accent-rgb: 250, 191, 44;
  --cf-dark: #212529;
  --cf-dark-2: #2c3136;
  --cf-dark-3: #343a40;
  --cf-sidebar-w: 260px;
  --cf-navbar-h: 62px;
  --cf-radius: 12px;
  --cf-radius-lg: 18px;
  --cf-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --cf-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.12);
  --cf-transition: 0.2s ease;
  --cf-font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--cf-font);
  background: #f4f5f7;
  color: var(--cf-dark);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Prevent layout shift when SweetAlert opens */
body.swal2-shown {
  padding-right: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. Typography
   ═══════════════════════════════════════════════════════════════════════════ */
.fw-600 {
  font-weight: 600 !important;
}
.fw-700 {
  font-weight: 700 !important;
}
.fw-800 {
  font-weight: 800 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
}

.cf-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cf-dark);
  margin: 0;
}

.cf-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cf-dark);
  margin-bottom: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. Layout
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cf-layout {
  display: flex;
  flex: 1;
  padding-top: var(--cf-navbar-h);
}

.cf-main-content {
  flex: 1;
  margin-left: var(--cf-sidebar-w);
  padding: 1.5rem;
  min-height: calc(100vh - var(--cf-navbar-h));
  transition: margin-left var(--cf-transition);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. Navbar
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-navbar {
  background: var(--cf-dark);
  height: var(--cf-navbar-h);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  border-bottom: 3px solid var(--cf-accent);
  padding: 0 1rem;
}

.cf-brand-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  letter-spacing: -0.5px;
}

.cf-logo {
  border-radius: 6px;
  object-fit: contain;
}

.cf-icon-btn {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.4rem;
  position: relative;
  line-height: 1;
}
.cf-icon-btn:hover {
  color: var(--cf-accent);
}

.cf-notif-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  border: 2px solid var(--cf-dark);
}

.cf-xp-badge,
.cf-streak-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(var(--cf-accent-rgb), 0.25);
}
.cf-streak-badge {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
}

/* Avatar */
.cf-avatar-btn {
  padding: 0;
  border: none;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}
.cf-avatar-btn::after {
  display: none;
} /* Remove dropdown arrow */
.cf-avatar-btn:hover {
  color: var(--cf-accent);
}

.cf-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--cf-accent-rgb), 0.4);
}
.cf-avatar-initials {
  background: var(--cf-accent);
  color: var(--cf-dark);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown */
.cf-dropdown {
  border: none;
  border-radius: var(--cf-radius);
  box-shadow: var(--cf-shadow-md);
  min-width: 220px;
}
.cf-dropdown .dropdown-item {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.cf-dropdown .dropdown-item:hover {
  background: rgba(var(--cf-accent-rgb), 0.1);
}

/* Sidebar toggle (mobile) */
.cf-sidebar-toggle {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.3rem;
}
.cf-sidebar-toggle:hover {
  color: var(--cf-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. Sidebar
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-sidebar {
  width: var(--cf-sidebar-w);
  background: var(--cf-dark);
  position: fixed;
  top: var(--cf-navbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform var(--cf-transition);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--cf-accent-rgb), 0.2) transparent;
}

.cf-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem 1rem;
}

.cf-sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--cf-accent-rgb), 0.4);
  flex-shrink: 0;
}

.cf-sidebar-user-info {
  flex: 1;
  overflow: hidden;
  color: #fff;
}

.cf-plan-badge {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

.cf-xp-strip {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

.cf-sidebar-divider {
  border-color: rgba(255, 255, 255, 0.08);
  margin: 0 1rem;
}

.cf-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.cf-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all var(--cf-transition);
  position: relative;
  margin: 1px 0.5rem;
  border-radius: var(--cf-radius);
}

.cf-sidebar-link:hover {
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.08);
}

.cf-sidebar-link.active {
  color: var(--cf-dark);
  background: var(--cf-accent);
  font-weight: 700;
  border-left-color: transparent;
}

.cf-sidebar-link.active .cf-sidebar-icon {
  color: var(--cf-dark);
}
.cf-sidebar-link.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.cf-sidebar-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.cf-nav-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: auto;
}

.cf-sidebar-footer {
  padding: 0.75rem 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Overlay for mobile */
.cf-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1029;
}
.cf-sidebar-overlay.show {
  display: block;
}

/* Offcanvas (notifications) */
.cf-offcanvas {
  width: 350px !important;
  border-left: 3px solid var(--cf-accent);
}
.cf-notif-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  transition: background var(--cf-transition);
}
.cf-notif-item.unread {
  background: rgba(var(--cf-accent-rgb), 0.08);
  border-color: rgba(var(--cf-accent-rgb), 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. Cards & UI Components
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-card {
  background: #fff;
  border: none;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
  overflow: hidden;
}

.cf-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Primary Button */
.btn-cf-primary {
  background: var(--cf-accent);
  color: var(--cf-dark);
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  transition: all var(--cf-transition);
}
.btn-cf-primary:hover {
  background: color-mix(in srgb, var(--cf-accent) 85%, #000);
  color: var(--cf-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(var(--cf-accent-rgb), 0.4);
}
.btn-cf-primary:active {
  transform: none;
}

/* Outline Button */
.btn-cf-outline {
  background: transparent;
  color: var(--cf-accent);
  border: 2px solid var(--cf-accent);
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 1.2rem;
  transition: all var(--cf-transition);
}
.btn-cf-outline:hover {
  background: var(--cf-accent);
  color: var(--cf-dark);
}

/* Form controls */
.cf-select,
.cf-input {
  border: 1.5px solid #dee2e6;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-family: var(--cf-font);
  font-size: 0.875rem;
  transition: border-color var(--cf-transition);
  width: 100%;
  background: #fff;
}
.cf-select:focus,
.cf-input:focus {
  outline: none;
  border-color: var(--cf-accent);
  box-shadow: 0 0 0 3px rgba(var(--cf-accent-rgb), 0.15);
}

/* Badge */
.cf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}
.cf-badge-accent {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: color-mix(in srgb, var(--cf-accent) 70%, #000);
}
.cf-badge-green {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}
.cf-badge-red {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.cf-badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. Skeleton Loaders
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes cfShimmer {
  0% {
    background-position: -600px 0;
  }
  100% {
    background-position: 600px 0;
  }
}

.cf-skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 600px 100%;
  animation: cfShimmer 1.4s infinite linear;
  border-radius: 8px;
}

/* Preset sizes */
.cf-skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}
.cf-skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 12px;
}
.cf-skeleton-btn {
  height: 38px;
  width: 120px;
  border-radius: 10px;
}
.cf-skeleton-card {
  height: 140px;
  border-radius: var(--cf-radius-lg);
}
.cf-skeleton-notif {
  height: 72px;
  border-radius: var(--cf-radius);
}
.cf-skeleton-option {
  height: 52px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.cf-skeleton-q {
  height: 100px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* Question skeleton block */
.cf-skeleton-question-block {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. Dashboard
   ═══════════════════════════════════════════════════════════════════════════ */

/* Welcome Banner */
.cf-welcome-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.cf-welcome-greeting {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cf-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* XP Level Card */
.cf-xp-level-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1rem 1.25rem;
  min-width: 260px;
  box-shadow: var(--cf-shadow);
  flex-shrink: 0;
}
.cf-level-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.cf-xp-bar-bg {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.cf-xp-bar-fill {
  height: 100%;
  background: var(--cf-accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Stat Cards */
.cf-stat-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--cf-shadow);
  height: 100%;
}
.cf-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.cf-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cf-dark);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.cf-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cf-dark);
}
.cf-stat-sub {
  font-size: 0.72rem;
  color: #9ca3af;
}

/* Quick Actions */
.cf-quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cf-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--cf-radius-lg);
  padding: 1rem 0.75rem;
  min-width: 90px;
  flex: 1;
  text-decoration: none;
  color: var(--cf-dark);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all var(--cf-transition);
  position: relative;
}
.cf-quick-btn i {
  font-size: 1.4rem;
  color: var(--cf-accent);
}
.cf-quick-btn:hover {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.05);
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow);
  color: var(--cf-dark);
}
.cf-quick-btn-dose i {
  color: #f97316;
}
.cf-quick-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  background: #ef4444;
  color: #fff;
}
.cf-quick-badge-done {
  background: #22c55e !important;
}
.cf-quick-badge:empty {
  display: none;
}

/* Result rows (reused in dashboard + results page) */
.cf-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Daily Dose CTA Card */
.cf-dose-cta-card {
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
}
.cf-dose-pending {
  background: linear-gradient(135deg, var(--cf-dark) 0%, #2c3136 100%);
  color: #fff;
}
.cf-dose-done {
  background: linear-gradient(135deg, #166534 0%, #14532d 100%);
  color: #fff;
}

/* Link button */
.cf-btn-link {
  color: var(--cf-accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.cf-btn-link:hover {
  background: rgba(var(--cf-accent-rgb), 0.1);
  color: var(--cf-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. Practice Module
   ═══════════════════════════════════════════════════════════════════════════ */

/* Filter bar */
.cf-filter-bar {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.cf-filter-bar label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
  display: block;
}
.cf-filter-group {
  flex: 1;
  min-width: 160px;
}

/* Question card */
.cf-question-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--cf-shadow);
  margin-bottom: 1.25rem;
  border-left: 4px solid transparent;
  transition:
    border-color var(--cf-transition),
    box-shadow var(--cf-transition);
}
.cf-question-card.answered-correct {
  border-left-color: #22c55e;
}
.cf-question-card.answered-wrong {
  border-left-color: #ef4444;
}
.cf-question-card.answered-skip {
  border-left-color: #94a3b8;
}

.cf-q-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.cf-q-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cf-dark);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.cf-q-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: contain;
}

/* Options */
.cf-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  user-select: none;
}
.cf-option:hover {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.04);
}
.cf-option.selected {
  border-color: var(--cf-accent);
  background: rgba(var(--cf-accent-rgb), 0.1);
}
.cf-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.cf-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.cf-option.disabled {
  pointer-events: none;
}

.cf-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--cf-transition);
}
.cf-option.selected .cf-option-letter {
  background: var(--cf-accent);
  color: var(--cf-dark);
}
.cf-option.correct .cf-option-letter {
  background: #22c55e;
  color: #fff;
}
.cf-option.wrong .cf-option-letter {
  background: #ef4444;
  color: #fff;
}

.cf-option-text {
  font-size: 0.875rem;
  flex: 1;
  color: var(--cf-dark);
}

/* Explanation box */
.cf-explanation {
  background: rgba(var(--cf-accent-rgb), 0.06);
  border: 1px solid rgba(var(--cf-accent-rgb), 0.2);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  display: none; /* shown via JS */
}
.cf-explanation.show {
  display: block;
}
.cf-explanation strong {
  color: var(--cf-dark);
}

/* Progress bar (practice session) */
.cf-practice-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.cf-practice-progress-fill {
  height: 100%;
  background: var(--cf-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Score summary card */
.cf-score-card {
  background: var(--cf-dark);
  color: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cf-score-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(var(--cf-accent-rgb), 0.15);
  border-radius: 50%;
}
.cf-score-big {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--cf-accent);
  line-height: 1;
}

/* Pagination nav */
.cf-pagination {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cf-page-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid #dee2e6;
  background: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--cf-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cf-page-btn:hover,
.cf-page-btn.active {
  background: var(--cf-accent);
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. Mock Exam Module
   ═══════════════════════════════════════════════════════════════════════════ */
/* Mock listing cards */
.cf-mock-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    transform var(--cf-transition),
    box-shadow var(--cf-transition);
}
.cf-mock-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cf-shadow-md);
}
.cf-mock-card-header {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
}
.cf-mock-card-body {
  padding: 0.75rem 1.1rem;
  flex: 1;
}
.cf-mock-card-footer {
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid #f0f0f0;
}
.cf-mock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}
.cf-mock-meta span {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.cf-timer-bar {
  background: var(--cf-dark);
  color: var(--cf-accent);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.5rem 1.25rem;
  border-radius: var(--cf-radius);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.cf-timer-bar.danger {
  color: #ef4444;
  animation: pulse 0.8s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.cf-subject-tab-nav {
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cf-subject-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid #dee2e6;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  transition: all var(--cf-transition);
}
.cf-subject-tab.active {
  background: var(--cf-accent);
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. Daily Dose
   ═══════════════════════════════════════════════════════════════════════════ */

/* Network offline banner */
.cf-network-banner {
  background: #1e3a5f;
  color: #93c5fd;
  border-radius: var(--cf-radius);
  padding: 0.65rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  border-left: 4px solid #3b82f6;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Completion banner */
.cf-dose-complete-banner {
  background: linear-gradient(135deg, var(--cf-dark) 0%, #1a2035 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cf-dose-complete-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(var(--cf-accent-rgb), 0.08);
  border-radius: 50%;
}

/* Session header */
.cf-dose-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* XP chip that floats in on correct answer */
.cf-dose-xp-chip {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: color-mix(in srgb, var(--cf-accent) 70%, #000);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(var(--cf-accent-rgb), 0.3);
}
.cf-dose-xp-chip-show {
  animation: xpPop 0.4s ease;
}
@keyframes xpPop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* XP badge pulse */
.cf-xp-pulse {
  animation: xpPulse 0.5s ease;
}
@keyframes xpPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(var(--cf-accent-rgb), 0.5);
  }
}

/* Sync status indicator (fixed bottom right) */
.cf-sync-indicator {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--cf-shadow);
  z-index: 500;
  transition: opacity 0.3s;
}

/* Spinning icon for sync */
.cf-spin {
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.cf-dose-header {
  background: linear-gradient(135deg, var(--cf-dark) 60%, var(--cf-dark-2));
  color: #fff;
  border-radius: var(--cf-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.cf-dose-header::after {
  content: "⚡";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  opacity: 0.08;
}

.cf-dose-xp {
  background: rgba(var(--cf-accent-rgb), 0.15);
  color: var(--cf-accent);
  border-radius: var(--cf-radius);
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. Leaderboard
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab nav */
.cf-lb-tabs {
  border-bottom: 2px solid #e5e7eb;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.cf-lb-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all var(--cf-transition);
  border-radius: 0;
}
.cf-lb-tab:hover {
  color: var(--cf-accent);
}
.cf-lb-tab.active {
  color: var(--cf-dark);
  border-bottom-color: var(--cf-accent);
}

/* My rank cards */
.cf-my-rank-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: var(--cf-radius);
  padding: 0.5rem 1rem;
  box-shadow: var(--cf-shadow);
  margin-left: 0.5rem;
}
.cf-my-rank-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--cf-accent);
  line-height: 1;
}

/* ── PODIUM ── */
.cf-podium-wrap {
  padding: 1.5rem 1.5rem 0.5rem;
  background: linear-gradient(
    180deg,
    rgba(var(--cf-accent-rgb), 0.06) 0%,
    transparent 100%
  );
  border-bottom: 1px solid #f0f0f0;
}
.cf-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
}
.cf-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
  animation: podiumRise 0.5s ease both;
}
@keyframes podiumRise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cf-podium-1 {
  animation-delay: 0.1s;
}
.cf-podium-2 {
  animation-delay: 0.2s;
}
.cf-podium-3 {
  animation-delay: 0.3s;
}

.cf-podium-slot::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px 4px 0 0;
  width: 80px;
}
.cf-podium-1::after {
  height: 60px;
  background: var(--cf-accent);
  opacity: 0.15;
}
.cf-podium-2::after {
  height: 42px;
  background: #c0c0c0;
  opacity: 0.2;
}
.cf-podium-3::after {
  height: 28px;
  background: #cd7f32;
  opacity: 0.2;
}

.cf-podium-medal {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}
.cf-podium-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 0.5rem;
}
.cf-podium-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cf-dark);
  max-width: 100px;
  word-break: break-word;
  line-height: 1.3;
}

/* Row list */
.cf-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cf-radius);
  transition: background var(--cf-transition);
}
.cf-leaderboard-row:hover {
  background: #f8f9fa;
}
.cf-leaderboard-row.me {
  background: rgba(var(--cf-accent-rgb), 0.08);
  border: 1.5px solid rgba(var(--cf-accent-rgb), 0.25);
}

.cf-rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cf-rank-1 {
  background: #ffd700;
  color: #000;
}
.cf-rank-2 {
  background: #c0c0c0;
  color: #000;
}
.cf-rank-3 {
  background: #cd7f32;
  color: #fff;
}
.cf-rank-n {
  background: #f3f4f6;
  color: #374151;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. Results
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background var(--cf-transition);
}
.cf-result-row:last-child {
  border-bottom: none;
}
.cf-result-row:hover {
  background: #fafafa;
}

.cf-score-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.cf-score-high {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.cf-score-mid {
  background: rgba(234, 179, 8, 0.12);
  color: #854d0e;
}
.cf-score-low {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. Results
   ═══════════════════════════════════════════════════════════════════════════ */

/* Expand button */
.cf-expand-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--cf-transition);
}
.cf-expand-btn:hover {
  border-color: var(--cf-accent);
  color: var(--cf-accent);
}

/* Detail panel */
.cf-result-detail {
  background: #f8f9fa;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cf-detail-table {
  padding: 0.75rem 1rem;
}

.cf-detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  border-left: 3px solid transparent;
}
.cf-detail-row.correct {
  background: rgba(34, 197, 94, 0.05);
  border-left-color: #22c55e;
}
.cf-detail-row.wrong {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: #ef4444;
}

.cf-detail-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.cf-detail-q {
  color: var(--cf-dark);
  line-height: 1.5;
}
.cf-detail-exp {
  background: rgba(var(--cf-accent-rgb), 0.06);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: #6b7280;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. Notifications
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-notif-card {
  border-radius: var(--cf-radius);
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.6rem;
  transition: all var(--cf-transition);
}
.cf-notif-card.unread {
  background: rgba(var(--cf-accent-rgb), 0.05);
  border-color: rgba(var(--cf-accent-rgb), 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. Badges & Pills
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-difficulty-easy {
  color: #15803d;
  font-weight: 700;
  font-size: 0.75rem;
}
.cf-difficulty-medium {
  color: #b45309;
  font-weight: 700;
  font-size: 0.75rem;
}
.cf-difficulty-hard {
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. Utilities
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 1rem 0;
}

.cf-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}
.cf-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.cf-loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(var(--cf-accent-rgb), 0.3);
  border-top-color: var(--cf-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Make images in question text responsive */
.cf-q-text img,
.cf-q-text table {
  max-width: 100%;
}

/* Prevent text selection during exam */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .cf-sidebar {
    transform: translateX(-100%);
  }
  .cf-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }
  .cf-main-content {
    margin-left: 0;
    padding: 1rem;
  }
  .cf-filter-bar {
    flex-direction: column;
  }
  .cf-filter-group {
    min-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .cf-score-big {
    font-size: 2.5rem;
  }
  .cf-question-card {
    padding: 1rem;
  }
  .cf-main-content {
    padding: 0.75rem;
  }
  .cf-timer-bar {
    font-size: 1rem;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Intentionally not implemented – tenant branding overrides */
}

/* ═══════════════════════════════════════════════════════════════════════════
   User Notifications Page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab bar */
.cf-notif-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.4rem;
  background: #fff;
  border-radius: var(--cf-radius-lg);
  box-shadow: var(--cf-shadow);
}
.cf-notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--cf-font);
  cursor: pointer;
  transition: all var(--cf-transition);
  white-space: nowrap;
}
.cf-notif-tab:hover {
  background: #f3f4f6;
  color: var(--cf-dark);
}
.cf-notif-tab.active {
  background: var(--cf-accent);
  color: var(--cf-dark);
}
.cf-notif-tab-count {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}
.cf-notif-tab.active .cf-notif-tab-count {
  background: rgba(0, 0, 0, 0.15);
}
.unread-tab-badge {
  background: #ef4444 !important;
  color: #fff !important;
}

/* Notification card */
.cf-notif-user-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: var(--cf-radius-lg);
  border: 1px solid #e5e7eb;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  position: relative;
}
.cf-notif-user-card:hover {
  border-color: rgba(var(--cf-accent-rgb), 0.3);
  box-shadow: var(--cf-shadow);
  transform: translateY(-1px);
}
.cf-notif-user-card.unread {
  background: rgba(var(--cf-accent-rgb), 0.04);
  border-color: rgba(var(--cf-accent-rgb), 0.2);
}
.cf-notif-user-card.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--cf-accent);
  border-radius: 0 3px 3px 0;
}

.cf-notif-user-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.cf-notif-user-body {
  flex: 1;
  min-width: 0;
}
.cf-notif-user-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cf-dark);
  margin-bottom: 0.25rem;
}
.cf-notif-user-preview {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cf-notif-user-detail {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.7;
  margin-top: 0.35rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid var(--cf-accent);
  animation: fadeIn 0.2s ease;
}
.cf-notif-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #9ca3af;
}
.cf-notif-user-chevron {
  color: #9ca3af;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: transform 0.2s;
}

/* Unread dot */
.cf-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cf-accent);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Heading unread badge */
.cf-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Profile Page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Avatar edit button */
.cf-avatar-edit-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cf-accent);
  color: var(--cf-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  border: 2px solid #fff;
  transition: transform 0.2s;
}
.cf-avatar-edit-btn:hover {
  transform: scale(1.1);
}

/* Subject toggle checkboxes */
.cf-subject-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1.5px solid #dee2e6;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
  user-select: none;
}
.cf-subject-toggle input {
  display: none;
}
.cf-subject-toggle:hover {
  border-color: var(--cf-accent);
  color: var(--cf-dark);
}
.cf-subject-toggle.checked {
  background: rgba(var(--cf-accent-rgb), 0.12);
  border-color: var(--cf-accent);
  color: color-mix(in srgb, var(--cf-accent) 60%, #000);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Resources Hub
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-resource-card {
  background: #fff;
  border-radius: var(--cf-radius-lg);
  border: 1px solid #e5e7eb;
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all var(--cf-transition);
  height: 100%;
}
.cf-resource-card:hover {
  border-color: rgba(var(--cf-accent-rgb), 0.3);
  box-shadow: var(--cf-shadow);
  transform: translateY(-2px);
}
.cf-resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.cf-resource-info {
  flex: 1;
  min-width: 0;
}
.cf-resource-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--cf-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}
.cf-resource-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: #9ca3af;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Upgrade Page table
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-plan-table td,
.cf-plan-table th {
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Hover row (admin dashboard recent mocks)
   ═══════════════════════════════════════════════════════════════════════════ */
.cf-hover-row {
  transition: background var(--cf-transition);
}
.cf-hover-row:hover {
  background: #f8f9fa;
}
