/* ========================================
   INTERACTIVE DEMO STYLES
   ======================================== */

/* --- Tokenizer Demo --- */
.tokenizer-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  font-size: var(--fs-lg);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  resize: none;
  min-height: 60px;
}

.tokenizer-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.1);
}

.tokenizer-input::placeholder {
  color: var(--text-muted);
}

.token-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 50px;
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-glass-border);
}

.token-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  animation: scaleIn 0.2s ease;
  position: relative;
  cursor: default;
}

.token-chip .token-id {
  font-size: var(--fs-xs);
  opacity: 0.6;
  margin-left: var(--space-2);
}

/* Token Colors */
.token-color-0 { background: rgba(79, 142, 247, 0.2); color: #93bbfc; border: 1px solid rgba(79, 142, 247, 0.3); }
.token-color-1 { background: rgba(139, 92, 246, 0.2); color: #b794f6; border: 1px solid rgba(139, 92, 246, 0.3); }
.token-color-2 { background: rgba(6, 182, 212, 0.2); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.token-color-3 { background: rgba(249, 115, 22, 0.2); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.3); }
.token-color-4 { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; border: 1px solid rgba(236, 72, 153, 0.3); }
.token-color-5 { background: rgba(34, 197, 94, 0.2); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.token-color-6 { background: rgba(251, 191, 36, 0.2); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.3); }
.token-color-7 { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }

.token-stats {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.token-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.token-stat-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.token-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Next-Token Prediction --- */
.prediction-sentence {
  font-size: var(--fs-xl);
  font-family: var(--font-mono);
  padding: var(--space-6);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-glass-border);
  min-height: 80px;
  line-height: 1.8;
}

.prediction-sentence .typed-text {
  color: var(--text-primary);
}

.prediction-sentence .cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent-blue);
  animation: pulse 1s ease infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

.probability-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.prob-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.prob-bar:hover {
  background: var(--bg-card);
}

.prob-bar .prob-word {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  width: 100px;
  text-align: right;
  flex-shrink: 0;
}

.prob-bar .prob-track {
  flex: 1;
  height: 28px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.prob-bar .prob-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  padding-left: var(--space-2);
}

.prob-bar .prob-value {
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
  color: var(--text-secondary);
}

/* --- Temperature Control --- */
.temp-control {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-glass-border);
}

.temp-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  min-width: 100px;
}

.temp-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 50px;
  text-align: center;
}

/* --- Attention Heatmap --- */
.attention-grid {
  display: inline-grid;
  gap: 2px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
  max-width: 100%;
}

.attention-cell {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.attention-cell:hover {
  transform: scale(1.15);
  z-index: 1;
}

.attention-label {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 600;
}

.attention-label.row-label {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

/* --- Embedding Space --- */
.embedding-canvas-container {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-glass-border);
  overflow: hidden;
}

.embedding-canvas-container canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

.embedding-search {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.embedding-search input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-5);
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.embedding-search input:focus {
  border-color: var(--accent-blue);
}

/* --- Neural Network Visualization --- */
.nn-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nn-container canvas {
  border-radius: var(--radius-lg);
}

.nn-controls {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Fact/Myth Interactive --- */
.fact-myth-container {
  text-align: center;
}

.fact-myth-statement {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-bottom: var(--space-8);
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.fact-myth-buttons {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
}

.fact-myth-btn {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  font-weight: 800;
  background: var(--bg-card);
  border: 2px solid var(--bg-glass-border);
  transition: all var(--transition-base);
  cursor: pointer;
}

.fact-myth-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.fact-myth-btn.fact:hover {
  border-color: var(--correct);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

.fact-myth-btn.myth:hover {
  border-color: var(--incorrect);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.fact-myth-btn.selected-correct {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--correct);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

.fact-myth-btn.selected-incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--incorrect);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* --- Drag and Drop Classifier --- */
.classifier-zone {
  min-height: 150px;
  border: 2px dashed var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-start;
  align-content: flex-start;
  transition: all var(--transition-fast);
}

.classifier-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(79, 142, 247, 0.05);
}

.classifier-zone .zone-label {
  width: 100%;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.draggable-item {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: grab;
  user-select: none;
  transition: all var(--transition-fast);
}

.draggable-item:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.draggable-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

/* --- Canvas Overlay Info --- */
.canvas-info {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

.canvas-info-item {
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Diffusion Denoiser --- */
.diffusion-canvas {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-glass-border);
  overflow: hidden;
}

.diffusion-canvas canvas {
  display: block;
  width: 100%;
}

.diffusion-steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.diffusion-step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-card);
  transition: background var(--transition-fast);
}

.step-dot.active {
  background: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

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

/* --- Transformer Block Diagram --- */
.transformer-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
}

.transformer-block {
  width: 100%;
  max-width: 400px;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  text-align: center;
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.transformer-block:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: scale(1.02);
}

.transformer-block.active {
  background: rgba(79, 142, 247, 0.1);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.transformer-arrow {
  width: 2px;
  height: 24px;
  background: var(--bg-glass-border);
  position: relative;
}

.transformer-arrow::after {
  content: '▼';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--text-muted);
}

/* ===== NEW GAME STYLES ===== */

/* Memory Match */
.memory-card {
  perspective: 600px;
  cursor: pointer;
}
.memory-card-inner {
  width: 100%; height: 100%;
  position: relative; transform-style: preserve-3d;
  transition: transform 0.4s;
}
.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }

/* NN Canvas */
#nnCanvas {
  display: block; width: 100%;
  background: radial-gradient(ellipse at center, rgba(10,10,30,0.8) 0%, var(--bg-primary) 100%);
  border-radius: var(--radius-lg);
}

/* Bingo Grid */
.bingo-grid > div:hover:not([data-revealed="1"]) {
  border-color: var(--accent-blue) !important;
  background: rgba(79,142,247,0.1) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(79,142,247,0.2);
}
.bingo-grid > div[data-revealed="1"] {
  cursor: default !important;
}

/* Fact-myth btn disabled */
.fact-myth-btn.disabled { pointer-events: none; opacity: 0.7; }
.quiz-option.disabled { pointer-events: none; }
.quiz-option.correct { background: rgba(34,197,94,0.15) !important; border-color: var(--correct) !important; }
.quiz-option.incorrect { background: rgba(239,68,68,0.15) !important; border-color: var(--incorrect) !important; }

/* Diffusion canvas */
#diffusionCanvas { display: block; width: 100%; border-radius: var(--radius-lg); }
#embeddingCanvas { display: block; width: 100%; }
