
/* style.css
   Layout + look for discrete slides, charts, and explorer container
*/

:root {
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --border-subtle: #e1e1e6;
  --text-main: #111111;
  --text-muted: #555555;
  --accent: #ff7f0e;
  --accent-soft: #ffe2c4;
  --nav-bg: rgba(255, 255, 255, 0.96);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.09);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-page);
}

/* ----- App frame ----- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Header + nav ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 16px 20px 10px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 900px) {
  .site-header {
    padding: 20px 40px 12px;
  }
}

.site-header-text {
  max-width: 960px;
  margin: 0 auto 10px;
}

.site-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-title {
  margin: 4px 0 8px;
  font-size: 1.8rem;
  line-height: 1.25;
}

.site-subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.site-nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-link {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--text-main);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.nav-link--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-main);
  font-weight: 600;
}

.nav-link--highlight {
  font-weight: 600;
}

/* ----- Slides container ----- */

.slides {
  position: relative;
  flex: 1;
  overflow-x: hidden;   /* keep horizontal clipping */
  overflow-y: auto;     /* allow vertical scrolling when zoomed */
  cursor: pointer; /* click anywhere to advance */
}


/* Each slide takes the full viewport below header */
.slide {
  position: absolute;
  inset: 0;
  padding: 18px 20px 46px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (min-width: 900px) {
  .slide {
    padding: 24px 40px 60px;
  }
}

/* Inner layout: text + chart/media */

.slide-inner {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: flex-start;
}

.slide-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.slide-text p {
  margin: 0 0 0.7rem;
}

.slide-heading {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  line-height: 1.25;
}

.slide-media,
.slide-chart {
  min-height: 260px;
}

@media (max-width: 799px) {
  .slides {
    cursor: default; /* mobile experience is more tap-target specific */
  }

  .slide-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 4px 8px;
    background: transparent;
  }

  .slide {
    padding: 16px 16px 46px;
  }

  .slide-media,
  .slide-chart {
    min-height: 220px;
  }
}

/* Explorer slide tweaks */

.slide--explorer .slide-inner {
  display: block;
}

.slide-text--explorer {
  margin-bottom: 16px;
}

/* Explorer layout: controls + chart side by side on large screens */

.explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 22px;
}

.explorer-controls {
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.explorer-chart {
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  min-height: 320px;
}

@media (max-width: 899px) {
  .explorer-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ----- Click / tap hint ----- */

.click-advance-hint {
  position: fixed;
  right: 14px;
  bottom: 10px;
  padding: 5px 10px;
  font-size: 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  pointer-events: none;
  z-index: 12;
}

.click-advance-hint.is-hidden {
  opacity: 0;
}

/* ----- Footer ----- */

.site-footer {
  padding: 10px 20px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-text {
  margin: 0;
}

/* ----- Chart styling ----- */

.chart {
  width: 100%;
}

.axis path,
.axis line {
  stroke: #c0c0c5;
}

.axis-label {
  font-size: 0.68rem;
  fill: #444444;
}

.axis.axis--y text {
  font-size: 0.7rem;
}

.mean-line {
  stroke-width: 2px;
  stroke-dasharray: 4 3;
}

.mean-line--toxic {
  stroke: #f08a8a;  /* lighter red than bars */
}

.mean-line--spell {
  stroke: #6fa9e8;  /* lighter blue than bars */
}

.mean-label {
  font-size: 0.7rem;
  fill: #333333;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.legend-label {
  font-size: 0.75rem;
  fill: #333333;
}

/* Visual gap between means (story charts) */

.mean-gap-arrow-line {
  stroke: #555555;
  stroke-width: 1.5px;
}

.gap-bar {
  shape-rendering: crispEdges;
}

.gap-bar--toxic {
  fill: #d62728; /* same red as toxic bars */
}

.gap-bar--spell {
  fill: #1f77b4; /* same blue as cheap spells */
}

.gap-bar-label {
  font-size: 0.7rem;
  fill: #333333;
}
.gap-bar-prev-tick {
  stroke: #333333;
  stroke-width: 1.5px;
}

.gap-bar-prev-label {
  font-size: 0.65rem;
  fill: #333333;
}

.legend-item text {
  dominant-baseline: middle;
}


/* ----- Explorer controls styling ----- */

.explorer-section {
  margin-bottom: 16px;
}

.explorer-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.explorer-section-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  margin: 8px 0 4px;
}

.explorer-helper-text {
  margin: 4px 0 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explorer-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.explorer-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.explorer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.explorer-select {
  width: 100%;
  padding: 5px 7px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.explorer-select--small {
  flex: 1 1 30%;
  min-width: 90px;
}

.explorer-search-results {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  padding: 6px 6px 4px;
  background: #fafafa;
}

.explorer-search-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 4px;
  border-radius: 6px;
}

.explorer-search-card:nth-child(odd) {
  background: #ffffff;
}

.explorer-search-card-info {
  min-width: 0;
}

.explorer-search-card-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.explorer-search-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.explorer-search-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.explorer-search-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 2px;
}

/* Buttons used in explorer controls */

.explorer-button {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.explorer-button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.explorer-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.explorer-button--ghost {
  background: transparent;
}

.explorer-button--tiny {
  padding: 2px 8px;
  font-size: 0.7rem;
}

.explorer-button--toxic {
  border-color: #d62728;
}

.explorer-button--spell {
  border-color: #1f77b4;
}

/* Bin lists */

.explorer-bins-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 899px) {
  .explorer-bins-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.explorer-bin-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.explorer-bin-list {
  min-height: 44px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #fafafa;
}

.explorer-bin-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explorer-bin-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  margin: 2px;
}

.explorer-bin-pill--toxic {
  background: rgba(214, 39, 40, 0.12);
}

.explorer-bin-pill--spell {
  background: rgba(31, 119, 180, 0.12);
}

.explorer-bin-pill-label {
  white-space: nowrap;
}

.explorer-bin-pill-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 2px;
  line-height: 1;
}

.explorer-reset-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Empty-state text for chart */

.explorer-chart-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.elixir-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

body {
  position: relative;
  margin: 0;
  font-family: sans-serif;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("images/855973.jpg") center/cover no-repeat;
  filter: brightness(0.6) blur(2px);
  z-index: -1; /* keeps background behind everything */
}

/* Center the toggle above the chart */
.centered-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

/* Modern button style */
.explorer-toggle-btn {
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid #ccc;
  background-color: #f5f5f5;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.explorer-toggle-btn.active {
  background: linear-gradient(135deg, #1f77b4, #4ba3f7);
  color: #fff;
  border-color: #1f77b4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.explorer-toggle-btn:hover:not(.active) {
  background-color: #e0e0e0;
}

.slide-images {
  display: flex;
  flex-direction: column; /* stack vertically */
  align-items: center;    /* center horizontally */
  gap: 16px;              /* spacing between images */
  margin-top: 16px;
}

.slide-image {
  width: 300px;
  border-radius: 8px;
}

.slide-image-large {
  width: 500px; /* slightly bigger than the first */
}

.explorer-bin-title:hover {
  background-color: #f5f5f5;
  cursor: text;
}
