/* ==========================================================================
   CSS Design Tokens & Core Settings
   ========================================================================== */
:root {
  /* HSL Tailored Color Palette - Flugschule Freiflug Corporate Identity */
  --bg-deep: hsl(205, 54%, 93%); /* Hellgrau-blaues Page-Background (#e5f0f8) */
  --bg-card: hsl(0, 0%, 100%); /* Pure white cards */
  --bg-card-hover: hsl(190, 43%, 98%);
  --bg-input: hsl(190, 43%, 93%); /* Hellgrau-Teal Input-Hintergrund (#e4f2f5) */
  --border-glass: hsl(192, 40%, 85%);
  --border-focus: hsla(192, 100%, 31%, 0.25);
  
  /* Akzentfarben – Flugschule Freiflug (Slate-Blau · Gold · Grün) */
  --color-sky-blue: #274460; /* Slate-/Petrol-Blau (Primär) */
  --color-sunset-orange: #d99700; /* Gold (Akzent, auf Weiß lesbar) */
  --color-glow-green: #5ab403; /* Grün (Erfolg / Logo) */
  --color-glow-yellow: #f9b900; /* Freiflug-Gold (hell) */
  --color-glow-red: #e2241a; /* Alert-Rot */
  --ff-gold: #f9b900;
  --ff-green: #5ab403;
  --ff-blue-deep: #1b3247;
  
  /* Text Colors - High contrast slate adjusted for corporate palette */
  --color-text-primary: hsl(210, 50%, 12%); /* Dark slate/navy blue */
  --color-text-secondary: hsl(192, 40%, 25%); /* Medium corporate teal-slate */
  --color-text-muted: hsl(200, 15%, 45%); /* Muted slate */
  
  /* Fonts & Weights */
  --font-family: 'Raleway', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Shadows & Blurs */
  --blur-glass: 0px; /* Disable blur for solid light design */
  --shadow-neon-orange: 0 4px 12px hsla(330, 99%, 30%, 0.1);
  --shadow-neon-blue: 0 4px 12px hsla(192, 100%, 31%, 0.1);
  --shadow-card: 0 4px 20px hsla(210, 50%, 12%, 0.06);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(192, 20%, 80%);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(192, 40%, 65%);
}

/* Glassmorphism Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* Common Layout Containers */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.header-logo {
  display: flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.5px;
}

.logo-bit {
  color: var(--color-sky-blue);
  text-shadow: 0 0 10px hsla(200, 100%, 50%, 0.3);
}

.logo-fly {
  color: var(--color-sunset-orange);
  text-shadow: 0 0 10px hsla(25, 100%, 50%, 0.3);
}

.logo-tag {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-left: 10px;
  border-left: 1px solid var(--border-glass);
  padding-left: 10px;
}

.user-status-bar {
  display: flex;
  align-items: center;
  gap: 15px;
}

.username-display {
  font-weight: 500;
  font-size: 15px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-sky-blue) 0%, hsl(200, 100%, 40%) 100%);
  color: #fff;
  box-shadow: var(--shadow-neon-blue);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-sunset-orange) 0%, hsl(25, 100%, 40%) 100%);
  color: #fff;
  box-shadow: var(--shadow-neon-orange);
}
.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: hsla(0, 0%, 100%, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-text-primary);
}
.btn-secondary:hover {
  background: hsla(0, 0%, 100%, 0.1);
}

.btn-danger {
  background: hsla(5, 85%, 55%, 0.2);
  border: 1px solid hsla(5, 85%, 55%, 0.4);
  color: hsl(5, 85%, 70%);
}
.btn-danger:hover {
  background: hsla(5, 85%, 55%, 0.3);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-sky-blue);
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 600;
  text-decoration: underline;
}
.btn-link:hover {
  color: var(--color-sunset-orange);
}

.full-width {
  width: 100%;
}

/* ==========================================================================
   Auth / Login Component
   ========================================================================== */
.auth-panel {
  max-width: 450px;
  width: 100%;
  margin: 60px auto;
  padding: 30px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: var(--color-sky-blue);
  border-bottom: 2px solid var(--color-sky-blue);
}

.auth-form h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.auth-desc {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-sky-blue);
  box-shadow: 0 0 8px var(--border-focus);
}

.guest-action {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 15px;
}

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.left-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Search and Filters */
.search-filter-box {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  transition: all 0.2s ease;
}

