/* Bridge Trainer — Module-specific styles */

/* Quiz module */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}

.quiz-option:active { transform: scale(0.98); }
.quiz-option.selected { border-color: var(--accent); }
.quiz-option.correct { border-color: var(--success); background: rgba(0, 200, 83, 0.08); }
.quiz-option.wrong { border-color: var(--error); background: rgba(255, 82, 82, 0.08); }

/* Theory reference */
.theory-search {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  margin-bottom: 16px;
}
.theory-search:focus { border-color: var(--accent); }
.theory-search::placeholder { color: var(--text-muted); }

.theory-entry {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
}

.theory-entry h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.theory-entry p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.theory-entry .tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: rgba(29, 155, 240, 0.15);
  color: var(--accent);
  margin-top: 8px;
}

/* Bidding sequence display */
.bidding-history {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
}

.bidding-history .bh-header {
  background: var(--bg-surface);
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.bidding-history .bh-cell {
  background: var(--bg-card);
  padding: 8px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bh-cell.user-bid { color: var(--accent); }
.bh-cell.pass-bid { color: var(--text-muted); }

/* Convention drill filter */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Lead trainer: bidding context */
.bidding-context {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.bidding-context .context-label {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* Play scenario */
.play-area {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 200px;
}

.play-trick {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

/* Lesson tag colors */
.lesson-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 600;
}
.lesson-tag-1 { background: rgba(255, 82, 82, 0.15); color: #ff5252; }
.lesson-tag-2 { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.lesson-tag-3 { background: rgba(0, 200, 83, 0.15); color: #00c853; }
.lesson-tag-4 { background: rgba(29, 155, 240, 0.15); color: #1d9bf0; }
.lesson-tag-5 { background: rgba(156, 39, 176, 0.15); color: #9c27b0; }

/* Decision tree (daily mix feedback) */
.decision-tree h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.decision-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}
.decision-step:last-of-type { border-bottom: none; }
.step-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-weight: 700;
}
.step-passed .step-icon { color: var(--success); }
.step-failed .step-icon { color: var(--error); }
.step-passed .step-text { color: var(--text-secondary); }
.step-failed .step-text { color: var(--text-primary); font-weight: 600; }

/* Decisive step highlight (last passed before first failed) */
.step-decisive {
  background: rgba(29,155,240,0.1);
  border-radius: 6px;
  padding: 8px;
  margin: 4px -8px;
}
.step-decisive .step-text {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

/* Session progress dots (daily mix) */
.session-progress {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
}
.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
  flex-shrink: 0;
}
.progress-dot.current {
  background: var(--accent);
  transform: scale(1.3);
  animation: dot-pulse 1.5s infinite;
}
.progress-dot.correct { background: var(--success); }
.progress-dot.wrong { background: var(--error); }
.progress-dot.dot-retry {
  width: 7px;
  height: 7px;
  opacity: 0.8;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.retry-badge {
  font-size: 12px;
  margin-left: 4px;
}

/* Task type badge (daily mix) */
.task-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.task-type-opening { background: rgba(29,155,240,0.2); color: #1d9bf0; }
.task-type-response { background: rgba(0,200,83,0.2); color: #00c853; }
.task-type-hcp { background: rgba(255,193,7,0.2); color: #ffc107; }
.task-type-quiz { background: rgba(156,39,176,0.2); color: #9c27b0; }
.task-type-lead { background: rgba(255,152,0,0.2); color: #ff9800; }
.task-type-tricks { background: rgba(0,188,212,0.2); color: #00bcd4; }
.task-type-defense { background: rgba(233,30,99,0.2); color: #e91e63; }

/* Modules popup menu */
.modules-popup {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 0;
  z-index: 200;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.popup-item {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}
.popup-item:active { background: var(--bg-surface); }
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
}

/* Onboarding */
.onboarding-screen {
  padding: 32px 16px;
  text-align: center;
}
.onboarding-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.onboarding-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}
.onboarding-card:active {
  transform: scale(0.98);
}
.onboarding-card.selected,
.onboarding-card:hover {
  border-color: var(--accent);
}
.onboarding-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.onboarding-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.onboarding-desc {
  font-size: 14px;
  color: var(--text-secondary);
}
.lesson-slider {
  margin: 16px 0;
}
.lesson-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.lesson-slider-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

/* Variable reward items (daily mix results) */
.reward-item {
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 12px;
  background: var(--card-bg);
  border-left: 3px solid var(--accent);
  font-size: 0.95em;
}
