/*
  ExplainingSpace – gemeinsames Look-and-Feel für alle Demos.
  Dieses File wird von jeder Demo per <link rel="stylesheet" href="../shared/style.css">
  eingebunden. Alle Werte liegen als CSS-Variablen (Custom Properties) vor, damit sie
  sich leicht überschreiben lassen – z.B. wenn eine Demo in eine bestehende Webseite
  eingebettet wird: dazu einfach NACH diesem Stylesheet ein eigenes CSS mit neuen
  Werten für die --es-* Variablen laden (auf :root gesetzt), ohne die Demo-Dateien
  selbst anfassen zu müssen.

  Die Farbgebung ist bewusst an das Schwester-Projekt "AstroRechner"
  (https://mkeller0815.github.io/AstroRechner/) angelehnt, damit beide Projekte
  von MiceInSpace Development ein wiedererkennbares, einheitliches Erscheinungsbild
  teilen (dunkles Marineblau, Cyan-Akzent, abgerundete Karten mit Schatten).
*/

:root {
  --es-bg: #1a1a2e;
  --es-bg-gradient: radial-gradient(ellipse at 50% -10%, #223056 0%, #1a1a2e 60%);
  --es-panel-bg: #16213e;     /* Karten-Ebene (Panels) */
  --es-panel-bg-2: #0f3460;   /* verschachtelte Elemente (Badges, Canvas-Rahmen) */
  --es-panel-border: #4cc9f0;
  --es-text: #e0e0e0;
  --es-text-dim: #aaaaaa;
  --es-muted-link: #6a9ab0;   /* Footer-Links, Sprachbuttons, Hilfe-Icons */
  --es-accent: #4cc9f0;
  --es-accent-hover: #4895ef;
  --es-accent-2: #f4c464;    /* Beobachter / Gold (demo-spezifisch) */
  --es-danger: #e0607a;
  --es-muted: #55637a;       /* nicht sichtbar / ausgeblendet (demo-spezifisch) */
  --es-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --es-radius: 15px;
  --es-radius-sm: 10px;
  --es-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --es-max-width: 1800px;
  /* Textgrößen der "So funktioniert's"-Seitenbox (von jeder Demo referenziert,
     z.B. .rz-side/.hr-side/.xo-side in der jeweiligen demo-eigenen style.css).
     Zentral hier anpassen, statt in jeder Demo einzeln zu ändern. */
  --es-side-heading-size: 1.05rem;
  --es-side-text-size: 0.92rem;
  --es-side-hint-size: 0.85rem;
}

.es-root {
  font-family: var(--es-font);
  color: var(--es-text);
  background: var(--es-bg-gradient);
  background-color: var(--es-bg);
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px 60px;
  box-sizing: border-box;
}

.es-container {
  max-width: var(--es-max-width);
  margin: 0 auto;
}

.es-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 4px;
}

.es-logo img {
  height: 180px;
  width: auto;
  border-radius: 8px;
  display: block;
  box-shadow: var(--es-shadow);
}

/* Logo verlinkt in den Demos zurück zur Startseite */
.es-logo a {
  display: block;
  line-height: 0;
  transition: opacity 0.15s ease;
}

.es-logo a:hover {
  opacity: 0.85;
}

.es-header-text {
  flex: 1;
  min-width: 0;
}

.es-header h1 {
  font-size: 1.6rem;
  margin: 0 0 6px;
  font-weight: 600;
}

.es-header p {
  color: var(--es-text-dim);
  margin: 0 0 20px;
  line-height: 1.5;
  max-width: 70ch;
}

.es-panel {
  background: var(--es-panel-bg);
  border: 1px solid var(--es-panel-border);
  border-radius: var(--es-radius);
  padding: 16px 18px;
  box-shadow: var(--es-shadow);
}

.es-panel + .es-panel {
  margin-top: 16px;
}

.es-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: center;
}