.search-wrapper input:focus {
  outline: none;
  border-color: var(--color-sky-blue);
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background: hsla(0, 0%, 100%, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--color-text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
  color: #fff;
  background: var(--color-sky-blue);
  border-color: var(--color-sky-blue);
}

/* Maneuvers Cards List */
.maneuvers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-right: 5px;
}

.maneuver-card {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  transition: all 0.2s ease;
}

.maneuver-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: var(--color-sky-blue);
  box-shadow: 0 8px 30px hsla(192, 100%, 31%, 0.08);
}

.maneuver-card-info {
  flex: 1;
}

.maneuver-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}

.badge-warm-up { background-color: hsl(200, 75%, 45%); }
.badge-dynamik-teil-1, .badge-dynamik-teil-2, .badge-dynamik-1, .badge-dynamik-2 { background-color: hsl(272, 60%, 48%); }
.badge-die-spirale-teil-2 { background-color: hsl(315, 60%, 45%); }
.badge-abstiegshilfen { background-color: hsl(145, 65%, 38%); }
.badge-klapper { background-color: hsl(35, 80%, 42%); }
.badge-negativ { background-color: hsl(352, 70%, 45%); }
.badge-rettungsgerät { background-color: hsl(24, 80%, 45%); }

.maneuver-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.maneuver-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.maneuver-card-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.skill-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.skill-score {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.skill-label {
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Dynamic Skill Color Utility Classes */
.score-high { color: var(--color-glow-green); }
.score-medium { color: var(--color-glow-yellow); }
.score-low { color: var(--color-glow-red); }
.score-none { color: var(--color-text-muted); }

/* Right Section Graph Box */
.right-section {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - 120px);
  position: sticky;
  top: 20px;
}

.section-title-bar h2 {
  font-size: 18px;
  font-weight: 700;
}

.target-selector-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.target-selector-box select {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 14px;
}

/* Interactive SVG Tree Area */
.tree-container {
  flex: 1;
  background: hsl(210, 24%, 98%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
  position: relative;
}

.tree-placeholder {
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.tree-svg {
  cursor: grab;
}

.tree-svg:active {
  cursor: grabbing;
}

/* SVG Node and Line Styling */
.tree-node-card-bg {
  fill: var(--bg-card);
  stroke: var(--border-glass);
  stroke-width: 1.5px;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.04));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-node-card-title {
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  fill: var(--color-text-primary);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.tree-node-card-category {
  font-family: var(--font-family);
  font-size: 8px;
  font-weight: 500;
  fill: var(--color-text-muted);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.tree-link {
  fill: none;
  stroke-width: 2.5px;
  opacity: 0.75;
  transition: all 0.2s ease;
}

.node-clickable {
  cursor: pointer;
}
.node-clickable:hover .tree-node-card-bg {
  fill: var(--bg-card-hover);
  stroke: var(--color-sky-blue);
  filter: drop-shadow(0 6px 16px rgba(0, 127, 159, 0.12));
}
.node-clickable:hover .tree-node-card-title {
  fill: var(--color-sky-blue);
}

/* Overlay / Spinner */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  transition: opacity 0.3s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-glass);
  border-top-color: var(--color-sky-blue);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Recommendations & Warnings Panel
   ========================================================================== */
.recommendations-panel {
  padding: 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: hsla(25, 100%, 50%, 0.05);
}

.rec-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-sunset-orange);
  margin-bottom: 8px;
}

.rec-list {
  font-size: 13px;
  color: var(--color-text-secondary);
  padding-left: 20px;
}

.rec-list li {
  margin-bottom: 5px;
}

/* ==========================================================================
   Details dialog element
   ========================================================================== */
dialog {
  border: none;
  background: transparent;
  max-width: 900px;
  width: 90%;
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--color-text-primary); /* Override browser user-agent black text style */
}

dialog::backdrop {
  background: rgba(10, 15, 30, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-content {
  padding: 30px;
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
  width: 100%;
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.dialog-close, .chat-drawer-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-close:hover, .chat-drawer-close:hover {
  background: hsla(330, 99%, 30%, 0.08);
  color: var(--color-sunset-orange);
  transform: rotate(90deg);
}

.dialog-close .close-svg, .chat-drawer-close .close-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.dialog-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 15px;
  padding-right: 45px; /* Prevent overlap with the absolute close button */
}

.dialog-category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-sky-blue);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.dialog-header h2 {
  font-size: 28px;
  font-weight: 700;
}

.dialog-page-info {
  font-size: 12px;
  color: var(--color-text-muted);
}

.dialog-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 25px;
  width: 100%;
}

