/* ── HERE4U Workshop — Shared Styles ─────────────────────────── */

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-alt: #0f3460;
  --text: #eee;
  --text-muted: #aaa;
  --accent-warm: #e2b714;
  --accent-gold: #f0c040;
  --accent-green: #4ecca3;
  --accent-red: #e74c3c;
  --accent-blue: #3498db;
  --accent-purple: #9b59b6;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  line-height: 1.5;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--accent-gold);
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-scenario {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-warm);
  color: #1a1a2e;
}

.btn-green {
  background: var(--accent-green);
  color: #1a1a2e;
}

.btn-red {
  background: var(--accent-red);
  color: #fff;
}

.btn-blue {
  background: var(--accent-blue);
  color: #fff;
}

.btn-purple {
  background: var(--accent-purple);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-warm);
  color: var(--accent-warm);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 1;
  min-width: 100px;
}

.btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-pair .btn {
  min-height: 64px;
  font-size: 1.1rem;
}

/* ── Slider (Exercise 1) ───────────────────────────────────── */

.slider-container {
  padding: 1rem 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0 2px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent-green), var(--accent-warm), var(--accent-red));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-warm);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-warm);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.slider-value {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  color: var(--accent-gold);
}

/* ── Text input (Exercise 4) ───────────────────────────────── */

textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--bg-card-alt);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-warm);
}

textarea::placeholder {
  color: var(--text-muted);
}

/* ── Feed (Exercise 4 + Facilitator) ───────────────────────── */

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.feed-item {
  background: var(--bg-card-alt);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  animation: fadeSlideIn 0.4s ease;
  border-left: 3px solid var(--accent-warm);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Progress dots ──────────────────────────────────────────── */

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0.75rem 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  transition: background 0.3s ease;
}

.dot.active {
  background: var(--accent-warm);
}

.dot.done {
  background: var(--accent-green);
}

/* ── Prompt text ────────────────────────────────────────────── */

.prompt {
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.6;
  min-height: 3rem;
}

.scenario-text {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.scenario-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ── Flip card reveal ───────────────────────────────────────── */

.reveal {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.reveal.show {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}

.reveal h3 {
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.reveal p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ── Flash feedback (Exercise 3) ────────────────────────────── */

.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flash.green {
  background: rgba(78, 204, 163, 0.25);
  opacity: 1;
}

.flash.red {
  background: rgba(231, 76, 60, 0.25);
  opacity: 1;
}

/* ── Status / Thank You ─────────────────────────────────────── */

.status {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.thank-you {
  text-align: center;
  padding: 2rem;
}

.thank-you h2 {
  color: var(--accent-green);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ── Landing page ───────────────────────────────────────────── */

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exercise-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
  border: 2px solid transparent;
}

.exercise-link:hover,
.exercise-link:active {
  transform: scale(1.02);
  border-color: var(--accent-warm);
}

.exercise-link h3 {
  color: var(--accent-gold);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.exercise-link p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Facilitator dashboard ──────────────────────────────────── */

.facilitator {
  max-width: 1200px;
  width: 100%;
  padding: 1.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel h3 {
  color: var(--accent-gold);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.panel-full {
  grid-column: 1 / -1;
}

/* Histogram bars */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  padding: 0 0.5rem;
}

.hist-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.hist-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
  min-height: 2px;
}

.hist-bar.q1 {
  background: var(--accent-blue);
  opacity: 0.8;
}

.hist-bar.q2 {
  background: var(--accent-red);
  opacity: 0.8;
}

.hist-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  word-break: break-word;
}

/* Bar chart for ex2 */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar-row-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
}

.bar-segment {
  height: 100%;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 0;
}

.bar-segment.kind { background: var(--accent-green); color: #1a1a2e; }
.bar-segment.nice { background: var(--accent-blue); color: #fff; }
.bar-segment.bullying { background: var(--accent-red); color: #fff; }

/* Ex3 accuracy chart */
.accuracy-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accuracy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accuracy-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 30px;
  text-align: right;
}

.accuracy-bar-bg {
  flex: 1;
  height: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.accuracy-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.accuracy-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 40px;
}

/* Facilitator feed */
.facilitator-feed {
  max-height: 400px;
  overflow-y: auto;
}

.facilitator-feed .feed-item {
  font-size: 1.3rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

/* Legend */
.legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.participant-count {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .facilitator {
    padding: 0.75rem;
  }
}

@media (min-width: 769px) {
  body {
    padding: 2rem;
  }
}

/* ── Utilities ──────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  -webkit-tap-highlight-color: transparent;
}

.back-link:hover,
.back-link:active {
  color: var(--accent-warm);
}
