/* ============================================================
   KPS-Berlin – Features2 CSS
   Scroll-Fortschrittsbalken | Dark/Light-Mode | Skill-Chart
   Testimonials | Leaflet-Karte
   ============================================================ */

/* ============================================================
   LIGHT MODE – CSS Custom Properties Override
   ============================================================ */
[data-theme="light"] {
  --bg-base:        #f8fafc;
  --bg-surface:     #f1f5f9;
  --bg-elevated:    #ffffff;
  --bg-glass:       rgba(255, 255, 255, 0.85);
  --bg-glass-light: rgba(0, 0, 0, 0.03);

  --border:         rgba(0, 0, 0, 0.08);
  --border-hover:   rgba(0, 0, 0, 0.15);
  --border-accent:  rgba(99, 102, 241, 0.35);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-inverse:   #f8fafc;

  --accent:         #4f46e5;
  --accent-hover:   #4338ca;
  --accent-glow:    rgba(79, 70, 229, 0.2);
  --accent-subtle:  rgba(79, 70, 229, 0.08);

  --gradient-hero:  linear-gradient(135deg, #f0f4ff 0%, #e8eeff 50%, #f8fafc 100%);
  --gradient-card:  linear-gradient(145deg, rgba(255,255,255,.9) 0%, rgba(248,250,252,.8) 100%);

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);
}

/* Light-Mode spezifische Anpassungen */
[data-theme="light"] body {
  background: var(--bg-base);
  color: var(--text-primary);
}
[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.92);
  border-bottom-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .hero {
  background: var(--gradient-hero);
}
[data-theme="light"] .hero-grid {
  opacity: 0.3;
}
[data-theme="light"] .orb {
  opacity: 0.15;
}
[data-theme="light"] .glass-card {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
[data-theme="light"] .section-label {
  color: var(--accent);
}
[data-theme="light"] .stat-number {
  color: var(--accent);
}
[data-theme="light"] .info-section {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}
[data-theme="light"] .info-section .info-title,
[data-theme="light"] .info-section .info-text {
  color: #1e1b4b;
}
[data-theme="light"] .site-footer {
  background: #1e293b;
}
[data-theme="light"] .mobile-menu {
  background: rgba(248,250,252,0.98);
}
[data-theme="light"] .mobile-nav-link {
  color: #334155;
  border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .nav-link {
  color: #475569;
}
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: var(--accent);
}
[data-theme="light"] .hero-title,
[data-theme="light"] .hero-sub {
  color: #0f172a;
}
[data-theme="light"] .hero-sub {
  color: #475569;
}
[data-theme="light"] .section-title {
  color: #0f172a;
}
[data-theme="light"] .section-sub {
  color: #64748b;
}
[data-theme="light"] .card-number {
  color: rgba(79,70,229,0.15);
}
[data-theme="light"] .card-title {
  color: #0f172a;
}
[data-theme="light"] .card-text {
  color: #64748b;
}
[data-theme="light"] .preloader {
  background: #f8fafc;
}
[data-theme="light"] .preloader-text {
  color: var(--accent);
}
[data-theme="light"] .back-to-top {
  background: var(--accent);
}
[data-theme="light"] .nav-toggle span {
  background: #334155;
}

/* ============================================================
   DARK/LIGHT MODE TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--bg-elevated, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary, #94a3b8);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover {
  border-color: var(--border-accent, rgba(99,102,241,0.4));
  color: var(--accent, #6366f1);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* ============================================================
   SCROLL-FORTSCHRITTSBALKEN
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 50%, #a5b4fc 100%);
  z-index: 10000;
  transition: width 0.05s linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(99,102,241,0.6);
}
[data-theme="light"] .scroll-progress {
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
}

/* ============================================================
   SKILL-CHART SEKTION
   ============================================================ */
.skills-section {
  padding: 5rem 0;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}
.skills-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.skills-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 768px) {
  .skills-inner { grid-template-columns: 1fr; gap: 2rem; }
}
.skills-text-col {}
.skills-chart-col {}