@media (max-width: 900px) {
  .dialog-body-grid {
    grid-template-columns: 1fr;
  }
}

.info-block {
  margin-bottom: 25px;
}

.info-block h3 {
  font-size: 15px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.prereq-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prereq-tag-btn {
  background: hsla(200, 100%, 50%, 0.1);
  border: 1px solid hsla(200, 100%, 50%, 0.2);
  color: var(--color-sky-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
}

.prereq-tag-btn:hover {
  background: hsla(200, 100%, 50%, 0.2);
}

.step-by-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: hsla(200, 95%, 43%, 0.04);
  border-left: 3px solid var(--color-sky-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 15px;
  font-size: 14px;
}

.step-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-sky-blue);
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Slider Section */
.rating-editor-box {
  background: hsl(210, 24%, 98%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.rating-slider-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.rating-slider-container input[type=range] {
  flex: 1;
  accent-color: var(--color-sunset-orange);
  cursor: pointer;
}

.rating-display {
  display: flex;
  align-items: baseline;
}

.rating-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-sunset-orange);
}

.rating-max {
  font-size: 14px;
  color: var(--color-text-muted);
}

.rating-status-desc {
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}

/* Warnings and Pro-tip Callout Boxes */
.warnings-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.warning-callout {
  border: 1px solid hsla(5, 80%, 50%, 0.2);
  background: hsla(5, 80%, 50%, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 13px;
}

.warning-callout strong {
  color: var(--color-glow-red);
  display: block;
  margin-bottom: 4px;
}

.tip-callout {
  border: 1px solid hsla(45, 100%, 50%, 0.2);
  background: hsla(45, 100%, 50%, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 13px;
}

.tip-callout strong {
  color: var(--color-glow-yellow);
  display: block;
  margin-bottom: 4px;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Sliding Chat Drawer
   ========================================================================== */
.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  z-index: 10000;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border-left: 1px solid var(--border-glass);
  border-top: none;
  border-right: none;
  border-bottom: none;
  box-shadow: -10px 0 30px hsla(222, 47%, 11%, 0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-card) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.chat-drawer.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  display: flex !important; /* Force flex for smooth slide transition */
}

.chat-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-glass);
}

.chat-drawer-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.chat-context-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: hsla(200, 95%, 43%, 0.1);
  color: var(--color-sky-blue);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Note: .chat-drawer-close is styled together with .dialog-close above */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
}

.message.instructor {
  align-self: flex-start;
  background: hsl(210, 24%, 94%);
  color: var(--color-text-primary);
  border-bottom-left-radius: 2px;
}

.message.user {
  align-self: flex-end;
  background: var(--color-sky-blue);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.message.system-error {
  align-self: center;
  max-width: 95%;
  background: hsla(5, 74%, 48%, 0.05);
  border: 1px solid hsla(5, 74%, 48%, 0.2);
  color: var(--color-glow-red);
  font-size: 12px;
  text-align: center;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-glass);
}

.suggestion-chip {
  background: hsl(210, 20%, 95%);
  border: 1px solid var(--border-glass);
  color: var(--color-text-secondary);
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.suggestion-chip:hover {
  background: var(--color-sky-blue);
  color: #ffffff;
  border-color: var(--color-sky-blue);
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 15px 20px 20px 20px;
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 13.5px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--color-sky-blue);
}

/* ==========================================================================
   Interactive Maneuver Animations Styling
   ========================================================================== */
.dialog-animation-wrapper {
  margin-bottom: 25px;
  width: 100%;
}

.animation-card {
  padding: 15px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}

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

.animation-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.animation-title h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-sunset-orange);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--color-sunset-orange);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px var(--color-sunset-orange); }
  100% { transform: scale(0.95); opacity: 0.5; }
}

.animation-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.camera-presets-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: hsla(210, 24%, 93%, 0.6);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
}

.controls-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 2px;
}

.controls-divider {
  color: var(--border-glass);
  font-weight: 300;
}

.btn-xs {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
}

