/* Data Science Exploratorium – shared styles */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:            #111111;
  --panel-bg:      rgba(255, 255, 255, 0.1);
  --panel-blur:    blur(10px);
  --panel-shadow:  0 8px 32px rgba(0, 0, 0, 0.4);
  --panel-radius:  12px;
  --panel-border:  rgba(255, 255, 255, 0.15);
  --panel-width:   260px;
  --sidebar-width: 300px;

  --text:          #dddddd;
  --text-muted:    rgba(255, 255, 255, 0.55);
  --border:        rgba(255, 255, 255, 0.15);

  --btn-bg:        rgba(255, 255, 255, 0.15);
  --btn-border:    rgba(255, 255, 255, 0.3);
  --btn-hover:     rgba(255, 255, 255, 0.25);
  --btn-active:    rgba(255, 255, 255, 0.35);
  --btn-disabled:  rgba(255, 255, 255, 0.05);

  --color-green:   #6BCB77;
  --color-blue:    #4D96FF;
  --color-red:     #FF6B6B;
  --color-yellow:  #FFD93D;
  --color-purple:  #845EC2;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

canvas { display: block; }

/* ── Control panel – floating box ───────────────────────── */
.controls {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: var(--panel-width);
  padding: 16px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Control panel – full-height sidebar ────────────────── */
.controls.sidebar {
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
  max-height: none;
  overflow-y: auto;
}

/* ── Buttons ────────────────────────────────────────────── */
button {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 36px;
}
button:hover    { background: var(--btn-hover); }
button:active   { background: var(--btn-active); }
button:disabled {
  background: var(--btn-disabled);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

/* ── Range inputs ───────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-green);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-green);
  cursor: pointer;
  border: none;
}

/* ── Home navigation ────────────────────────────────────── */
.nav-home {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-home:hover {
  color: var(--text);
  background: var(--btn-hover);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .controls {
    top: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    border-radius: 0 0 var(--panel-radius) var(--panel-radius);
    max-height: 45vh;
  }
  .controls.sidebar {
    bottom: auto;
    border-radius: 0 0 var(--panel-radius) var(--panel-radius);
    max-height: 45vh;
  }
  button       { min-height: 40px; font-size: 15px; }
  .nav-home    { bottom: 8px; left: 8px; padding: 6px 10px; font-size: 12px; }
}