/* Radar/Bar Chart Container */
.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.skill-bar-item {}
.skill-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}
.skill-bar-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.skill-bar-icon {
  width: 1.4rem;
  height: 1.4rem;
  background: var(--accent-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.skill-bar-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  min-width: 2.5rem;
  text-align: right;
  opacity: 0;
  transition: opacity 0.3s 0.5s;
}
.skill-bar-item.animated .skill-bar-pct { opacity: 1; }
.skill-bar-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.skill-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.skill-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 12px; height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 100px;
  filter: blur(3px);
}
/* Farbvarianten */
.skill-bar-fill.c-indigo  { background: linear-gradient(90deg, #6366f1, #818cf8); }
.skill-bar-fill.c-blue    { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.skill-bar-fill.c-cyan    { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.skill-bar-fill.c-green   { background: linear-gradient(90deg, #10b981, #34d399); }
.skill-bar-fill.c-violet  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.skill-bar-fill.c-pink    { background: linear-gradient(90deg, #ec4899, #f472b6); }
.skill-bar-fill.c-amber   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* Radar Chart (SVG-basiert) */
.radar-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
.radar-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  overflow: visible;
}
.radar-grid-line { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis-line { stroke: var(--border); stroke-width: 1; }
.radar-area {
  fill: rgba(99,102,241,0.15);
  stroke: #6366f1;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: d 1s ease;
}
.radar-dot {
  fill: #6366f1;
  r: 4;
}
.radar-label {
  font-family: var(--font-base);
  font-size: 10px;
  font-weight: 600;
  fill: var(--text-secondary);
  text-anchor: middle;
  dominant-baseline: middle;
}

/* ============================================================
   TESTIMONIALS / REFERENZ-SLIDER
   ============================================================ */
.testimonials-section {
  padding: 5rem 0;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.testimonials-section::before {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Slider Container */
.testimonials-slider {
  position: relative;
  overflow: hidden;
}
.testimonials-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.testimonial-slide {
  min-width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

/* Testimonial-Karte */
.testimonial-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 20px);
  padding: 2rem 2rem 1.75rem;
  position: relative;
  transition: border-color 0.3s;
  max-width: 720px;
  margin: 0 auto;
}
.testimonial-card:hover {
  border-color: var(--border-accent);
}
.testimonial-quote-icon {
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
  color: var(--accent);
  opacity: 0.2;
  font-size: 4rem;
  line-height: 1;
  font-family: Georgia, serif;
  font-weight: 700;
  user-select: none;
}
.testimonial-stars {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 1rem;
}
.testimonial-star {
  color: #f59e0b;
  font-size: 0.9rem;
}
.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.testimonial-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.testimonial-author-info {}
.testimonial-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}
.testimonial-author-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.testimonial-institute-badge {
  margin-left: auto;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Slider-Steuerung */
.testimonials-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
}
.slider-btn {
  width: 2.4rem;
  height: 2.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.slider-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-subtle);
}
.slider-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  padding: 0;
}
.slider-dot.active {
  width: 20px;
  border-radius: 100px;
  background: var(--accent);
}

/* Auto-play Indikator */
.slider-autoplay {
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 0.25rem;
}
.slider-autoplay:hover { color: var(--accent); border-color: var(--border-accent); }

/* ============================================================
   INTERAKTIVE KARTE (LEAFLET)
   ============================================================ */
.map-section {
  padding: 5rem 0;
  background: var(--bg-surface);
}
.map-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .map-wrapper { grid-template-columns: 1fr; }
}
.map-container {
  height: 520px;
  border-radius: var(--r-lg, 20px);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 640px) {
  .map-container { height: 360px; }
}

/* Leaflet Dark-Mode Override */
/* CartoDB Dark/Light Tiles werden direkt geladen – kein Filter nötig */
.leaflet-tile {
  filter: none;
}
.leaflet-container {
  background: var(--bg-elevated) !important;
  font-family: var(--font-base) !important;
}
.leaflet-popup-content-wrapper {
  background: #111827 !important;
  border: 1px solid rgba(99,102,241,0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  color: #f1f5f9 !important;
}
[data-theme="light"] .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  border-color: rgba(79,70,229,0.2) !important;
  color: #0f172a !important;
}
.leaflet-popup-tip {
  background: #111827 !important;
}
[data-theme="light"] .leaflet-popup-tip {
  background: #ffffff !important;
}
.leaflet-popup-content {
  margin: 0.85rem 1rem !important;
  font-family: var(--font-base) !important;
}
.map-popup-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent, #6366f1);
  margin-bottom: 0.2rem;
}
.map-popup-text {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.5;
}
[data-theme="light"] .map-popup-text { color: #64748b; }
.leaflet-control-zoom {
  border: 1px solid rgba(99,102,241,0.2) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  background: #111827 !important;
  color: #94a3b8 !important;
  border-color: rgba(99,102,241,0.15) !important;
}
[data-theme="light"] .leaflet-control-zoom a {
  background: #ffffff !important;
  color: #475569 !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(99,102,241,0.15) !important;
  color: #6366f1 !important;
}
.leaflet-attribution-flag { display: none !important; }
.leaflet-control-attribution {
  background: rgba(8,12,20,0.7) !important;
  color: #475569 !important;
  font-size: 0.65rem !important;
  backdrop-filter: blur(8px);
  border-radius: 6px 0 0 0 !important;
}
[data-theme="light"] .leaflet-control-attribution {
  background: rgba(255,255,255,0.8) !important;
}

/* Karten-Sidebar */
.map-sidebar {}
.map-info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 14px);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.map-info-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.map-region-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.map-region-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.map-region-item:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.map-region-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}
.map-region-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.map-stat-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  text-align: center;
}
.map-stat-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.map-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Custom Marker */
.custom-marker {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: transform 0.2s;
}
.custom-marker:hover {
  transform: rotate(-45deg) scale(1.15);
}
.custom-marker-inner {
  transform: rotate(45deg);
  font-size: 13px;
  line-height: 1;
}
.marker-berlin   { background: #6366f1; }
.marker-mol      { background: #10b981; }
.marker-hq       { background: #f59e0b; }

/* ============================================================
   RESPONSIVE ANPASSUNGEN
   ============================================================ */
@media (max-width: 640px) {
  .skills-section { padding: 3.5rem 0; }
  .testimonials-section { padding: 3.5rem 0; }
  .map-section { padding: 3.5rem 0; }
  .testimonial-card { padding: 1.5rem 1.25rem; }
  .testimonial-quote-icon { font-size: 2.5rem; top: 1rem; right: 1.25rem; }
  .testimonial-institute-badge { display: none; }
}