.animation-container {
  position: relative;
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.maneuver-3d-container {
  width: 100%;
  height: 240px;
  display: block;
  cursor: grab;
}

.maneuver-3d-container:active {
  cursor: grabbing;
}

.3d-instruction-overlay {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--color-text-secondary);
  font-weight: 500;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-glass);
  z-index: 10;
}

.animation-telemetry {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
}

.telemetry-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.telemetry-val {
  color: var(--color-sky-blue);
  font-weight: 700;
}

.telemetry-val.accent {
  color: var(--color-sunset-orange);
}

.animation-explanation {
  margin-top: 10px;
  background: hsl(210, 24%, 96%);
  border-left: 3px solid var(--color-sky-blue);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 0 6px 6px 0;
  min-height: 40px;
}

/* ==========================================================================
   Learning Paths & Achievements
   ========================================================================== */
.dashboard-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.learning-paths-section {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.learning-paths-header {
  margin-bottom: 15px;
}

.learning-paths-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-sky-blue);
}

.learning-paths-subtitle {
  margin: 3px 0 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.learning-paths-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

@media (max-width: 768px) {
  .learning-paths-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Smartphone-Optimierung (Mobile-first Härtung)
   ========================================================================== */
html { overflow-x: hidden; } /* globaler Schutz gegen horizontalen Overflow */

@media (max-width: 600px) {
  .app-container { padding: 10px; }

  /* Header: umbrechen statt überlaufen */
  .main-header { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .main-header > div { flex-wrap: wrap; gap: 10px !important; }
  .header-logo { font-size: 20px; }
  .logo-tag { display: none; }
  #btnOpenGlobalChat { font-size: 13px; padding: 8px 12px; }
  .user-status-bar { flex-wrap: wrap; }

  /* Volle Breite, kein fixes Mehrspalten-Layout */
  .learning-paths-grid { grid-template-columns: 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; gap: 14px; }
  .category-filters { flex-wrap: wrap; }

  /* Detail-Dialog quasi-fullscreen */
  dialog#detailDialog .dialog-content { max-width: 100%; }
  .dialog-body-grid { grid-template-columns: 1fr !important; }
  .dialog-header { flex-direction: column; align-items: flex-start; }

  /* 3D-Panel: Steuerung umbrechen, Container niedriger, HUD verkleinern */
  .animation-controls { flex-wrap: wrap; gap: 6px; }
  .camera-presets-group { flex-wrap: wrap; }
  .maneuver-3d-container { height: 240px; }
  .pilot-hud-overlay { transform: scale(0.82); transform-origin: top right; }
  .animation-telemetry { flex-wrap: wrap; }

  /* Chat-Drawer volle Breite */
  .chat-drawer { width: 100% !important; max-width: 100%; }

  /* Tipp-Ziele groß genug (Touch) */
  .btn, .filter-btn, .tab-btn { min-height: 40px; }
}

/* ==========================================================================
   Lernpfad-Filter (A-Schein / Sicherheitstraining / Acro)
   ========================================================================== */
.learning-path-card.path-active {
  outline: 2px solid var(--color-sky-blue);
  outline-offset: 1px;
  background: var(--bg-card-hover);
}
.path-filter-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: hsla(192, 100%, 31%, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.path-filter-banner .btn-link { font-size: 12px; white-space: nowrap; }
.badge-acro { background: hsl(330, 99%, 30%); color: #fff; }
.badge-lizenz { background: var(--color-sky-blue); color: #fff; }

/* ==========================================================================
   Login / Auth — Freiflug-Stil: vollflächiges Foto-Hero + solide Auth-Säule
   ========================================================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr clamp(360px, 38vw, 480px);
  background: #f4f5f4;
  color: var(--color-text-primary);
}
.auth-screen.hidden { display: none; }

/* --- Hero --- */
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 3.5vw, 56px);
  color: #fff;
}
.auth-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 42%;
  transform: scale(1.04);
  animation: heroDrift 26s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes heroDrift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.12) translate3d(-1.5%, -1.5%, 0); }
}
@media (prefers-reduced-motion: reduce) { .auth-hero-bg { animation: none; } }
.auth-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(13, 22, 33, 0.62) 0%, rgba(13, 22, 33, 0.22) 42%, rgba(13, 22, 33, 0.05) 70%),
    linear-gradient(to top, rgba(13, 22, 33, 0.78) 0%, rgba(13, 22, 33, 0) 46%);
}
.auth-hero-top,
.auth-hero-copy { position: relative; z-index: 2; }

