/*
  ========================================================================
  schaefer.zone – Virtual Laboratory Stylesheet
  Theme: Dark PCB / Circuit Board with Glassmorphism
  ========================================================================
*/

/* ============================================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================================ */
:root {
  /* Core Colors - Dark PCB Theme */
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1321;
  --bg-tertiary: #111827;
  --bg-surface: rgba(15, 23, 42, 0.8);
  
  /* Accent Colors - Gold/Copper Circuit Traces */
  --accent-primary: #f59e0b;
  --accent-secondary: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  
  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Glass Effect */
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(148, 163, 184, 0.15);
  --glass-blur: 20px;
  
  /* PCB Colors */
  --pcb-green: #1a472a;
  --pcb-trace: #c4a000;
  --pcb-via: #ff9500;
  --pcb-pad: #d4a574;
  
  /* Spacing */
  --section-padding: 120px;
  --container-max: 1280px;
  
  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Langsameres, kontrollierteres Scrollen */
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  /* Sanfteres Scroll-Verhalten */
  scroll-padding-top: 80px;
}

/* Selection */
::selection {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

/* Links */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================================
   THREE.JS CANVAS BACKGROUND
   ============================================================ */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: auto; /* Allow interaction with 3D scene */
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-cube {
  width: 80px;
  height: 80px;
  position: relative;
  transform-style: preserve-3d;
  animation: loaderRotate 2s infinite ease-in-out;
  margin: 0 auto 30px;
}

.cube-face {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid var(--accent-primary);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
}

.cube-face.front { transform: translateZ(40px); }
.cube-face.back { transform: rotateY(180deg) translateZ(40px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(40px); }
.cube-face.right { transform: rotateY(90deg) translateZ(40px); }
.cube-face.top { transform: rotateX(90deg) translateZ(40px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(40px); }

@keyframes loaderRotate {
  0%, 100% { transform: rotateX(-30deg) rotateY(0deg); }
  50% { transform: rotateX(-30deg) rotateY(180deg); }
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.loader-progress {
  width: 200px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out forwards;
}

@keyframes loadingProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ============================================================
   VR BUTTON
   ============================================================ */
#vr-button {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

#vr-button.visible {
  opacity: 1;
  visibility: visible;
}

#vr-button:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

#vr-button svg {
  width: 24px;
  height: 24px;
}

#vr-button.hidden-vr {
  display: none;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 10px 0;
  background: rgba(10, 14, 23, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.logo-text .accent {
  color: var(--accent-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px;
    gap: 16px;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

.hero-content {
  max-width: 800px;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  margin-bottom: 32px;
  animation: fadeInUp 0.8s ease forwards;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease 0.1s forwards;
  opacity: 0;
}

.title-line {
  display: block;
}

.title-line.accent {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease 0.3s forwards;
  opacity: 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-primary);
  display: inline;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-primary);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--glass-border);
}

/* Hero CTA Buttons */
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  border: none;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px var(--accent-glow);
  color: var(--bg-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-primary);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bounce 2s infinite;
}

.scroll-indicator span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   SECTIONS COMMON
   ============================================================ */
.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-section {
  padding: var(--section-padding) 0;
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
}

.project-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.05) 0%,
    transparent 50%,
    rgba(6, 182, 212, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px var(--accent-glow);
}

.project-card:hover::before {
  opacity: 1;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(245, 158, 11, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.project-card:hover .card-glow {
  opacity: 1;
}

.featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-content {
  position: relative;
  z-index: 1;
}

.project-icon {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s ease;
}

.project-card:hover .project-icon img {
  transform: scale(1.1) rotate(3deg);
}

.project-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.project-tagline {
  font-size: 14px;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  font-weight: 500;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 6px;
}

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

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.project-link svg {
  width: 16px;
  height: 16px;
}

.project-link:hover {
  color: var(--accent-secondary);
  gap: 10px;
}

/* Featured Card Special Style */
.project-card.featured {
  grid-column: span 1;
  border-color: rgba(245, 158, 11, 0.25);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.05) 0%,
    var(--glass-bg) 50%,
    rgba(6, 182, 212, 0.03) 100%
  );
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .project-card.featured {
    grid-column: span 1;
  }
}

/* ============================================================
   ABOUT SECTION – FLOWCHART STYLE
   ============================================================ */
.about-section {
  padding: var(--section-padding) 0;
  position: relative;
}

.flowchart-container {
  max-width: 900px;
  margin: 0 auto 48px;
}

.flowchart-node {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  transition: all 0.3s ease;
}

.flowchart-node:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: scale(1.02);
}

