/**
 * Session Planner Panel
 * =====================
 * Quick reference panel for DMs during gameplay.
 * Shows session plan details: scenes, NPCs, encounters, contingencies.
 */

.session-planner-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-sm);
  overflow: hidden;
  font-size: 0.85rem;
}

/* Header */
.sp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
}

.sp-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.sp-meta {
  display: flex;
  gap: var(--space-xs);
  font-size: 0.75rem;
}

.sp-level,
.sp-duration,
.sp-progress {
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.sp-progress {
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Tab Navigation */
.sp-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-xs);
}

.sp-tab-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: background-color 0.15s, color 0.15s;
}

.sp-tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sp-tab-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Tab Content */
.sp-tab-content {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.sp-tab-content:not(.active) {
  display: none;
}

/* Scene Cards */
.sp-scene-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: var(--space-sm);
  margin-bottom: var(--space-xs);
  transition: opacity 0.2s, border-color 0.2s;
}

.sp-scene-card.sp-scene--complete {
  opacity: 0.6;
  border-left: 3px solid var(--success);
}

.sp-scene-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 4px;
}

.sp-scene-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: bold;
}

.sp-scene-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.sp-scene-complete-btn {
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.15s, color 0.15s;
}

.sp-scene-complete-btn:hover {
  background: var(--success);
  color: var(--bg-primary);
  border-color: var(--success);
}

/* Read Aloud */
.sp-read-aloud {
  margin-top: var(--space-xs);
}

.sp-read-aloud summary {
  cursor: pointer;
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-style: italic;
}

.sp-read-aloud blockquote {
  margin: var(--space-xs) 0 0;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-secondary);
  font-style: italic;
  color: var(--text-secondary);
}

/* DM Notes */
.sp-dm-notes {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* NPC Cards */
.sp-npc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.sp-npc-card.sp-npc--enemy {
  border-left: 3px solid var(--danger);
}

.sp-npc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.sp-npc-name {
  font-weight: 600;
  color: var(--text-primary);
}

.sp-npc-role {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.sp-npc-stats {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.sp-npc-stats span {
  font-family: var(--font-mono);
}

.sp-npc-action {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sp-npc-action strong {
  color: var(--accent-primary);
}

.sp-npc-dialogue summary {
  cursor: pointer;
  color: var(--accent-secondary);
  font-size: 0.75rem;
  margin-top: var(--space-xs);
}

.sp-npc-dialogue p {
  margin: 4px 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sp-npc-dialogue p strong {
  color: var(--text-primary);
}

/* Encounter Cards */
.sp-encounter-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.sp-enc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.sp-enc-name {
  font-weight: 600;
  color: var(--text-primary);
}

.sp-enc-diff {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.sp-diff--trivial { background: var(--text-muted); color: var(--bg-primary); }
.sp-diff--easy { background: var(--success); color: var(--bg-primary); }
.sp-diff--medium { background: var(--warning); color: var(--bg-primary); }
.sp-diff--hard { background: var(--danger); color: var(--bg-primary); }
.sp-diff--deadly { background: #7c3aed; color: var(--bg-primary); }

.sp-enc-priorities {
  font-size: 0.75rem;
}

.sp-priority-row {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: 2px;
  color: var(--text-secondary);
}

.sp-round {
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  min-width: 24px;
}

.sp-retreat {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sp-retreat strong {
  color: var(--warning);
}

/* Contingency Cards */
.sp-contingency-group {
  margin-bottom: var(--space-sm);
}

.sp-contingency-cat {
  margin: 0 0 var(--space-xs);
  font-size: 0.8rem;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-contingency-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: var(--space-sm);
  margin-bottom: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-contingency-item.sp-used {
  opacity: 0.5;
  border-left: 3px solid var(--success);
}

.sp-trigger {
  font-weight: 600;
  color: var(--warning);
  font-size: 0.8rem;
}

.sp-trigger::before {
  content: "IF: ";
  color: var(--text-muted);
  font-weight: normal;
}

.sp-response {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.sp-response::before {
  content: "THEN: ";
  color: var(--text-muted);
}

.sp-mark-used {
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  margin-top: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.sp-mark-used:hover {
  background: var(--success);
  color: var(--bg-primary);
  border-color: var(--success);
}

/* Quick Reference */
.sp-quick-ref {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.sp-quick-ref summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.sp-ref-section {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  font-size: 0.75rem;
}

.sp-ref-section strong {
  color: var(--text-secondary);
  width: 100%;
  margin-bottom: 2px;
}

.sp-dc,
.sp-dmg {
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Empty State */
.sp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-lg);
}

.sp-empty-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.sp-empty-icon svg {
  width: 32px;
  height: 32px;
}

.sp-link {
  margin-top: var(--space-sm);
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.85rem;
}

.sp-link:hover {
  text-decoration: underline;
}

.sp-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-md);
}