.auth-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.auth-wordmark {
  font-weight: 800;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: 0.5px;
}
.auth-wordmark .wm-bit { color: #fff; }
.auth-wordmark .wm-fly { color: var(--ff-gold); }
.auth-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.auth-hero-copy { max-width: 40ch; padding-bottom: 18px; }
.auth-headline {
  display: flex;
  flex-direction: column;
  line-height: 0.96;
  margin: 0 0 16px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.auth-headline .hl-thin { font-weight: 300; font-size: clamp(34px, 4.6vw, 62px); letter-spacing: -0.01em; }
.auth-headline .hl-bold { font-weight: 800; font-size: clamp(44px, 6vw, 82px); letter-spacing: -0.02em; }
.auth-hero-sub {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  max-width: 38ch;
}
.auth-wave {
  position: absolute;
  left: clamp(26px, 3.5vw, 56px);
  right: clamp(26px, 3.5vw, 56px);
  bottom: clamp(18px, 2.4vw, 34px);
  width: auto;
  height: 22px;
  z-index: 2;
  opacity: 0.9;
}

/* --- Auth-Säule --- */
.auth-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px) clamp(22px, 3vw, 44px);
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 348px; }

.auth-card .auth-tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 26px;
}
.auth-card .tab-btn {
  background: none;
  border: none;
  padding: 0 0 12px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease;
}
.auth-card .tab-btn:hover { color: var(--color-text-secondary); }
.auth-card .tab-btn.active { color: var(--color-sky-blue); border-bottom-color: var(--ff-gold); }

.auth-card .auth-form h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-sky-blue);
  margin: 0 0 6px;
}
.auth-card .auth-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0 0 22px;
}
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.auth-card .form-group input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-text-primary);
  background: #fff;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.auth-card .form-group input::placeholder { color: #aab4bd; }
.auth-card .form-group input:focus {
  outline: none;
  border-color: var(--color-sky-blue);
  box-shadow: 0 0 0 3px rgba(39, 68, 96, 0.14);
}
.auth-card .btn.full-width { width: 100%; margin-top: 6px; }
.auth-card .btn-primary {
  background: var(--color-sky-blue);
  color: #fff;
  border: none;
  padding: 13px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.auth-card .btn-primary:hover { background: var(--ff-blue-deep); }
.auth-card .btn-primary:active { transform: translateY(1px); }
.auth-foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- Mobile: Hero oben als Band, Formular darunter --- */
@media (max-width: 880px) {
  .auth-screen {
    grid-template-columns: 1fr;
    grid-template-rows: 40vh 1fr;
    overflow-y: auto;
  }
  .auth-hero { min-height: 0; }
  .auth-headline .hl-thin { font-size: clamp(28px, 9vw, 44px); }
  .auth-headline .hl-bold { font-size: clamp(36px, 12vw, 58px); }
  .auth-hero-sub { display: none; }
  .auth-col { align-items: flex-start; padding: 28px 22px 40px; }
}
@media (max-width: 480px) {
  .auth-screen { grid-template-rows: 33vh 1fr; }
  .auth-wave { display: none; }
}

.learning-path-card {
  padding: 15px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
}

.learning-path-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.65);
}

.path-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.path-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
}

.path-status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.path-status-locked {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.path-status-ready {
  background: hsla(192, 100%, 31%, 0.1);
  color: var(--color-sky-blue);
  border: 1px solid hsla(192, 100%, 31%, 0.25);
}

.path-status-completed {
  background: hsla(60, 99%, 30%, 0.1);
  color: var(--color-glow-green);
  border: 1px solid hsla(60, 99%, 30%, 0.25);
}

.path-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.path-progress-bar-outer {
  height: 6px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.path-progress-bar-inner {
  height: 100%;
  background: var(--color-sky-blue);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.path-progress-bar-inner.complete {
  background: var(--color-glow-green);
}

.path-progress-text {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

/* User status bar badges */
.achievements-display {
  display: inline-flex;
  gap: 6px;
  margin-right: 10px;
  align-items: center;
}

.achievement-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 10px rgba(153, 1, 78, 0.25);
  border: 1px solid rgba(153, 1, 78, 0.4);
  color: var(--color-sunset-orange);
  cursor: help;
  animation: badgeGlow 2s infinite ease-in-out;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(153, 1, 78, 0.2); }
  50% { box-shadow: 0 0 12px rgba(153, 1, 78, 0.55); border-color: rgba(153, 1, 78, 0.8); }
}

/* ==========================================================================
   Visual Cockpit HUD Overlay
   ========================================================================== */
.pilot-hud-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px;
  width: 175px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-indicators-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 60px;
  gap: 8px;
}

.hud-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.hud-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: center;
}