.flowchart-node.start,
.flowchart-node.end {
  border-radius: 100px;
  border-width: 2px;
}

.flowchart-node.start {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.flowchart-node.end {
  border-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.08);
}

.flowchart-node.decision {
  border-style: dashed;
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
  transform: rotate(0deg);
}

.node-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.flowchart-node h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.flowchart-node p {
  font-size: 13px;
  color: var(--text-secondary);
}

.flowchart-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 24px 0;
}

.flowchart-operator {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
}

.flowchart-arrow {
  text-align: center;
  font-size: 24px;
  color: var(--text-muted);
  margin: 8px 0;
  animation: arrowPulse 1.5s infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(4px); }
}

.about-text {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
}

.about-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-text strong {
  color: var(--text-primary);
}

/* ============================================================
   TECH STACK SECTION – ER DIAGRAM STYLE
   ============================================================ */
.techstack-section {
  padding: var(--section-padding) 0;
  position: relative;
}

.er-diagram {
  display: grid;
  grid-template-columns: 280px auto 280px;
  gap: 24px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.er-entity {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.er-entity:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-4px);
}

.core-entity {
  grid-column: 1 / -1;
  border-color: var(--accent-primary);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.08) 0%,
    var(--glass-bg) 100%
  );
}

.entity-header {
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-key {
  font-size: 18px;
}

.entity-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.entity-attributes {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attr {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.attr.primary {
  border-left-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.attr:hover {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--accent-primary);
  padding-left: 16px;
}

.er-relation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  min-width: 80px;
}

.relation-diamond {
  font-size: 28px;
  color: var(--accent-cyan);
  animation: diamondSpin 4s linear infinite;
}

@keyframes diamondSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.relation-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  writing-mode: vertical-lr;
  text-orientation: mixed;
  margin-top: 8px;
}

/* ER Diagram Responsive */
@media (max-width: 768px) {
  .er-diagram {
    grid-template-columns: 1fr;
  }
  
  .er-relation {
    flex-direction: row;
    min-height: 40px;
  }
  
  .relation-label {
    writing-mode: horizontal-tb;
    margin-top: 0;
    margin-left: 8px;
  }
}

/* ============================================================
   IMPRESSUM / FOOTER
   ============================================================ */
.impressum-section {
  padding: 80px 0 40px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.3) 0%,
    transparent 100%
  );
  border-top: 1px solid var(--glass-border);
}

.impressum-content {
  max-width: 900px;
  margin: 0 auto;
}

.impressum-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 36px;
  text-align: center;
  color: var(--text-primary);
}

.impressum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.impressum-block {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
}

.impressum-block h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.impressum-block p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.impressum-block a {
  color: var(--accent-cyan);
}

.private-note {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

.impressum-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

.impressum-footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.impressum-footer a {
  color: var(--accent-cyan);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .flowchart-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .flowchart-operator {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 38px;
  }

  .stat-number {
    font-size: 26px;
  }

  .project-card {
    padding: 24px;
  }
}

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* PCB Trace Decorations */
.pcb-trace {
  position: absolute;
  background: var(--pcb-trace);
  opacity: 0.15;
  pointer-events: none;
}

.pcb-trace.horizontal {
  height: 2px;
  width: 100px;
}

.pcb-trace.vertical {
  width: 2px;
  height: 100px;
}

/* Glow Effects on Scroll */
.glow-on-scroll {
  transition: box-shadow 0.3s ease;
}

.glow-on-scroll.in-view {
  box-shadow: 
    0 0 30px var(--accent-glow),
    inset 0 0 30px rgba(245, 158, 11, 0.03);
}

/* ============================================================
   THEME SWITCHER (Floating Right)
   ============================================================ */
.theme-switcher {
  position: fixed;
  top: 280px; /* Weiter nach unten, hinter der Navbar */
  right: 20px;
  transform: translateY(-50%);
  z-index: 900; /* Unter der Navbar (1000), aber über dem Content */
  font-family: var(--font-body);
}

/* Toggle Button */
.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--accent-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 0 0 rgba(245, 158, 11, 0);
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--accent-primary);
  box-shadow: 
    0 4px 25px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(245, 158, 11, 0.2);
}

.theme-toggle.active {
  border-color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.15);
  transform: rotate(45deg) scale(1.05);
}

.theme-icon {
  width: 22px;
  height: 22px;
}

/* Theme Panel */
.theme-panel {
  position: absolute;
  top: 58px; /* Abstand unter dem Toggle Button */
  right: 0;
  width: 340px; /* Breiter für mehr Platz */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(10, 14, 23, 0.98);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 0, 0, 0.3);
}

