/* Font Face */
@font-face {
  font-family: 'DinProBold';
  src: url('../fonts/DINPRO-BOLD.woff') format('woff'),
       url('../fonts/DINPRO-BOLD.OTF') format('opentype');
  font-weight: bold;
  font-style: normal;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw;
  height: 100vh;
  position: fixed;
  overflow: hidden;
  background: #000;
  font-family: 'DinProBold', Arial, sans-serif;
  color: #fff;
}

/* Three.js Container */
#solar-system-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #000;
}

#canvas {
  display: block;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* UI Overlay */
.ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100; /* Über dem Canvas */
}

.ui-overlay > * {
  pointer-events: auto;
}

/* Skip Intro Button */
.btn-skip-intro {
  position: absolute;
  bottom: 6.2em;
  right: 3em;
  padding: 0.6em 1.3em 0.7em 1.3em;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3em;
  color: white;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 200;
}

.btn-skip-intro:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* Time Controls */
.time-controls {
  position: absolute;
  top: 5em;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 1em;
  padding: 1em 2em;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3em;
  z-index: 150;
  pointer-events: auto;
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.btn-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 0.5em;
  padding: 0;
  background-color: transparent;
  border: none;
  color: #fff;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 15.6px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.3s ease;
  text-decoration: none;
  line-height: 1.1;
  vertical-align: middle;
}

.btn-time:hover {
  opacity: 0.7;
}

.btn-time svg {
  width: 0.9em;
  height: 0.9em;
  margin-top: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

.btn-time svg polygon {
  fill: white;
}

.btn-time.btn-backward svg {
  margin-right: 0.5em;
}

.btn-time.btn-backward {
  margin-right: 0;
}

.btn-time.btn-forward {
  margin-left: 0;
}

.btn-time.btn-pause {
  margin-left: 0;
}

.btn-time.btn-fullscreen {
  margin-left: 0;
  padding: 0.5em 0 0.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-time.btn-fullscreen svg {
  width: 1em;
  height: 1em;
  stroke: white;
}

.speed-indicator {
  display: inline-block;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 15.6px;
  font-weight: bold;
  color: #ffffff;
  min-width: 3em;
}

/* Time Scale Slider (inline) */
.time-controls input[type="range"] {
  width: 150px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  align-self: center;
  vertical-align: middle;
}

.time-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #E2007E;
  border-radius: 50%;
  cursor: pointer;
}

.time-controls input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #E2007E;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.time-controls span#timeScaleValue {
  color: white;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  min-width: 2.5em;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}


/* Planet Navigation */
#planet-nav {
  position: absolute;
  bottom: 5em;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 100%;
  padding: 0 1em;
  z-index: 150;
  pointer-events: auto;
}

.btn-planet {
  padding: 0.6em 1.3em 0.7em 1.3em;
  background-color: #E2007E;
  border: none;
  border-radius: 3em;
  color: white;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-transform: capitalize;
  margin: 0.2em 0.3em;
}

.btn-planet:hover {
  background-color: #ff0a8f;
}

.btn-planet:disabled,
.btn-planet.active {
  background-color: #000000;
  cursor: default;
}

.btn-planet-white {
  background-color: #ffffff;
  color: #000000;
}

.btn-planet-white:hover:not(.active) {
  background-color: #f0f0f0;
}

.btn-planet-white:disabled,
.btn-planet-white.active {
  background-color: #000000 !important;
  color: #ffffff !important;
  cursor: default;
}

.btn-planet-white.active:hover {
  background-color: #000000;
}

.disclaimer {
  width: 100%;
  text-align: center;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}

/* Planet Tags werden jetzt in Three.js gerendert */

/* Info Tab Button (im time-controls) - Erbt alle Styles von .btn-time */

/* Info Text Box */
#wrapper {
  position: absolute;
  top: calc(5em + 90px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: 550px;
  max-height: 70vh;
  padding: 2em;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1.5em;
  overflow-y: auto;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 200;
}

#wrapper.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#wrapper h1 {
  color: #ffffff;
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 24px;
  margin: 0 0 15px 0;
  font-weight: bold;
  border: none;
}

#wrapper p {
  color: rgba(255, 255, 255, 0.85);
  font-family: 'DinProBold', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  text-align: justify;
  border: none;
}

/* Footer */
footer {
  position: absolute;
  bottom: 2em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  text-align: center;
  font-family: 'DinProBold', Arial, sans-serif;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

footer a:hover {
  color: #E2007E;
}

/* Touch-optimierte Buttons */
@media (hover: none) and (pointer: coarse) {
  /* Größere Touch-Targets für Mobile */
  .btn-planet {
    padding: 0.8em 1.5em;
    font-size: 14px;
    min-height: 44px; /* iOS Touch-Target Empfehlung */
  }
  
  .btn-skip-intro {
    min-height: 44px;
    min-width: 120px;
  }
  
  .btn-time {
    padding: 0.5em;
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Entferne Hover-Effekte auf Touch */
  .btn-planet:hover {
    background-color: #E2007E;
  }
  
  .btn-planet-white:hover:not(.active) {
    background-color: #ffffff;
  }
  
  .btn-planet-white.active {
    background-color: #000000 !important;
    color: #ffffff !important;
  }
  
  .btn-planet-white.active:hover {
    background-color: #000000;
  }
  
  .btn-skip-intro:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: none;
  }
  
  /* Active State für Touch-Feedback */
  .btn-planet:active {
    background-color: #ff0a8f;
    transform: scale(0.95);
  }
  
  .btn-skip-intro:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .time-controls {
    top: 15px;
    padding: 10px 1em;
    gap: 0.4em;
    flex-wrap: nowrap;
    align-items: center;
    max-width: calc(100vw - 2em); /* Maximal-Breite mit etwas Abstand zu den Seiten */
    width: auto;
  }

  .btn-time {
    align-self: center;
    white-space: nowrap;
    vertical-align: middle;
  }
  
  .time-controls input[type="range"] {
    align-self: center;
    vertical-align: middle;
  }
  
  .time-controls span#timeScaleValue {
    align-self: center;
    vertical-align: middle;
  }

  .btn-time svg {
    width: 0.9em;
    height: 0.9em;
  }
  
  .time-controls input[type="range"] {
    align-self: center;
    width: 100px;
    flex-shrink: 0;
  }
  
  .time-controls span#timeScaleValue {
    align-self: center;
    min-width: 2em;
  }

  #planet-nav {
    /* bottom: 15px; */
    gap: 6px;
  }

  .btn-planet {
    padding: 6px 12px;
    font-size: 10px;
  }
  
  .time-controls {
    gap: 0.3em;
  }
  
  .btn-time {
    font-size: 11px;
    padding: 8px 12px;
  }
  
  .time-controls input[type="range"] {
    width: 80px;
  }
  
  .time-controls span#timeScaleValue {
    font-size: 11px;
  }
  
  .btn-skip-intro {
    bottom: 6em;
    right: 1.5em;
    font-size: 12px;
    padding: 0.6em 1.2em;
  }
  
  /* Info Box auf Tablet/Mobile */
  .info-tab {
    min-height: 44px;
    min-width: 44px;
  }
  
  #wrapper {
    top: calc(15px + 90px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: calc(100vw - 30px);
    max-width: 500px;
    max-height: 60vh;
    padding: 1.5em;
  }
  
  #wrapper.active {
    transform: translateX(-50%) translateY(0);
  }

  #wrapper h1 {
    font-size: 1.3em;
    margin-bottom: 10px;
  }

  #wrapper p {
    font-size: 0.85em;
    line-height: 1.5;
  }
}