.hud-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 3px;
  font-family: monospace;
}

/* Vertical brake bars */
.hud-bar-outer {
  height: 38px;
  width: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.hud-bar-inner {
  width: 100%;
  background: var(--color-sky-blue);
  border-radius: 5px;
  position: absolute;
  bottom: 0;
  left: 0;
  transition: height 0.1s ease;
}

.hud-indicator.hud-brake-left .hud-bar-inner,
.hud-indicator.hud-brake-right .hud-bar-inner {
  background: var(--color-sunset-orange);
}

/* Horizontal weightshift box */
.hud-weightshift {
  flex: 1.4;
  justify-content: space-between;
  height: 100%;
}

.hud-weightshift-outer {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  position: relative;
  margin-bottom: 15px;
}

.hud-weightshift-marker {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  background: var(--color-sky-blue);
  border: 2px solid #ffffff;
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.1s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Horizontal speedbar */
.hud-speedbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-top: 1px solid var(--border-glass);
  padding-top: 6px;
}

.hud-speedbar .hud-label {
  margin-bottom: 0;
  width: 42px;
  text-align: left;
}

.hud-speedbar-outer {
  flex-grow: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.hud-speedbar-inner {
  height: 100%;
  background: var(--color-glow-green);
  border-radius: 3px;
  transition: width 0.1s ease;
}

.hud-speedbar .hud-value {
  margin-top: 0;
  min-width: 24px;
  text-align: right;
}

/* Wing deformation warning indicators */
.hud-wing-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-status-alarm {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 3px 5px;
  border-radius: 4px;
  background: hsla(330, 99%, 30%, 0.15);
  color: var(--color-sunset-orange);
  border: 1px solid rgba(153, 1, 78, 0.35);
  text-transform: uppercase;
  animation: alarmPulse 1.2s infinite ease-in-out;
}

@keyframes alarmPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Structure helper for indicators */
.hud-indicator.hud-brake-left,
.hud-indicator.hud-brake-right {
  display: flex;
  flex-direction: column;
}

.hud-indicator.hud-brake-left {
  align-items: flex-start;
}
.hud-indicator.hud-brake-right {
  align-items: flex-end;
}

/* Rearrange indicators inside HUD */
.pilot-hud-overlay {
  padding: 8px 10px;
}

/* Let's wrap indicators inside a row container */
.hud-indicators-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  align-items: flex-end;
  height: 52px;
  gap: 8px;
}

/* ==========================================================================
   Timeline Scrubber Bar
   ========================================================================== */
.scrubber-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: hsl(210, 24%, 96%);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  margin-top: 10px;
}

.scrubber-container input[type="range"] {
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.scrubber-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-sky-blue);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.scrubber-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--color-sunset-orange);
}

/* ==========================================================================
   Interactive Stepper card styling
   ========================================================================== */
.step-card {
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid var(--border-glass);
}

.step-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 127, 159, 0.3);
}

.step-card.active-step {
  border-color: var(--color-sunset-orange);
  background: hsla(330, 99%, 30%, 0.04);
  box-shadow: 0 0 12px rgba(153, 1, 78, 0.12);
}

.step-card.active-step::after {
  content: "▶";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-sunset-orange);
  font-size: 11px;
}

