/* =============================================================================
   ILS Place Value Activity CSS — Shared styles for PV activity widgets
   Used by: 1a2_4 (Revisiting Place Value), 1a2_41, and similar PV activities
   Provides: PV chart, big number display, place buttons, expanded form,
             digit pool, word display — with dark mode & responsive variants
   ============================================================================= */

/* ===== PLACE VALUE CHART ===== */
.pv-chart {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 16px auto;
  max-width: 560px;
}
.pv-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #e2e8f0;
  border-right: none;
  background: #f8fafc;
  transition: all 0.3s ease;
  min-width: 0;
}
.pv-chart-col:last-child {
  border-right: 2px solid #e2e8f0;
  border-radius: 0 14px 14px 0;
}
.pv-chart-col:first-child {
  border-radius: 14px 0 0 14px;
}
.pv-chart-head {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  color: #6366f1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  width: 100%;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-chart-digit {
  padding: 14px 4px;
  font-size: 36px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  color: #334155;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-chart-col.pv-col-active {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  z-index: 2;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}
.pv-chart-col.pv-col-active .pv-chart-digit {
  color: #4f46e5;
}
.pv-chart-col.pv-col-correct {
  border-color: #22c55e;
  background: #dcfce7;
}
.pv-chart-col.pv-col-correct .pv-chart-digit {
  color: #16a34a;
}
.pv-chart-pv {
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  width: 100%;
  text-align: center;
  font-family: "Courier New", monospace;
}
.pv-chart-col.pv-col-correct .pv-chart-pv {
  color: #16a34a;
}

/* ===== BIG NUMBER DISPLAY ===== */
.pv-big-num {
  text-align: center;
  font-size: 52px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  color: #4f46e5;
  margin: 12px 0;
  letter-spacing: 6px;
  text-shadow: 0 3px 12px rgba(79, 70, 229, 0.15);
}
.pv-big-num .pv-digit-hl {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border-radius: 8px;
  padding: 2px 6px;
  border: 2px solid #f59e0b;
}

/* ===== PLACE BUTTONS ===== */
.pv-place-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
}
.pv-place-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
  text-align: center;
}
.pv-place-btn:hover {
  border-color: #6366f1;
  background: #eef2ff;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.15);
}
.pv-place-btn:active {
  transform: scale(0.96);
}
.pv-place-btn.pv-correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}
.pv-place-btn.pv-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}
.pv-place-btn.pv-disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* ===== EXPANDED FORM ===== */
.pv-expand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px auto;
  max-width: 600px;
}
.pv-expand-term {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  color: #334155;
  transition: all 0.3s;
}
.pv-expand-term.pv-filled {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4f46e5;
}
.pv-expand-term.pv-exp-correct {
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
}
.pv-expand-term.pv-exp-wrong {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}
.pv-expand-plus {
  font-size: 20px;
  font-weight: 900;
  color: #a5b4fc;
}
.pv-expand-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px dashed #c7d2fe;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.2s;
}
.pv-expand-slot:hover {
  border-color: #6366f1;
  background: #eef2ff;
}
.pv-expand-slot.pv-slot-filled {
  border-style: solid;
  border-color: #6366f1;
  background: #eef2ff;
}
.pv-expand-times {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 2px;
}
.pv-expand-multiplier {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

/* ===== DIGIT POOL ===== */
.pv-digit-pool {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.pv-pool-chip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  border: 2px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
  cursor: pointer;
  transition: all 0.2s;
}
.pv-pool-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.pv-pool-chip:active {
  transform: scale(0.93);
}
.pv-pool-chip.pv-chip-used {
  opacity: 0.3;
  pointer-events: none;
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
}

/* ===== WORD DISPLAY ===== */
.pv-word-display {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-style: italic;
  color: #475569;
  margin: 12px auto;
  padding: 14px 20px;
  border-radius: 14px;
  background: #fffbeb;
  border: 2px solid #fcd34d;
  max-width: 500px;
  line-height: 1.5;
}

/* =============================================================================
   DARK MODE
   ============================================================================= */
.dark .pv-chart-col {
  background: #1e293b;
  border-color: #334155;
}
.dark .pv-chart-head {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #a5b4fc;
  border-color: #334155;
}
.dark .pv-chart-digit {
  color: #e2e8f0;
}
.dark .pv-chart-pv {
  color: #64748b;
  border-color: #334155;
}
.dark .pv-chart-col.pv-col-active {
  border-color: #6366f1;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
}
.dark .pv-chart-col.pv-col-active .pv-chart-digit {
  color: #a5b4fc;
}
.dark .pv-chart-col.pv-col-correct {
  border-color: #22c55e;
  background: #052e16;
}
.dark .pv-chart-col.pv-col-correct .pv-chart-digit {
  color: #4ade80;
}
.dark .pv-chart-col.pv-col-correct .pv-chart-pv {
  color: #4ade80;
}
.dark .pv-big-num {
  color: #a5b4fc;
}
.dark .pv-place-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .pv-place-btn:hover {
  border-color: #6366f1;
  background: #1e1b4b;
}
.dark .pv-place-btn.pv-correct {
  background: #052e16;
  border-color: #22c55e;
  color: #4ade80;
}
.dark .pv-place-btn.pv-wrong {
  background: #450a0a;
  border-color: #ef4444;
  color: #fca5a5;
}
.dark .pv-expand-term {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .pv-expand-term.pv-filled {
  border-color: #6366f1;
  background: #1e1b4b;
  color: #a5b4fc;
}
.dark .pv-expand-term.pv-exp-correct {
  background: #052e16;
  border-color: #22c55e;
  color: #4ade80;
}
.dark .pv-expand-term.pv-exp-wrong {
  background: #450a0a;
  border-color: #ef4444;
  color: #fca5a5;
}
.dark .pv-expand-slot {
  background: #1e293b;
  border-color: #4338ca;
  color: #a5b4fc;
}
.dark .pv-pool-chip {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-color: #4338ca;
  color: #a5b4fc;
}
.dark .pv-pool-chip.pv-chip-used {
  background: #0f172a;
  border-color: #1e293b;
  color: #475569;
}
.dark .pv-word-display {
  background: #1c1917;
  border-color: #92400e;
  color: #fcd34d;
}

/* =============================================================================
   RESPONSIVE — 480px breakpoint
   ============================================================================= */
@media (max-width: 480px) {
  .pv-big-num {
    font-size: 36px;
    letter-spacing: 3px;
  }
  .pv-chart-head {
    font-size: 9px;
    padding: 6px 2px;
    min-height: 44px;
  }
  .pv-chart-digit {
    font-size: 26px;
    padding: 10px 2px;
  }
  .pv-chart-pv {
    font-size: 10px;
  }
  .pv-expand-term {
    font-size: 13px;
    padding: 6px 6px;
  }
  .pv-expand-slot {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .pv-pool-chip {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .pv-place-btn {
    padding: 8px 10px;
    font-size: 11px;
    min-width: 70px;
  }
}
