/* ==========================================================================
   ✨ PYTHON LERNPORTAL – ROCK-SOLID MODERN DESIGN SYSTEM ✨
   ========================================================================== */

:root {
  /* Brand Colors */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --emerald: #059669;
  --emerald-light: #ecfdf5;

  --purple: #7c3aed;
  --purple-light: #f5f3ff;

  --amber: #d97706;
  --amber-light: #fffbeb;

  --rose: #e11d48;
  --rose-light: #fff1f2;

  --success: #10b981;
  --success-light: #ecfdf5;

  /* Surfaces & Backgrounds */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-sidebar: #090d16;
  --bg-code: #0b0f19;

  /* Borders */
  --border-color: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.08);

  /* Typography */
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.65;
  font-size: 16px;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   APP LAYOUT (FLEX CONTAINER)
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar (Left) */
.app-sidebar {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-dark);
  z-index: 100;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.sidebar-logo {
  font-size: 1.6rem;
  background: rgba(79, 70, 229, 0.2);
  border: 1px solid var(--primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-quick-nav {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.sidebar-group-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(79, 70, 229, 0.25);
  color: #ffffff;
  border-left-color: var(--primary);
  font-weight: 700;
}

.sidebar-link-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.3);
}

/* Main Content Area */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
}

header {
  background: linear-gradient(135deg, #090d16 0%, #1e1b4b 100%);
  color: white;
  padding: 35px 24px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 920px;
  margin: 0 auto;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #c7d2fe;
}

header h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}

header p {
  font-size: 1.05rem;
  color: #94a3b8;
  line-height: 1.55;
}

.nav-links {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 24px 60px 24px;
}

/* ==========================================================================
   CARDS & SECTIONS
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--bg-subtle);
  padding-bottom: 8px;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 20px 0 10px 0;
  color: var(--text-main);
}

.card p {
  margin-bottom: 14px;
  color: var(--text-body);
}

.section-header {
  margin: 35px 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

/* Badges */
.track-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.track-1-badge { background: var(--emerald-light); color: var(--emerald); }
.track-2-badge { background: var(--primary-light); color: var(--primary); }
.track-3-badge { background: var(--purple-light); color: var(--purple); }

/* ==========================================================================
   ROADMAP MODULE CARDS
   ========================================================================== */

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin: 20px 0 35px 0;
}

.roadmap-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.roadmap-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.roadmap-number {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  align-self: flex-start;
}

.roadmap-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
  line-height: 1.3;
}

.roadmap-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.card-primary-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.card-primary-btn:hover {
  filter: brightness(0.9);
}