.theme-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

/* Panel Header */
.theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 23, 0.98);
  border-radius: 16px 16px 0 0;
  z-index: 1;
}

.theme-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Theme List */
.theme-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual Theme Item */
.theme-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.theme-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-item.active {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-primary);
}

.theme-item.active .theme-name {
  color: var(--accent-primary);
}

/* Theme Color Preview */
.theme-preview {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.theme-preview-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s ease;
}

.theme-item:hover .theme-preview-dot {
  transform: scale(1.1);
}

/* Theme Name & Description */
.theme-info {
  flex: 1;
  min-width: 0;
}

.theme-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active Indicator */
.theme-active-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-item.active .theme-active-indicator {
  opacity: 1;
  animation: themePulse 1.5s infinite;
}

@keyframes themePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* Mobile Responsive for Theme Switcher */
@media (max-width: 768px) {
  .theme-switcher {
    position: fixed;
    top: auto;
    bottom: 100px;
    right: 16px;
    transform: none;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .theme-panel {
    bottom: 56px;
    top: auto;
    right: -10px;
    width: calc(100vw - 32px);
    max-height: 60vh;
    transform: translateY(20px) scale(0.95);
  }

  .theme-panel.open {
    transform: translateY(0) scale(1);
  }
}

/* Scrollbar Styling for Theme Panel */
.theme-panel::-webkit-scrollbar {
  width: 6px;
}

.theme-panel::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.theme-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.theme-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   SWITCHER TABS (Themes / Rooms)
   ============================================================ */
.switcher-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--glass-border);
}

.switcher-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px 10px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.switcher-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.switcher-tab.active {
  color: var(--accent-primary);
  background: rgba(245, 158, 11, 0.08);
}

/* Tab Content */
.tab-content {
  display: none;
  padding: 12px;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   ROOM LIST
   ============================================================ */
.room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual Room Item */
.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.room-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left 0.5s ease;
}

.room-item:hover::before {
  left: 100%;
}

.room-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(6, 182, 212, 0.3);
  transform: translateX(4px);
}

.room-item.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 
    0 0 20px rgba(6, 182, 212, 0.15),
    inset 0 0 20px rgba(6, 182, 212, 0.05);
}

.room-item.active .room-name {
  color: var(--accent-cyan);
}

/* Room Thumbnail */
.room-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1f2e 0%, #2a3447 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
}

.room-item:hover .room-thumb {
  transform: scale(1.05) rotate(3deg);
  border-color: rgba(6, 182, 212, 0.3);
}

.room-item.active .room-thumb {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Room Info */
.room-info {
  flex: 1;
  min-width: 0;
}

.room-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.room-size {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Active Indicator for Rooms */
.room-active-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.room-item.active .room-active-indicator {
  opacity: 1;
  animation: roomPulse 1.5s infinite;
}

@keyframes roomPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
}

/* Room Loading State */
.room-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Camera Controls (Sliders) */
.camera-controls {
  padding: 12px;
}

.camera-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.slider-group label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 85px;
  font-weight: 500;
}

.camera-slider {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.camera-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(94, 173, 201, 0.4);
  transition: transform 0.15s ease;
}

.camera-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.camera-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(94, 173, 201, 0.4);
}

.slider-value {
  min-width: 32px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.slider-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 14px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.camera-reset-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  font-size: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.camera-reset-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-primary);
}

/* Mobile Responsive for Tabs */
@media (max-width: 768px) {
  .switcher-tabs {
    padding: 10px 10px 0;
  }
  
  .switcher-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .room-item {
    padding: 12px;
  }
  
  .room-thumb {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

/* ============================================================
   LICHT-STEUERUNG PANEL
   ============================================================ */
.light-control {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
  padding: 16px;
  z-index: 1000;
  min-width: 200px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(245, 158, 11, 0.08);
  font-family: 'Inter', -apple-system, sans-serif;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.light-control:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(245, 158, 11, 0.15);
}

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

.light-icon {
  font-size: 18px;
  line-height: 1;
}

.light-label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.time-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-badge.manual {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.light-info {
  color: var(--text-muted);
  font-size: 11px;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.brightness-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #1e293b 0%, #f59e0b 50%, #fef3c7 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-bottom: 8px;
}

.brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.brightness-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.7);
}

.brightness-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

#brightness-value {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 13px;
  min-width: 40px;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .light-control {
    bottom: 12px;
    left: 12px;
    right: 12px;
    min-width: auto;
    padding: 12px;
  }
  
  .light-label {
    font-size: 13px;
  }
  
  .light-info {
    font-size: 10px;
  }
}
