/* ============================================================
   LearnPlatform — main.css  (Full Redesign)
   Theme: Modern, clean, professional — dark navy accents
   ============================================================ */

/* ── VARIABLES ───────────────────────────────────────────── */
:root {
  /* Brand colors */
  --primary:        #4f46e5;   /* indigo */
  --primary-hover:  #4338ca;
  --primary-light:  #eef2ff;
  --primary-dark:   #312e81;

  /* Semantic */
  --success:        #059669;
  --success-light:  #ecfdf5;
  --warning:        #d97706;
  --warning-light:  #fffbeb;
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --info:           #0891b2;
  --info-light:     #ecfeff;

  /* Text */
  --text-main:      #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #f8fafc;

  /* Backgrounds */
  --bg-page:        #f1f5f9;
  --bg-white:       #ffffff;
  --bg-dark:        #0f172a;
  --bg-sidebar:     #1e1b4b;  /* deep indigo sidebar */

  /* Borders */
  --border:         #e2e8f0;
  --border-focus:   #a5b4fc;

  /* Spacing & shape */
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.12);

  /* Layout */
  --navbar-h:        60px;
  --sidebar-w:       260px;
  --lesson-sidebar-w:280px;
  --admin-sidebar-w: 230px;

  /* Fonts */
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-code: 'Fira Code', 'JetBrains Mono', monospace;
}

/* ── BASE ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); }

/* ── NAVBAR ──────────────────────────────────────────────── */
.lp-navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
}
.lp-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary) !important;
  letter-spacing: -0.5px;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.lp-navbar .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.lp-navbar .nav-link:hover {
  background: var(--primary-light);
  color: var(--primary) !important;
  text-decoration: none;
}
.lp-btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
  padding: 0.35rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.lp-btn-outline:hover { background: var(--primary); color: #fff; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.lp-btn-primary, .btn-primary {
  background: var(--primary);
  border: none;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
  text-decoration: none !important;
}
.lp-btn-primary:hover, .btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  color: var(--text-secondary) !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
  text-decoration: none !important;
}
.btn-secondary:hover { background: var(--bg-page); border-color: var(--primary); color: var(--primary) !important; }
.btn-danger {
  background: var(--danger-light);
  border: none;
  color: var(--danger) !important;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}
.btn-danger:hover { background: var(--danger); color: #fff !important; }
.btn-sm { padding: 0.3rem 0.75rem !important; font-size: 0.8rem !important; }

/* ── FORM CONTROLS ───────────────────────────────────────── */
.form-control, .lp-input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-white);
  transition: all 0.15s;
  width: 100%;
  outline: none;
}
.form-control:focus, .lp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-label, .lp-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.text-danger { color: var(--danger) !important; font-size: 0.78rem; margin-top: 0.25rem; display: block; }