.card-sublinks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-sublinks a {
  flex: 1;
  text-align: center;
  background: var(--bg-subtle);
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.card-sublinks a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==========================================================================
   BOXES & CODE
   ========================================================================== */

.box {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 18px 0;
  border-left: 4px solid;
}

.box-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.box-analogie { background: var(--purple-light); border-left-color: var(--purple); color: #4c1d95; }
.box-tipp { background: var(--primary-light); border-left-color: var(--primary); color: #312e81; }
.box-warning { background: var(--amber-light); border-left-color: var(--amber); color: #78350f; }
.box-danger { background: var(--rose-light); border-left-color: var(--rose); color: #881337; }
.box-success { background: var(--emerald-light); border-left-color: var(--emerald); color: #064e3b; }

.code-container {
  background: var(--bg-code);
  border-radius: var(--radius-md);
  margin: 18px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-dark);
}

.code-header {
  background: #060911;
  color: #94a3b8;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-inverse);
  line-height: 1.55;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-subtle);
  color: #e11d48;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Syntax Highlighting */
.kw { color: #f472b6; font-weight: bold; }
.fn { color: #60a5fa; }
.str { color: #a7f3d0; }
.num { color: #fbbf24; }
.cm { color: #64748b; font-style: italic; }
.var { color: #cbd5e1; }
.attr { color: #38bdf8; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

/* ==========================================================================
   FORM INPUTS & TEXTBOX RESIZING SAFEGUARDS
   ========================================================================== */

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  box-sizing: border-box;
  max-width: 100%;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  resize: vertical; /* Verhindert horizontales Ausbrechen aus Containern */
  overflow-y: auto;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.ihk-input {
  width: 100%;
  max-width: 100% !important;
  min-width: 0 !important;
  resize: vertical !important; /* Nur vertikal vergrößerbar - schützt das Layout */
  box-sizing: border-box !important;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  background: #ffffff;
  color: #0f172a;
  margin-top: 8px;
  margin-bottom: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ihk-input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Sicherstellen, dass kein Kind-Element Karten oder Raster sprengt */
.card, .container, .app-main, .portal-card, .workspace-body, .pane-left, .pane-right, .task-item, .box {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 35px;
  gap: 12px;
  flex-wrap: wrap;
}

/* Live Search */
.search-bar-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  background: transparent;
}

/* Gamification HUD */
.hud-card {
  background: linear-gradient(145deg, #090d16 0%, #0f172a 100%);
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.hud-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-avatar {
  font-size: 2.2rem;
  background: rgba(79, 70, 229, 0.2);
  border: 2px solid #818cf8;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.hud-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.hud-title {
  font-size: 0.9rem;
  color: #94a3b8;
}

.hud-rank {
  color: #fbbf24;
  font-weight: 800;
}

.hud-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-stat-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 85px;
}

.hud-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
}

.hud-stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.hud-progress-container {
  margin: 14px 0;
}

.hud-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 6px;
  font-weight: 600;
}

.hud-progress-bar-bg {
  background: rgba(255, 255, 255, 0.1);
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
}

.hud-progress-bar-fill {
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #6366f1 100%);
  height: 100%;
  border-radius: 7px;
  transition: width 0.6s ease;
}

.hud-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-btn:hover {
  background: var(--primary-hover);
}

.hud-cli-tip {
  font-size: 0.82rem;
  color: #94a3b8;
}

.hud-cli-tip code {
  background: rgba(0, 0, 0, 0.4);
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Parsons */
.parsons-box {
  background: #ffffff;
  border: 2px solid #e0e7ff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.parsons-header {
  margin-bottom: 14px;
}

.parsons-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.parsons-badge {
  background: var(--amber-light);
  color: var(--amber);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
}

.parsons-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.parsons-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.parsons-line {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.parsons-line:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.parsons-code {
  flex: 1;
}

.parsons-code code {
  background: transparent;
  color: var(--text-main);
  font-size: 0.92rem;
  padding: 0;
}

.btn-parsons-move {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 700;
}

.btn-parsons-move:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-parsons-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Certificate Overlay */
.certificate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.certificate-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.certificate-border {
  border: 6px double #d97706;
  border-radius: var(--radius-sm);
  padding: 30px 20px;
  text-align: center;
  background: #fffdfa;
}

.certificate-badge { font-size: 0.85rem; font-weight: 800; letter-spacing: 2px; color: #b45309; margin-bottom: 10px; }
.certificate-headline { font-size: 2rem; color: #1e293b; margin-bottom: 6px; font-weight: 800; }
.certificate-student-name { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin: 14px 0; }
.certificate-track-title { font-size: 1.35rem; color: #0f172a; margin: 10px 0; font-weight: 800; }
.certificate-meta { display: flex; justify-content: space-around; font-size: 0.9rem; margin: 20px 0; padding: 10px 0; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }

/* Mobile Sidebar Drawer */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 99;
}

@media (max-width: 960px) {
  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-xl);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-toggle {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .container {
    padding: 20px 16px;
  }

  header h1 {
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   🚀 IT-PRAXISPORTAL – MODERN LUXURY UX & PORTAL DESIGN SYSTEM
   ========================================================================== */

.portal-header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
}

.portal-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.portal-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(37, 99, 235, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.portal-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #f8fafc;
  line-height: 1.2;
}

.portal-brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: linear-gradient(90deg, #0284c7, #2563eb);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.portal-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.portal-nav-link:hover, .portal-nav-link.active {
  color: #38bdf8;
}

.portal-hero {
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 60%), #0b0f19;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 56px 24px 44px 24px;
  text-align: center;
  color: #f8fafc;
}

.portal-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.portal-hero h1 {
  font-size: 2.7rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin: 0 auto 16px auto;
  max-width: 820px;
  color: #ffffff;
}

.portal-hero p {
  font-size: 1.12rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto 28px auto;
}

.portal-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}

.portal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.portal-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.portal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.portal-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin: 36px auto 0 auto;
}

.portal-stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.portal-stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: #38bdf8;
  line-height: 1;
  margin-bottom: 4px;
}

.portal-stat-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.portal-stat-desc {
  font-size: 0.75rem;
  color: #64748b;
}

/* Filter Bar */
.portal-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 36px 0 24px 0;
}

.portal-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-tab-pill {
  background: white;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.portal-tab-pill:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.portal-tab-pill.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

.portal-search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 99px;
  padding: 6px 14px;
  min-width: 280px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-search-box:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.portal-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  width: 100%;
  margin-left: 8px;
  color: #0f172a;
}

/* Course Cards Grid */
.portal-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.portal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.portal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.portal-card-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.portal-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.portal-card-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.portal-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.portal-card-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.portal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.portal-card-meta {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.portal-card-btn {
  background: #0f172a;
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-card-btn:hover {
  background: #0284c7;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.bento-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.bento-item h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 8px 0 6px 0;
}

.bento-item p {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .portal-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-hero h1 {
    font-size: 2rem;
  }
  .portal-nav-links {
    display: none;
  }
}

/* ==========================================================================
   🧭 DYNAMIC COURSE SIDEBAR & RESPONSIVE DRAWER SYSTEM
   ========================================================================== */

body.has-course-sidebar {
  margin-left: 280px !important;
  transition: margin-left 0.25s ease;
  position: relative;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  body.has-course-sidebar {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }
}

/* Sidebar Container */
.course-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #090d16;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1024px) {
  .course-sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
  }

  .course-sidebar.open {
    transform: translateX(0);
  }
}

/* Sidebar Header */
.course-sidebar-header {
  padding: 16px 16px 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d1322;
  flex-shrink: 0;
}

.course-sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.course-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}

.course-sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.course-sidebar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.course-sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.course-sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1024px) {
  .course-sidebar-close-btn {
    display: inline-flex;
  }
}

.course-sidebar-select {
  width: 100%;
  background: #080c14;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.course-sidebar-select:focus {
  border-color: #38bdf8;
}

/* Progress bar inside sidebar */
.course-sidebar-progress-container {
  margin-top: 12px;
}

.course-sidebar-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 5px;
}

.course-sidebar-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.course-sidebar-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0284c7);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Navigation list */
.course-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.course-sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.course-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.course-sidebar-track-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  padding: 12px 10px 4px 10px;
}

.course-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.course-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.course-sidebar-link.active {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
  font-weight: 700;
}

.course-sidebar-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.course-sidebar-status-icon {
  font-size: 0.72rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon-solved {
  background: #059669;
  color: white;
  font-weight: 800;
}

.status-icon-open {
  border: 1.5px solid #475569;
  color: transparent;
}

.course-sidebar-link.active .status-icon-open {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* Sidebar Footer */
.course-sidebar-footer {
  padding: 12px 16px;
  background: #080c14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.course-sidebar-footer a {
  color: #94a3b8;
  font-size: 0.78rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.course-sidebar-footer a:hover {
  color: #38bdf8;
}

/* Mobile Toggle Button */
.course-sidebar-mobile-btn {
  display: none;
  position: fixed;
  bottom: 22px;
  left: 20px;
  z-index: 1030;
  background: #0f172a;
  color: white;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 0 12px rgba(56, 189, 248, 0.25);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.course-sidebar-mobile-btn:active {
  transform: scale(0.96);
}

@media (max-width: 1024px) {
  .course-sidebar-mobile-btn {
    display: inline-flex;
  }
}

.course-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1040;
}

.course-sidebar-backdrop.active {
  display: block;
}

/* Workspace Specific Drawer Overrides */
body.workspace-page.has-course-sidebar {
  margin-left: 0 !important;
}

.workspace-page .course-sidebar {
  transform: translateX(-100%);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85);
  z-index: 9999;
}

.workspace-page .course-sidebar.open {
  transform: translateX(0);
}

.workspace-page .course-sidebar-close-btn {
  display: inline-flex;
}

.workspace-page .course-sidebar-backdrop {
  z-index: 9998;
}