.icon-svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Size adjustments for headings */
h2 .icon-svg,
h3 .icon-svg,
h4 .icon-svg {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

/* ==========================================================================
   Admin-Bereich (Modal)
   ========================================================================== */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(13, 27, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.admin-overlay.hidden { display: none; }

.admin-modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: 0 24px 60px rgba(13, 27, 42, 0.35);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.admin-modal-header h3 {
  margin: 0;
  color: var(--color-sky-blue);
  font-weight: 700;
}
.admin-role-badge {
  margin-right: auto;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(249, 185, 0, 0.16);
  color: #9a7400;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-section {
  padding: 1.1rem 0;
  border-top: 1px solid rgba(39, 68, 96, 0.12);
}
.admin-section:first-of-type { border-top: none; }
.admin-section h4 {
  margin: 0 0 0.35rem;
  color: var(--color-sky-blue);
  font-weight: 700;
}
.admin-hint {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.82rem;
  color: rgba(39, 68, 96, 0.7);
  line-height: 1.4;
}

.admin-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.admin-row label,
.admin-note-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-sky-blue);
}
.admin-note-label { margin-bottom: 0.8rem; }
.admin-row input,
.admin-note-label input {
  padding: 0.5rem 0.65rem;
  border: 1.5px solid rgba(39, 68, 96, 0.2);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}
.admin-row input:focus,
.admin-note-label input:focus {
  outline: none;
  border-color: var(--ff-gold);
}

.admin-codes { margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-ok { width: 100%; margin: 0 0 0.2rem; font-size: 0.82rem; color: var(--color-glow-green); font-weight: 600; }
.admin-error { width: 100%; margin: 0.4rem 0 0; font-size: 0.82rem; color: #c0392b; font-weight: 600; }

.admin-code-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--ff-gold);
  border-radius: 10px;
  background: rgba(249, 185, 0, 0.08);
  color: var(--color-sky-blue);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.admin-code-chip:hover { background: rgba(249, 185, 0, 0.18); }
.admin-code-uses {
  font-family: var(--font-family, Raleway), sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(39, 68, 96, 0.6);
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-sky-blue);
  cursor: pointer;
}
.admin-toggle input { width: 18px; height: 18px; accent-color: var(--color-glow-green); cursor: pointer; }

/* Admin-Kennzahlen */
.admin-stats { display: flex; gap: 0.6rem; }
.admin-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.85rem 0.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-sky-blue) 0%, #1d3a57 100%);
  color: #fff;
}
.admin-stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--ff-gold); }
.admin-stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.9; text-align: center; }

/* Persönliche Notizen im Detail-Dialog */
.notes-editor-box {
  margin-top: 15px;
  padding: 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(39, 68, 96, 0.12);
  background: #fff;
}
.notes-editor-box h3 { margin: 0 0 4px; font-size: 15px; color: var(--color-sky-blue); font-weight: 700; }
.notes-hint { margin: 0 0 10px; font-size: 12px; color: rgba(39, 68, 96, 0.6); line-height: 1.4; }
.notes-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid rgba(39, 68, 96, 0.2);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  color: var(--color-text-primary);
}
.notes-textarea:focus { outline: none; border-color: var(--ff-gold); }
.notes-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.notes-status { font-size: 12px; font-weight: 600; color: var(--color-glow-green); }

@media (max-width: 540px) {
  .admin-modal { padding: 1.2rem 1.1rem 1.4rem; border-radius: 14px; }
  .admin-row { flex-direction: column; gap: 0.5rem; }
  .admin-stats { flex-wrap: wrap; }
  .admin-stat { min-width: 28%; }
}

/* ==========================================================================
   Design-Angleich an die Hero-Startseite (Petrol-Header + Gold-Akzente)
   ========================================================================== */
.main-header {
  background: linear-gradient(135deg, var(--color-sky-blue) 0%, #1d3a57 55%, #13283f 100%);
  border-bottom: 3px solid var(--ff-gold);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(19, 40, 63, 0.28);
  padding: 16px 26px;
}
.main-header .logo-bit { color: #ffffff; text-shadow: none; }
.main-header .logo-fly { color: var(--ff-gold); text-shadow: none; }
.main-header .logo-tag {
  color: rgba(255, 255, 255, 0.72);
  border-left-color: rgba(255, 255, 255, 0.28);
}
.main-header .username-display { color: rgba(255, 255, 255, 0.92); }
.main-header .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.main-header .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--ff-gold);
}
/* Abmelden-Button (btn-accent/secondary mit Logout) erbt obiges; Achievements hell. */
.main-header .achievement-badge { color: #ffffff; }

/* Sektions-Überschriften: Hero-Signatur (kräftiger + Gold-Akzentlinie). */
.learning-paths-header h3,
.section-title-bar h2 {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.learning-paths-header h3::after,
.section-title-bar h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  background: var(--ff-gold);
  border-radius: 2px;
}