.es-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.es-control-group label {
  font-size: 0.8rem;
  color: var(--es-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.es-control-group input[type="range"] {
  accent-color: var(--es-accent);
  width: 160px;
}

.es-control-group input[type="checkbox"] {
  accent-color: var(--es-accent);
  width: 16px;
  height: 16px;
}

.es-select {
  background: var(--es-panel-bg-2);
  color: var(--es-text);
  border: 1px solid var(--es-panel-border);
  border-radius: var(--es-radius-sm);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  min-width: 120px;
}

.es-btn {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--es-text);
  background: var(--es-panel-bg-2);
  border: 1px solid var(--es-panel-border);
  border-radius: var(--es-radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

a.es-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.es-btn:hover {
  background: #163a63;
}

.es-btn:active {
  transform: translateY(1px);
}

.es-btn--accent {
  background: var(--es-accent);
  border-color: var(--es-accent);
  color: #1a1a2e;
  font-weight: 600;
}

.es-btn--accent:hover {
  background: var(--es-accent-hover);
}

.es-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.85rem;
  color: var(--es-text-dim);
  margin-top: 4px;
}

.es-readout strong {
  color: var(--es-text);
  font-variant-numeric: tabular-nums;
}

.es-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--es-text-dim);
  margin-top: 12px;
}

.es-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.es-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.es-footer-note {
  margin-top: 22px;
  font-size: 0.78rem;
  color: var(--es-muted);
  line-height: 1.5;
}

.es-canvas-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #000;
  border: 1px solid var(--es-panel-border);
  border-radius: var(--es-radius);
  box-shadow: var(--es-shadow);
  overflow: hidden;
}

.es-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

/* Sprachumschalter: kleine Flaggen-Buttons (analog zu AstroRechner) */
.es-lang-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.es-lang-btn {
  font-family: inherit;
  padding: 4px 10px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--es-muted-link);
  border: 1px solid var(--es-muted-link);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.es-lang-btn:hover,
.es-lang-btn.is-active {
  color: var(--es-accent);
  border-color: var(--es-accent);
}

/* Footer mit Link zum Info-/About-Overlay */
.es-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 14px;
  font-size: 0.8rem;
  color: var(--es-muted-link);
  border-top: 1px solid var(--es-panel-border);
}

.es-footer a {
  color: var(--es-muted-link);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.es-footer a:hover {
  color: var(--es-accent);
}

/* About-/Info-Overlay mit Projekt- und MiceInSpace-Logo */
.es-about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.es-about-overlay.is-visible {
  display: flex;
}

.es-about-box {
  background: var(--es-panel-bg);
  border: 2px solid var(--es-accent);
  border-radius: var(--es-radius);
  padding: 30px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--es-shadow);
  position: relative;
}

.es-about-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.es-about-logos img {
  height: 120px;
  width: auto;
  max-width: 45%;
  object-fit: contain;
  border-radius: 8px;
}

.es-about-box h2 {
  color: var(--es-accent);
  margin: 0 0 15px;
  font-size: 1.2rem;
}

.es-about-box p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #ccc;
  margin: 0 0 12px;
}

.es-about-meta {
  font-size: 0.85rem;
  color: var(--es-text-dim);
  margin-bottom: 8px;
}

.es-about-meta span {
  color: var(--es-accent);
}

.es-about-github {
  display: inline-block;
  margin-top: 5px;
  color: var(--es-accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.es-about-github:hover {
  text-decoration: underline;
}

.es-about-close-btn {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: var(--es-accent);
  color: #1a1a2e;
  border: none;
  border-radius: var(--es-radius-sm);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.es-about-close-btn:hover {
  background: var(--es-accent-hover);
}

/* Karten-Übersicht (z.B. Demo-Liste auf der Startseite) */
.es-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.es-demo-card {
  background: var(--es-panel-bg-2);
  border: 1px solid var(--es-panel-border);
  border-radius: var(--es-radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.es-demo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--es-shadow);
}

.es-demo-card h3 {
  margin: 0;
  color: var(--es-accent);
  font-size: 1.05rem;
}

.es-demo-card p {
  margin: 0;
  color: var(--es-text-dim);
  font-size: 0.85rem;
  line-height: 1.55;
  flex: 1;
}

@media (max-width: 560px) {
  .es-header {
    flex-direction: column;
  }
}
