/* ==========================================================================
   1% CLUB UPGRADED STYLESHEET (11-Tier Ladder, SVGs, Admin Inspector)
   ========================================================================== */

/* 11-Tier Ladder Bar */
.logic-ladder-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 16px auto;
  overflow-x: auto;
  padding: 4px 0;
}

.logic-ladder-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 600px;
}

.ladder-node {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.ladder-node.active {
  background: #253347;
  border-color: var(--accent-gem);
  color: #fff;
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ladder-node.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.ladder-node.top-tier {
  border-color: rgba(245, 158, 11, 0.4);
}

.ladder-node.top-tier.active {
  background: #2b2515;
  border-color: var(--accent-aura);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

/* Tier Pill Header */
.logic-tier-pill {
  background: var(--bg-surface-elevated);
  color: var(--accent-gem);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.logic-tier-pill.epic-1pct {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-aura);
  color: var(--accent-aura);
}

/* Logic Card & Visuals */
.logic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.logic-card.card-1pct-glow {
  border-color: var(--accent-aura);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.logic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gem);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-bar-bg {
  width: 80px;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar-fill {
  width: 100%;
  height: 100%;
  background: var(--accent-gem);
  transition: width 1s linear;
}

.timer-bar-fill.gold {
  background: #f59e0b;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #ffd500;
  font-weight: 800;
  min-width: 28px;
}

.logic-question-prompt {
  font-family: var(--font-ui), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.65;
  letter-spacing: 0.015em;
  word-spacing: 0.05em;
  white-space: pre-line;
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* SVG Visual Container */
.logic-visual-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 120px;
}

.puzzle-svg {
  max-height: 140px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-ui), sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  box-shadow: var(--shadow-subtle);
}

.option-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  color: #fff;
  transform: translateY(-1px);
}

.option-btn.selected {
  border-color: var(--accent-gem);
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* Logic Reveal Box */
.logic-reveal-box {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  animation: popIn 0.3s ease;
}

.reveal-header {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #ffd500;
  font-size: 13px;
  margin-bottom: 6px;
}

.reveal-text {
  font-size: 15px;
  color: #e2e8f0;
  line-height: 1.5;
}

/* ==========================================================================
   PARENT / ADMIN QUESTION BANK INSPECTOR MODAL
   ========================================================================== */
.logic-admin-card {
  background: #0f172a;
  border: 2px solid #6366f1;
  border-radius: 24px;
  width: 95%;
  max-width: 1050px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(99, 102, 241, 0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logic-admin-header {
  padding: 16px 24px;
  background: #1e293b;
  border-bottom: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-badge {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid #818cf8;
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.logic-admin-header h2 {
  font-family: var(--font-game);
  font-size: 18px;
  color: #fff;
  margin: 0;
}

.logic-admin-filters {
  padding: 12px 24px;
  background: #111827;
  border-bottom: 1px solid #334155;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

.admin-select {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.search-group {
  flex: 1;
  min-width: 200px;
}

.admin-search {
  width: 100%;
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.admin-search:focus {
  border-color: #38bdf8;
}

/* Split Pane */
.logic-admin-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.logic-admin-list-pane {
  width: 45%;
  border-right: 2px solid #334155;
  display: flex;
  flex-direction: column;
  background: #090d16;
}

.list-summary-bar {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
  border-bottom: 1px solid #1e293b;
  background: #0f172a;
}

.admin-questions-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-q-item {
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-q-item:hover {
  border-color: #38bdf8;
}

.admin-q-item.active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.2);
}

.q-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.q-tier-tag {
  background: #4f46e5;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.q-cat-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
}

.q-acc-stat {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #38bdf8;
  font-weight: 700;
}

.q-item-prompt {
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preview Pane */
.logic-admin-preview-pane {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #0f172a;
}

.preview-empty {
  color: #64748b;
  font-size: 14px;
  text-align: center;
  margin-top: 40px;
}

.admin-preview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-tier-badge {
  background: #f59e0b;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
}

.preview-id-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}

.preview-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.preview-status.enabled { color: #22c55e; }
.preview-status.disabled { color: #ef4444; }

.preview-stats-row {
  display: flex;
  gap: 10px;
}

.stat-pill {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
}

.stat-pill strong { color: #38bdf8; }

.preview-question-box {
  background: #1e293b;
  border-radius: 12px;
  padding: 14px;
}

.preview-question-box h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 8px 0;
}

.preview-question-box p {
  font-size: 15px;
  color: #fff;
  line-height: 1.5;
  margin: 0;
}

.preview-svg-box {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 10px;
}

.preview-choices-box h4, .preview-expl-box h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 8px 0;
}

.preview-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preview-opt {
  background: #111827;
  border: 1px solid #334155;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.preview-opt.correct-opt {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  font-weight: 700;
}

.preview-expl-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 12px;
  border-radius: 10px;
}

.preview-expl-box p {
  margin: 0;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-action-btn {
  font-family: var(--font-game);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-disable {
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #fff;
}

.btn-enable {
  background: #22c55e;
  border: 1px solid #16a34a;
  color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .logic-ladder-track {
    min-width: 480px;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .logic-admin-split {
    flex-direction: column;
  }
  .logic-admin-list-pane {
    width: 100%;
    height: 40%;
    border-right: none;
    border-bottom: 2px solid #334155;
  }
}
