/* Minimal custom styles for Pico.css */

/* Custom color variables for learning states */
:root {
  --color-correct: #10b981;
  --color-incorrect: #ef4444;
  --color-correct-bg: rgba(16, 185, 129, 0.1);
  --color-incorrect-bg: rgba(239, 68, 68, 0.1);
}

/* Three-column layout */
.three-column-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.left-column {
  display: none;
}

.center-column {
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.right-column {
  display: none;
  padding: 2rem;
}

/* Tablet: Two columns (content + right sidebar) */
@media (min-width: 768px) {
  .three-column-layout {
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
  }

  .left-column {
    display: none;
  }

  .center-column {
    display: block;
    max-width: none;
    padding: 2rem 0;
  }

  .right-column {
    display: block;
    padding: 1rem;
  }
}

/* Desktop: Three columns (left metrics + content + right sidebar) */
@media (min-width: 1024px) {
  .three-column-layout {
    grid-template-columns: minmax(100px, 1fr) minmax(600px, 2fr) minmax(
        250px,
        1fr
      );
    gap: 2rem;
  }

  .left-column {
    display: block;
  }

  .center-column {
    max-width: none;
    padding: 2rem 0;
  }

  .right-column {
    padding: 1rem;
  }

  /* Compact question screen on desktop */
  #question-screen h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  #question-screen article {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
  }

  #question-screen button {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }

  #question-screen progress {
    height: 0.5rem;
    margin-bottom: 0.5rem;
  }
}

/* Right column styling - minimal overrides to Pico defaults */
.right-column article {
  font-size: 0.9rem;
}

/* Screen transitions */
.screen {
  animation: fadeIn 0.3s ease-in;
}

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

/* Question options */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

/* Option buttons - leverage Pico's button styling, add only custom behavior */
.option-btn {
  text-align: left; /* Override Pico's centered text */
  width: 100%;
}

@media (min-width: 1024px) {
  .options {
    gap: 0.5rem;
    margin: 0.75rem 0;
  }
}

.option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option-btn.correct-answer {
  color: var(--color-incorrect); /* Show what they picked was wrong */
  border-color: var(--color-correct);
  background: var(--color-correct-bg);
}

.option-btn.incorrect-answer {
  color: var(--color-incorrect);
  border-color: var(--color-incorrect);
  background: var(--color-incorrect-bg);
}

/* Feedback styling */
.correct {
  color: var(--color-correct);
  font-size: 1.2em;
  font-weight: 700;
}

.incorrect {
  color: var(--color-incorrect);
  font-size: 1.2em;
  font-weight: 700;
}

#correct-answer {
  margin-top: 0.5rem;
}

@media (min-width: 1024px) {
  .correct,
  .incorrect {
    font-size: 1.1em;
  }

  #correct-answer {
    margin-top: 0.25rem;
  }
}

/* Loading overlay - uses Pico color variables for automatic dark mode support */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--pico-background-color) 95%, transparent);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Knowledge display emphasis */
#knowledge-value {
  font-size: 1.3em;
  font-weight: 700;
}

/* BKT Metrics Panel - leverage Pico's article styling */

#bkt-metrics-left,
#llm-metrics-left {
  padding: var(--pico-spacing);
}

#bkt-metrics-left article,
#llm-metrics-left article,
.right-column article {
  font-size: 0.9rem;
  margin-bottom: var(--pico-spacing);
}

#bkt-metrics-left article h3,
#bkt-metrics-left article h4,
#llm-metrics-left article h3,
#llm-metrics-left article h4 {
  margin-top: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* Current Knowledge Large Display */
.knowledge-large {
  text-align: center;
  padding: 1rem 0;
}

#knowledge-percent {
  font-size: 3rem;
  font-weight: 700;
  color: var(--pico-primary);
}

/* Metrics Rows */
.metrics-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.metrics-label {
  opacity: 0.7;
}

.metrics-value {
  font-weight: 600;
}

/* Answer History Icons */
.answer-history {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.answer-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
}

.answer-icon.correct {
  background: color-mix(in srgb, var(--color-correct) 20%, transparent);
  color: var(--color-correct);
}

.answer-icon.incorrect {
  background: color-mix(in srgb, var(--color-incorrect) 20%, transparent);
  color: var(--color-incorrect);
}

/* Difficulty Progression Bars */
.difficulty-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  height: 60px;
  padding: 0.5rem 0;
}

.difficulty-bar {
  flex: 1;
  background: var(--pico-primary);
  border-radius: 2px;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: relative;
  min-width: 8px;
}

.difficulty-bar:hover {
  opacity: 1;
}

/* BKT Parameters */
.bkt-params {
  font-size: 0.85rem;
}

.param-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.param-label {
  opacity: 0.7;
  font-size: 0.8rem;
}

.param-value {
  font-weight: 600;
  font-family: monospace;
}

/* Knowledge Chart Styling */
#knowledge-chart {
  max-height: 150px;
}

/* LLM Comparative Metrics */
#llm-metrics-left {
  padding: 1rem;
}

.comparative-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.comparison-subtitle {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Knowledge Level Comparison - uses Pico's .grid class */
.comparative-metrics {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.05) 0%,
    rgba(16, 185, 129, 0.05) 100%
  );
  border-left: 3px solid var(--pico-primary);
}

.metric-half {
  text-align: center;
}

.metric-half h5 {
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.metric-value-lg {
  font-size: 2rem;
  font-weight: 700;
  color: var(--pico-primary);
  line-height: 1;
}

.metric-label {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* LLM-Specific Metrics */
.llm-metric {
  margin-bottom: 1rem;
}

.llm-metric:last-child {
  margin-bottom: 0;
}

.llm-metric-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.llm-metric-header span:first-child {
  opacity: 0.7;
}

.llm-metric-header span:last-child {
  font-weight: 600;
  font-family: monospace;
}

.metric-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .metric-bar {
    background: rgba(255, 255, 255, 0.1);
  }
}

.metric-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--pico-primary),
    rgba(59, 130, 246, 0.8)
  );
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

/* BKT Parameters Comparison */
.bkt-params-compare {
  font-size: 0.85rem;
}

.param-row-sm {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.8rem;
}

.param-row-sm span:first-child {
  opacity: 0.7;
}

.param-row-sm span:last-child {
  font-weight: 600;
  font-family: monospace;
}

/* Comparison Insight */
.comparison-insight {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

.comparison-insight p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  font-style: italic;
}
