/* ==========================================
   BIOLOGIE APP – main.css
   Reset, Base Styles, Layout
   ========================================== */

@import url('dark-theme.css?v=4cd70b4d7d3cd0850190ce98d46305a8fa1c4ffdb403af620ec80bdde9b83654');
@import url('components.css?v=937ac7ff4f5991d2bc86e8307bfe451988e8e8f71d14ac87871365b34f092ab9');
@import url('animations.css?v=ba9f4c728ef1e16da9fa0236c7a5580c9fa46b777c1f392297e4cf616d9bb2d8');
@import url('ipad.css?v=7f3fddad0473d3aff0684a74abcea17b146d97aae10b1ae94392694dfb90b4b0');

/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  /* Kein Scrollen der Seite wenn Drag&Drop aktiv */
  touch-action: pan-y;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ===== SELEKTIERBARER TEXT ===== */
p,
h1,
h2,
h3,
h4,
h5,
h6,
.selectable {
  user-select: text;
  -webkit-user-select: text;
}

/* ===== TYPOGRAFIE BASIS ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
}
h4 {
  font-size: var(--text-xl);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--text-link);
  text-decoration: none;
}

/* ===== APP SHELL ===== */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
  padding-top: var(--safe-top);
}

/* ===== HAUPT-CONTENT BEREICH ===== */
#page-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  animation: pageFadeIn var(--duration-normal) var(--ease-out);
}

/* ===== BOTTOM NAVIGATION ===== */
#bottom-nav {
  position: fixed;
  bottom: var(--safe-bottom);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-8));
  max-width: 600px;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-4);
  z-index: 100;
  box-shadow: var(--shadow-xl);
  margin-bottom: var(--space-3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-in-out),
    transform var(--duration-fast) var(--ease-spring);
  min-width: 64px;
  border: none;
  background: transparent;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.nav-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  transition: color var(--duration-fast);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-item.active .nav-label {
  color: var(--eco-primary);
  font-weight: var(--font-semibold);
}

.nav-item.active[data-topic='gesundheit'] .nav-label {
  color: var(--health-primary);
}

.nav-item.active[data-topic='entwicklung'] .nav-label {
  color: var(--sex-primary);
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: var(--space-6);
  transition: opacity var(--duration-slow) var(--ease-out);
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-size: var(--text-5xl);
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-black);
  color: var(--eco-primary);
  letter-spacing: -0.5px;
}

.loading-bar-wrapper {
  width: 200px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--eco-primary), var(--health-primary));
  border-radius: var(--radius-full);
  animation: loadingProgress 1.8s var(--ease-out) forwards;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  top: calc(var(--safe-top) + var(--space-4));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 500;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastSlideIn var(--duration-normal) var(--ease-spring);
  max-width: 320px;
}

.toast.success {
  border-color: var(--success);
}
.toast.error {
  border-color: var(--error);
}
.toast.xp {
  border-color: var(--xp-gold);
}

.toast.removing {
  animation: toastSlideOut var(--duration-normal) var(--ease-in-out) forwards;
}

/* ===== XP POPUP ===== */
.xp-popup {
  position: fixed;
  font-size: var(--text-xl);
  font-weight: var(--font-black);
  color: var(--xp-gold);
  text-shadow: 0 0 20px var(--xp-gold-glow);
  pointer-events: none;
  z-index: 400;
  animation: xpFloat 1.2s var(--ease-out) forwards;
}

/* ===== BADGE OVERLAY ===== */
#badge-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

#badge-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.badge-popup-card {
  background: var(--bg-secondary);
  border: 1px solid var(--xp-gold);
  border-radius: var(--radius-2xl);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  max-width: 360px;
  box-shadow:
    0 0 60px var(--xp-gold-glow),
    var(--shadow-xl);
  animation: badgePopIn var(--duration-slower) var(--ease-spring);
}

.badge-popup-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: var(--space-4);
  animation: badgeSpin 0.6s var(--ease-spring) 0.3s both;
}

.badge-popup-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-black);
  color: var(--xp-gold);
  margin-bottom: var(--space-2);
}

.badge-popup-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* ===== CANVAS DREI.JS ===== */
.three-canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--canvas-bg);
  border: 1px solid var(--border-subtle);
}

.three-canvas-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ===== HOTSPOTS 3D OVERLAY ===== */
.hotspots-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 15;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hotspot-dot {
  width: 22px;
  height: 22px;
  background: rgba(0, 229, 255, 0.25);
  border: 2px solid #00e5ff;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
}

.hotspot-dot::after {
  content: '';
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #00e5ff;
  position: absolute;
  top: -2px;
  left: -2px;
  animation: hotspot-pulse 2s infinite ease-out;
  opacity: 0;
  pointer-events: none;
}

.hotspot-inner {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
}

.hotspot:hover .hotspot-dot {
  background: rgba(0, 229, 255, 0.55);
  border-color: #ffffff;
  transform: scale(1.15);
}

.hotspot-tooltip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  width: 200px;
  padding: var(--space-2) var(--space-3);
  background: rgba(8, 12, 16, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 229, 255, 0.15);
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}

.hotspot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(8, 12, 16, 0.85);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hotspot.active .hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.hotspot-title {
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
  color: #00e5ff;
  margin-bottom: 2px;
}

.hotspot-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.hotspot.occluded {
  opacity: 0.15;
  pointer-events: none;
}

@keyframes hotspot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

/* ===== SECTION HEADERS ===== */
.section-header {
  margin-bottom: var(--space-6);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-black);
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

/* ===== DIVIDER ===== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-6) 0;
}

/* ===== UTILITY KLASSEN ===== */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.hidden {
  display: none !important;
}
.invisible {
  visibility: hidden;
}
.full-width {
  width: 100%;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}

/* ===== NEON TEXT HILFKLASSEN ===== */
.text-eco {
  color: var(--eco-primary);
}
.text-health {
  color: var(--health-primary);
}
.text-sex {
  color: var(--sex-primary);
}
.text-gold {
  color: var(--xp-gold);
}
.text-muted {
  color: var(--text-muted);
}