/* ── CARDS ───────────────────────────────────────────────── */
.lp-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.lp-card:hover { box-shadow: var(--shadow); border-color: #c7d2fe; transform: translateY(-2px); }

/* ── ALERTS ──────────────────────────────────────────────── */
.lp-alert-error   { background:var(--danger-light);  border:1.5px solid #fca5a5; color:var(--danger);  border-radius:var(--radius); padding:0.75rem 1rem; font-size:0.875rem; display:flex; align-items:center; gap:0.5rem; }
.lp-alert-success { background:var(--success-light); border:1.5px solid #6ee7b7; color:var(--success); border-radius:var(--radius); padding:0.75rem 1rem; font-size:0.875rem; display:flex; align-items:center; gap:0.5rem; }
.lp-alert-info    { background:var(--primary-light); border:1.5px solid #a5b4fc; color:var(--primary); border-radius:var(--radius); padding:0.75rem 1rem; font-size:0.875rem; display:flex; align-items:center; gap:0.5rem; }

/* ── BADGES ──────────────────────────────────────────────── */
.lp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-java         { background:#fef3c7; color:#78350f; border:1px solid #fde68a; }
.badge-hibernate    { background:#ede9fe; color:#4c1d95; border:1px solid #c4b5fd; }
.badge-spring-mvc   { background:#dcfce7; color:#14532d; border:1px solid #86efac; }
.badge-spring-boot  { background:#dbeafe; color:#1e3a8a; border:1px solid #93c5fd; }
.badge-python       { background:#d1fae5; color:#064e3b; border:1px solid #6ee7b7; }
.badge-javascript   { background:#fefce8; color:#713f12; border:1px solid #fde047; }
.badge-beginner     { background:#dcfce7; color:#15803d; }
.badge-intermediate { background:#fef9c3; color:#854d0e; }
.badge-advanced     { background:#fee2e2; color:#991b1b; }

/* ── PROGRESS ────────────────────────────────────────────── */
.lp-progress { background:#e2e8f0; border-radius:20px; height:6px; overflow:hidden; }
.lp-progress-bar { background:linear-gradient(90deg,var(--primary),#818cf8); height:100%; border-radius:20px; transition:width 0.6s ease; }

/* ── TABLE ───────────────────────────────────────────────── */
.lp-table { width:100%; border-collapse:collapse; font-size:0.875rem; }
.lp-table thead tr { background:var(--bg-page); }
.lp-table th { color:var(--text-muted); font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; padding:0.75rem 1rem; border-bottom:2px solid var(--border); white-space:nowrap; }
.lp-table td { padding:0.9rem 1rem; border-bottom:1px solid var(--border); color:var(--text-main); vertical-align:middle; }
.lp-table tr:last-child td { border-bottom:none; }
.lp-table tbody tr:hover td { background:#fafbff; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header { background:var(--bg-white); border-bottom:1px solid var(--border); padding:1.75rem 0; margin-bottom:1.5rem; }
.page-header h1 { font-size:1.5rem; font-weight:800; margin-bottom:0.2rem; color:var(--text-main); }
.page-header p  { color:var(--text-muted); margin-bottom:0; font-size:0.875rem; }

/* ── SECTION ─────────────────────────────────────────────── */
.section-title { font-size:1.1rem; font-weight:700; color:var(--text-main); }
.section-sub   { color:var(--text-muted); font-size:0.85rem; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow); border-color: #c7d2fe; }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.indigo  { background: var(--primary-light); color: var(--primary); }
.stat-icon.green   { background: var(--success-light); color: var(--success); }
.stat-icon.amber   { background: var(--warning-light); color: var(--warning); }
.stat-icon.cyan    { background: var(--info-light);    color: var(--info);    }
.stat-number { font-size: 1.75rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.stat-label  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 500; }

/* ── AUTH ────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, #f0f9ff 100%);
  padding: 1.5rem 0;
}
.auth-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
}
.auth-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.35rem; color: var(--text-main); }
.auth-card p.subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }
hr.lp-divider { border-color: var(--border); margin: 1.5rem 0; }

/* ── FILTER BADGES ───────────────────────────────────────── */
.lp-badge-filter {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none !important;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-white);
  transition: all 0.15s;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  letter-spacing: 0.3px;
}
.lp-badge-filter:hover, .lp-badge-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

/* ── CODE ────────────────────────────────────────────────── */
pre, code { font-family: var(--font-code); }
.code-block { background:#0f172a; color:#e2e8f0; border-radius:var(--radius); padding:1.25rem; overflow-x:auto; font-size:0.85rem; line-height:1.7; border:1px solid #1e293b; }

/* ── FOOTER ──────────────────────────────────────────────── */
.lp-footer { background:var(--bg-white); border-top:1px solid var(--border); color:var(--text-muted); margin-top:auto; }

/* ── COURSE/LESSON CARDS (public pages) ─────────────────── */
.course-hero { background:var(--bg-white); border-bottom:1px solid var(--border); padding:2.5rem 0; }
.lesson-card {
  background:var(--bg-white); border:1.5px solid var(--border);
  border-radius:var(--radius); padding:1rem 1.25rem;
  display:flex; align-items:center; gap:1rem;
  transition:all 0.15s; text-decoration:none !important; margin-bottom:0.5rem;
}
.lesson-card:hover { border-color:var(--primary); background:var(--primary-light); transform:translateX(4px); }
.lesson-card.completed { border-color:#6ee7b7; background:#f0fdf4; }
.guest-banner { background:linear-gradient(135deg,var(--primary-light),#f0f9ff); border:1.5px solid #a5b4fc; border-radius:var(--radius-lg); padding:1.5rem; }

/* ══════════════════════════════════════════════════════════
   USER SIDEBAR (dark indigo)
══════════════════════════════════════════════════════════ */
.user-layout { display:flex; min-height:calc(100vh - var(--navbar-h)); }

.user-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed;
  top: var(--navbar-h);
  bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 200;
  padding: 1rem 0 2rem;
  transition: transform 0.3s ease;
}
.user-sidebar::-webkit-scrollbar { width: 4px; }
.user-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.user-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.75rem;
}
.user-avatar { font-size: 2.2rem; color: #818cf8; line-height: 1; flex-shrink: 0; }
.user-sidebar-name { font-weight: 700; font-size: 0.85rem; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sidebar-role { font-size: 0.7rem; color: #64748b; margin-top: 1px; }

.user-sidebar-nav { display:flex; flex-direction:column; padding:0 0.75rem; }
.user-sidebar-section { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #475569; padding: 0.75rem 0.5rem 0.3rem; }
.user-sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  color: #94a3b8; font-size: 0.85rem; font-weight: 500;
  text-decoration: none !important; transition: all 0.15s;
  cursor: pointer; width: 100%; background: transparent;
  border: none; text-align: left;
}
.user-sidebar-link:hover  { background:rgba(129,140,248,0.15); color:#e2e8f0; }
.user-sidebar-link.active { background:rgba(79,70,229,0.3); color:#fff; font-weight:600; }
.user-sidebar-link i { width: 18px; text-align: center; flex-shrink: 0; }

.user-main {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 2rem;
  background: var(--bg-page);
  min-height: calc(100vh - var(--navbar-h));
  min-width: 0;
}

/* Track sidebar */
.track-group { margin-bottom: 2px; }
.track-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; background: transparent; border: none;
  border-radius: var(--radius); cursor: pointer; transition: background 0.15s; text-align: left;
}
.track-header:hover { background: rgba(129,140,248,0.12); }
.track-icon { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:800; flex-shrink:0; }
.track-name { font-size:0.83rem; font-weight:600; color:#e2e8f0; line-height:1.3; }
.track-sub  { font-size:0.68rem; color:#64748b; }
.track-arrow { font-size:0.65rem; color:#475569; transition:transform 0.25s; flex-shrink:0; }
.track-arrow.rotated { transform:rotate(90deg); }
.track-children { max-height:0; overflow:hidden; transition:max-height 0.3s ease; padding-left:0.5rem; }
.track-child {
  display:flex; align-items:center; gap:0.5rem;
  padding:0.38rem 0.75rem; font-size:0.8rem; color:#64748b;
  text-decoration:none !important; border-radius:var(--radius);
  border-left:2px solid rgba(255,255,255,0.06);
  margin-left:0.5rem; margin-bottom:1px; transition:all 0.15s;
}
.track-child:hover { background:rgba(129,140,248,0.15); color:#e2e8f0; border-left-color:#818cf8; }
.track-child.active { background:rgba(79,70,229,0.25); color:#fff; border-left-color:#818cf8; font-weight:600; }
.level-dot { font-size:0.58rem; font-weight:700; padding:1px 5px; border-radius:4px; margin-left:auto; flex-shrink:0; }
.level-dot.beginner     { background:#064e3b; color:#6ee7b7; }
.level-dot.intermediate { background:#78350f; color:#fcd34d; }
.level-dot.advanced     { background:#7f1d1d; color:#fca5a5; }

/* Mobile sidebar */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem; left: 1.25rem;
  z-index: 300;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(79,70,229,0.45);
  font-size: 1.1rem; cursor: pointer;
  align-items: center; justify-content: center;
}
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:150; backdrop-filter:blur(2px); }
.sidebar-overlay.show { display:block; }

/* ══════════════════════════════════════════════════════════
   LESSON LAYOUT
══════════════════════════════════════════════════════════ */
.lesson-layout { display:flex; min-height:100vh; }
.lesson-sidebar {
  width: var(--lesson-sidebar-w);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  position: fixed; top: var(--navbar-h); bottom:0; left:0;
  overflow-y: auto; z-index: 200; transition: transform 0.3s ease;
}
.lesson-sidebar-header { padding:1.25rem; border-bottom:1px solid var(--border); background:var(--bg-page); }
.lesson-sidebar-header h6 { font-size:0.65rem; font-weight:800; text-transform:uppercase; letter-spacing:0.8px; color:var(--text-muted); margin:0 0 0.5rem; }
.lesson-sidebar-title { font-size:0.875rem; font-weight:700; color:var(--text-main); margin-bottom:0.6rem; line-height:1.4; }
.lesson-sidebar-progress-text { font-size:0.72rem; color:var(--text-muted); margin-bottom:4px; }
.lesson-nav-list { padding:0.5rem 0; }
.lesson-nav-item {
  display:flex; align-items:center; gap:0.6rem;
  padding:0.65rem 1.25rem; color:var(--text-secondary);
  font-size:0.83rem; font-weight:500;
  text-decoration:none !important;
  border-left:3px solid transparent; transition:all 0.15s; line-height:1.4;
}
.lesson-nav-item:hover  { background:var(--primary-light); color:var(--primary); border-left-color:var(--primary); }
.lesson-nav-item.active { background:var(--primary-light); color:var(--primary); border-left-color:var(--primary); font-weight:600; }
.lesson-nav-item.completed { color:var(--success); }
.lesson-num {
  width:22px; height:22px; border-radius:50%;
  background:var(--border); color:var(--text-muted);
  font-size:0.68rem; font-weight:700;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.lesson-nav-item.active .lesson-num    { background:var(--primary); color:#fff; }
.lesson-nav-item.completed .lesson-num { background:var(--success); color:#fff; }
.lesson-main { margin-left:var(--lesson-sidebar-w); flex:1; padding:2rem 2.5rem; min-width:0; }

/* Lesson content */
.lesson-content h1,.lesson-content h2 { font-size:1.4rem; font-weight:800; color:var(--text-main); margin:2rem 0 0.75rem; padding-bottom:0.6rem; border-bottom:2px solid var(--border); }
.lesson-content h3 { font-size:1.1rem; font-weight:700; color:var(--text-main); margin:1.5rem 0 0.5rem; }
.lesson-content h4 { font-size:1rem; font-weight:600; margin:1.25rem 0 0.4rem; }
.lesson-content p  { line-height:1.85; color:var(--text-secondary); margin-bottom:1rem; }
.lesson-content ul,.lesson-content ol { padding-left:1.5rem; margin-bottom:1rem; color:var(--text-secondary); line-height:1.8; }
.lesson-content li { margin-bottom:0.35rem; }
.lesson-content strong { color:var(--text-main); font-weight:700; }
.lesson-content code { font-family:var(--font-code); background:#f1f5f9; color:#be185d; padding:2px 7px; border-radius:5px; font-size:0.85em; border:1px solid #e2e8f0; }
.lesson-content pre { background:#0f172a; color:#e2e8f0; border-radius:var(--radius-lg); padding:1.5rem; overflow-x:auto; margin:1.25rem 0; font-family:var(--font-code); font-size:0.85rem; line-height:1.75; border:1px solid #1e293b; }
.lesson-content pre code { background:none; color:inherit; padding:0; border:none; border-radius:0; }
.lesson-content blockquote { border-left:4px solid var(--primary); background:var(--primary-light); padding:1rem 1.25rem; border-radius:0 var(--radius) var(--radius) 0; margin:1.25rem 0; color:var(--primary); font-style:italic; }
.lesson-content table { width:100%; border-collapse:collapse; margin:1.25rem 0; overflow-x:auto; display:block; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); }
.lesson-content th { background:var(--bg-page); padding:0.65rem 1rem; border-bottom:2px solid var(--border); font-weight:700; font-size:0.8rem; text-transform:uppercase; letter-spacing:0.4px; color:var(--text-secondary); white-space:nowrap; }
.lesson-content td { padding:0.65rem 1rem; border-bottom:1px solid var(--border); font-size:0.875rem; color:var(--text-secondary); }
.lesson-content tr:last-child td { border-bottom:none; }
.lesson-action-bar { display:flex; justify-content:space-between; align-items:center; padding:1.5rem 0; border-top:1.5px solid var(--border); margin-top:2.5rem; gap:1rem; flex-wrap:wrap; }

/* ══════════════════════════════════════════════════════════
   ADMIN LAYOUT (dark sidebar)
══════════════════════════════════════════════════════════ */
.admin-layout { display:flex; min-height:100vh; }
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--bg-dark);
  position: fixed; top:0; left:0; bottom:0;
  z-index: 200; overflow-y: auto;
  padding: 1.25rem 0;
  transition: transform 0.3s ease;
}
.sidebar-brand { font-weight:800; font-size:1rem; padding:0 1.25rem 1.25rem; border-bottom:1px solid rgba(255,255,255,0.08); margin-bottom:0.75rem; color:#e2e8f0; display:flex; align-items:center; gap:0.4rem; }
.sidebar-brand span { color:#818cf8; }
.sidebar-nav { display:flex; flex-direction:column; padding:0 0.75rem; gap:2px; }
.sidebar-link { display:flex; align-items:center; gap:0.6rem; padding:0.5rem 0.75rem; border-radius:var(--radius); color:#94a3b8; font-size:0.85rem; font-weight:500; text-decoration:none !important; transition:all 0.15s; }
.sidebar-link:hover  { background:rgba(129,140,248,0.12); color:#e2e8f0; }
.sidebar-link.active { background:rgba(79,70,229,0.3); color:#fff; font-weight:600; }
.sidebar-link i { width:18px; text-align:center; flex-shrink:0; }
.sidebar-divider { border-color:rgba(255,255,255,0.08); margin:0.5rem 0.75rem; }

.admin-content { margin-left:var(--admin-sidebar-w); flex:1; padding:2rem; background:var(--bg-page); min-height:100vh; min-width:0; }
.admin-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:1.75rem; flex-wrap:wrap; gap:0.75rem; padding-bottom:1.25rem; border-bottom:1px solid var(--border); }
.admin-header h1 { font-size:1.4rem; font-weight:800; margin:0; color:var(--text-main); }

.admin-table-wrapper { background:var(--bg-white); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; overflow-x:auto; box-shadow:var(--shadow-sm); }
.admin-form-card { background:var(--bg-white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:2rem; max-width:820px; box-shadow:var(--shadow-sm); }
.admin-form-card h2 { font-size:1rem; font-weight:700; margin-bottom:1.5rem; padding-bottom:0.75rem; border-bottom:1px solid var(--border); color:var(--text-main); }

.admin-stat { background:var(--bg-white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:1.5rem; display:flex; align-items:center; gap:1rem; box-shadow:var(--shadow-sm); transition:all 0.2s; }
.admin-stat:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.admin-stat-icon { width:50px; height:50px; border-radius:var(--radius-lg); display:flex; align-items:center; justify-content:center; font-size:1.3rem; flex-shrink:0; }
.admin-stat-icon.blue   { background:var(--primary-light); color:var(--primary); }
.admin-stat-icon.green  { background:var(--success-light); color:var(--success); }
.admin-stat-icon.orange { background:var(--warning-light); color:var(--warning); }
.admin-stat-num   { font-size:1.75rem; font-weight:800; color:var(--text-main); line-height:1; }
.admin-stat-label { font-size:0.78rem; color:var(--text-muted); margin-top:0.2rem; font-weight:500; }
.admin-breadcrumb { font-size:0.8rem; color:var(--text-muted); margin-bottom:1rem; display:flex; align-items:center; gap:0.4rem; flex-wrap:wrap; }
.admin-breadcrumb a { color:var(--primary); }
.admin-breadcrumb a:hover { text-decoration:underline; }

/* Quick action cards */
.quick-action-card { background:var(--bg-white); border:1.5px solid var(--border); border-radius:var(--radius-lg); padding:1.25rem; display:flex; align-items:center; gap:1rem; text-decoration:none !important; transition:all 0.2s; }
.quick-action-card:hover { border-color:var(--primary); background:var(--primary-light); transform:translateY(-2px); box-shadow:var(--shadow); }
.quick-action-icon { width:42px; height:42px; border-radius:var(--radius); display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .user-sidebar   { transform:translateX(-100%); box-shadow:4px 0 30px rgba(0,0,0,0.2); }
  .lesson-sidebar { transform:translateX(-100%); box-shadow:4px 0 30px rgba(0,0,0,0.15); }
  .admin-sidebar  { transform:translateX(-100%); box-shadow:4px 0 30px rgba(0,0,0,0.2); }
  .user-sidebar.open, .lesson-sidebar.open, .admin-sidebar.open { transform:translateX(0); }
  .user-main    { margin-left:0 !important; padding:1.25rem; }
  .lesson-main  { margin-left:0 !important; padding:1.25rem 1rem; }
  .admin-content{ margin-left:0 !important; padding:1.25rem; }
  .sidebar-toggle { display:flex; }
  .admin-form-card { max-width:100%; padding:1.25rem; }
}

@media (max-width: 767px) {
  :root { --navbar-h: 56px; }
  .page-header { padding:1.25rem 0; }
  .page-header h1 { font-size:1.2rem; }
  .admin-header { flex-direction:column; align-items:stretch; }
  .admin-header .lp-btn-primary { justify-content:center; }
  .lesson-action-bar { flex-direction:column; }
  .lesson-action-bar > div { width:100%; display:flex; justify-content:center; }
  .lesson-action-bar .lp-btn-primary,
  .lesson-action-bar .btn-secondary { width:100%; justify-content:center; }
  .auth-card { padding:1.5rem; border-radius:var(--radius-lg); }
  .admin-table-wrapper { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .lp-table { min-width:550px; }
  .stat-card { padding:1rem; }
  .admin-stat { padding:1rem; }
  .guest-banner { padding:1rem; }
  .guest-banner .d-flex { flex-direction:column; gap:1rem !important; }
  .lesson-content pre { font-size:0.78rem; padding:1rem; }
  .lesson-main { padding:1rem 0.75rem; }
  .user-main   { padding:1rem; }
}

@media (max-width: 480px) {
  .auth-card { padding:1.25rem; margin:0 0.5rem; }
  .admin-content { padding:0.75rem; }
  .lesson-content h1,.lesson-content h2 { font-size:1.2rem; }
}

/* ── DEVPATH LOGO ────────────────────────────────────────── */
.brand-icon-box {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 1px;
  line-height: 1;
}
.brand-icon-dev {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
  line-height: 1;
}
.brand-icon-path {
  font-family: var(--font-code);
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.15);
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  line-height: 1.4;
}
.brand-wordmark {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  line-height: 1;
}
.lp-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
}

/* ── NAVBAR MOBILE FIX ───────────────────────────────────── */
@media (max-width: 991px) {
  .lp-navbar .navbar-nav {
    padding: 0.5rem 0;
    gap: 2px;
  }
  .lp-navbar .navbar-nav .nav-item { width: 100%; }
  .lp-navbar .navbar-nav .nav-link { width: 100%; }
  .lp-navbar .navbar-nav .lp-btn-outline {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.25rem 0;
  }
  /* Fix auth page logo overlapping on mobile */
  .auth-wrapper .brand-icon-box {
    width: 28px;
    height: 28px;
  }
  .auth-wrapper .brand-wordmark { font-size: 1rem; }
}

@media (max-width: 575px) {
  /* Navbar brand — smaller on very small screens */
  .brand-icon-box { width: 28px; height: 28px; }
  .brand-icon-dev  { font-size: 0.55rem; }
  .brand-icon-path { font-size: 0.5rem; }
  .brand-wordmark  { font-size: 1rem; }

  /* Auth logo on mobile — stack properly */
  .auth-wrapper .text-center .d-inline-flex {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  /* Prevent logo from overlapping navbar buttons */
  .auth-wrapper { padding-top: 0.5rem; }
}

/* ── NAVBAR MOBILE COLLAPSE FIX ─────────────────────────── */
@media (max-width: 991px) {

  /* Collapsed menu gets a white background card */
  .lp-navbar .navbar-collapse {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    margin: 0 -12px;
    padding: 0.75rem 1rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }

  /* Stack nav items cleanly */
  .lp-navbar .navbar-nav { gap: 2px; }
  .lp-navbar .nav-link {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
  }

  /* Buttons full width on mobile */
  .lp-navbar .lp-btn-outline {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.35rem;
    padding: 0.5rem 1rem;
  }

  /* Logout form full width */
  .lp-navbar form { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   PROFESSIONAL INNER PAGE POLISH
   Small fonts, tight spacing, clean cards — like a SaaS app
══════════════════════════════════════════════════════════ */

/* Tighter base font for inner pages */
.user-main, .admin-content {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── PAGE TITLE AREA ─────────────────────────────────────── */
.page-intro { margin-bottom: 1.75rem; }
.page-intro h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}
.page-intro p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

/* ── STAT CARDS — compact SaaS style ────────────────────── */
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.indigo::before { background: var(--primary); }
.stat-card.green::before  { background: var(--success); }
.stat-card.amber::before  { background: var(--warning); }
.stat-card.cyan::before   { background: var(--info); }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ── SECTION LABEL ───────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── COURSE PROGRESS CARD — cleaner ─────────────────────── */
.course-progress-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.course-progress-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 20px rgba(79,70,229,0.08);
  transform: translateY(-1px);
}
.course-progress-card .lang-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.6rem;
}
.course-progress-card h6 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.course-progress-card .progress-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}
.course-progress-card .lp-progress {
  height: 4px;
  margin-bottom: 0.75rem;
}
.course-progress-card .action-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  transition: gap 0.15s;
}
.course-progress-card .action-link:hover { gap: 0.5rem; }

/* ── TABLE improvements ──────────────────────────────────── */
.lp-table th {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
}
.lp-table td {
  font-size: 0.83rem;
  padding: 0.8rem 1rem;
}

/* ── ADMIN STAT compact ──────────────────────────────────── */
.admin-stat {
  padding: 1.1rem 1.25rem;
}
.admin-stat-num { font-size: 1.5rem; }
.admin-stat-label { font-size: 0.72rem; letter-spacing: 0.3px; }

/* ── QUICK ACTION compact ────────────────────────────────── */
.quick-action-card {
  padding: 1rem 1.1rem;
}
.quick-action-icon {
  width: 36px; height: 36px;
  font-size: 1.05rem;
}
.quick-action-card div div:first-child { font-size: 0.85rem; }
.quick-action-card div div:last-child  { font-size: 0.75rem; }

/* ── FORM LABEL tighter ──────────────────────────────────── */
.lp-label {
  font-size: 0.72rem;
  letter-spacing: 0.6px;
}
.form-control {
  font-size: 0.875rem;
  padding: 0.5rem 0.85rem;
}

/* ── BADGE tighter ───────────────────────────────────────── */
.lp-badge { font-size: 0.63rem; padding: 2px 8px; letter-spacing: 0.5px; }

/* ── SIDEBAR refinements ─────────────────────────────────── */
.user-sidebar-name  { font-size: 0.82rem; }
.user-sidebar-role  { font-size: 0.68rem; letter-spacing: 0.3px; }
.user-sidebar-section { font-size: 0.63rem; letter-spacing: 1.2px; }
.user-sidebar-link  { font-size: 0.82rem; padding: 0.45rem 0.75rem; }
.track-name         { font-size: 0.82rem; }
.track-sub          { font-size: 0.68rem; }
.track-child        { font-size: 0.78rem; }
.sidebar-link       { font-size: 0.82rem; }

/* ── NAVBAR tighter ──────────────────────────────────────── */
.lp-navbar .nav-link { font-size: 0.83rem; }
.brand-wordmark      { font-size: 1.1rem; }

/* ── FOOTER compact ──────────────────────────────────────── */
.lp-footer { font-size: 0.8rem; }

/* ── ALERT compact ───────────────────────────────────────── */
.lp-alert-success, .lp-alert-error, .lp-alert-info {
  font-size: 0.82rem;
  padding: 0.65rem 0.9rem;
}

/* ── BUTTON sizes ────────────────────────────────────────── */
.lp-btn-primary, .btn-primary {
  font-size: 0.83rem;
  padding: 0.5rem 1.1rem;
}
.btn-secondary { font-size: 0.83rem; padding: 0.45rem 1rem; }
.btn-sm { font-size: 0.75rem !important; padding: 0.28rem 0.65rem !important; }

/* ══════════════════════════════════════════════════════════
   AD SLOTS — Labeled, non-intrusive
══════════════════════════════════════════════════════════ */
.ad-slot {
  position: relative;
  margin: 1.5rem 0;
}
.ad-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

/* Horizontal banner */
.ad-banner-slot {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

/* Square ad */
.ad-square-slot {
  text-align: center;
}

/* Affiliate native card */
.ad-affiliate-slot { margin: 1.75rem 0; }
.affiliate-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(135deg, #fafbff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}
.affiliate-icon {
  width: 40px; height: 40px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.affiliate-body { flex: 1; min-width: 0; }
.affiliate-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}
.affiliate-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
  line-height: 1.5;
}
.affiliate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--primary);
  color: white !important;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: all 0.15s;
}
.affiliate-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79,70,229,0.3);
}

/* Mobile: hide banner, keep affiliate only */
@media (max-width: 767px) {
  .ad-banner-slot { display: none; }
  .ad-square-slot { display: none; }
  .affiliate-card { flex-direction: column; gap: 0.75rem; }
}

/* ══════════════════════════════════════════════════════════
   RIGHT SIDE STICKY AD BAR
══════════════════════════════════════════════════════════ */
.page-with-ad {
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--navbar-h));
}
.page-content-area {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  background: var(--bg-page);
}
.right-ad-bar {
  width: 160px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-left: 1px solid var(--border);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}
.right-ad-bar .ad-label {
  font-size: 0.6rem;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}
.right-ad-unit {
  text-align: center;
}
/* Hide right ad on mobile */
@media (max-width: 1024px) {
  .right-ad-bar { display: none; }
  .page-content-area { padding: 1.25rem; }
}
