/* =============================================================================
   DM Workspace Panels
   =============================================================================
   Styles for DM session planning panels in terminal.
*/

/* -----------------------------------------------------------------------------
   Panel Base Styles
   -------------------------------------------------------------------------- */
.panel-dm-session-list,
.panel-dm-session-detail,
.panel-dm-scene-editor,
.panel-dm-quick-notes {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-dark, #1a1a1a);
  color: var(--text-primary, #e5e5e5);
}

.dm-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  background: linear-gradient(180deg,
    rgba(255, 215, 0, 0.08) 0%,
    rgba(255, 215, 0, 0.02) 50%,
    var(--surface-darker, #141414) 100%);
  position: relative;
}

/* Gold accent line at bottom of header */
.dm-panel-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 215, 0, 0.4) 20%,
    rgba(255, 215, 0, 0.4) 80%,
    transparent 100%);
}

.dm-panel-header .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.dm-panel-header .panel-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.dm-panel-header .panel-icon svg {
  width: 100%;
  height: 100%;
}

/* Icon helper wrapper - inherit size from container */
.dm-panel-header .panel-icon .svg-icon,
.dm-panel-header .panel-icon .svg-icon svg {
  width: 100%;
  height: 100%;
  display: inline-flex;
}

.dm-panel-body {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.dm-scrollable {
  overflow-y: auto;
}

.dm-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #333);
  background: var(--surface-darker, #141414);
}

/* -----------------------------------------------------------------------------
   Campaign Selector
   -------------------------------------------------------------------------- */
.dm-campaign-selector {
  margin-bottom: 12px;
}

.selector-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.campaign-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
}

.campaign-select:focus {
  outline: none;
  border-color: #ffd700;
}

.dm-current-campaign {
  margin-bottom: 12px;
}

.campaign-badge {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  font-size: 12px;
  color: #ffd700;
}

/* -----------------------------------------------------------------------------
   Quick Actions
   -------------------------------------------------------------------------- */
.dm-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.dm-quick-actions--column {
  flex-direction: column;
}

.dm-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dm-action-btn:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: #ffd700;
}

.dm-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dm-action-btn--primary {
  background: #ffd700;
  color: #1a1a1a;
  border-color: #ffd700;
  font-weight: 600;
}

.dm-action-btn--primary:hover {
  background: #ffed4a;
}

.dm-action-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #333);
  background: var(--surface-darker, #141414);
}

/* -----------------------------------------------------------------------------
   Section Styles
   -------------------------------------------------------------------------- */
.dm-section {
  margin-bottom: 16px;
}

.dm-section--highlight {
  background: rgba(255, 215, 0, 0.05);
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.dm-section--reference {
  background: var(--surface-darker, #141414);
  padding: 12px;
  border-radius: 4px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.count-badge {
  padding: 2px 6px;
  background: var(--surface-darker, #141414);
  border-radius: 10px;
  font-size: 11px;
  color: #ffd700;
}

/* -----------------------------------------------------------------------------
   Plan List
   -------------------------------------------------------------------------- */
.dm-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-plan-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dm-plan-item:hover {
  border-color: #ffd700;
  background: var(--surface-hover, #2a2a2a);
}

.dm-plan-item--selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.dm-plan-item--in_progress {
  border-left: 3px solid #22c55e;
}

.dm-plan-item--draft {
  border-left: 3px solid #6b7280;
}

.dm-plan-item--ready {
  border-left: 3px solid #3b82f6;
}

.dm-plan-item--completed {
  border-left: 3px solid #a855f7;
  opacity: 0.7;
}

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

.plan-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #e5e5e5);
}

.plan-number {
  margin-right: 6px;
  padding: 2px 5px;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 3px;
  font-size: 11px;
  color: #ffd700;
}

.plan-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}

.status-draft { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.status-ready { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-in_progress { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-completed { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.plan-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted, #888);
}

.meta-item {
  display: inline-flex;
  align-items: center;
}

/* -----------------------------------------------------------------------------
   Scene List
   -------------------------------------------------------------------------- */
.dm-scene-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-scene-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
}

.dm-scene-item--completed {
  opacity: 0.6;
  border-left: 3px solid #22c55e;
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: #ffd700;
}

.scene-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.scene-activity {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--surface-hover, #2a2a2a);
  border-radius: 3px;
  color: var(--text-muted, #888);
}

.scene-details {
  margin-top: 8px;
}

.scene-details summary {
  font-size: 11px;
  color: #ffd700;
  cursor: pointer;
}

.read-aloud {
  margin: 8px 0 0;
  padding: 8px 12px;
  background: var(--surface-hover, #2a2a2a);
  border-left: 3px solid #ffd700;
  font-style: italic;
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}

.scene-notes {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #888);
}

/* -----------------------------------------------------------------------------
   NPC & Encounter Lists
   -------------------------------------------------------------------------- */
.dm-npc-list,
.dm-encounter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-npc-item,
.dm-encounter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle, #222);
}

.dm-npc-item:last-child,
.dm-encounter-item:last-child {
  border-bottom: none;
}

.dm-npc-item--enemy .npc-name {
  color: #f87171;
}

.npc-name,
.encounter-name {
  flex: 1;
  font-size: 13px;
}

.npc-role {
  font-size: 11px;
  color: var(--text-muted, #888);
}

.npc-stats {
  font-size: 11px;
  color: var(--text-muted, #888);
}

.encounter-diff {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}

.diff-easy { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.diff-medium { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.diff-hard { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.diff-deadly { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* -----------------------------------------------------------------------------
   Form Styles
   -------------------------------------------------------------------------- */
.dm-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group--half {
  flex: 1;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 8px 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #ffd700;
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

.form-helper-btn {
  align-self: flex-start;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  color: #ffd700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.form-helper-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: #ffd700;
}

/* -----------------------------------------------------------------------------
   Quick Notes
   -------------------------------------------------------------------------- */
.dm-notes-area {
  margin-bottom: 16px;
}

.notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.notes-textarea:focus {
  outline: none;
  border-color: #ffd700;
}

.notes-status {
  margin-top: 4px;
  font-size: 11px;
  text-align: right;
}

.status-saved { color: #4ade80; }
.status-saving { color: #facc15; }
.status-error { color: #f87171; }

/* -----------------------------------------------------------------------------
   Reference Cards
   -------------------------------------------------------------------------- */
.reference-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reference-card {
  padding: 10px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffd700;
}

.reference-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reference-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}

.reference-list--compact li {
  display: block;
  padding: 2px 0;
  font-size: 11px;
  color: var(--text-muted, #888);
}

.ref-label {
  color: var(--text-secondary, #aaa);
}

.ref-value {
  color: #ffd700;
  font-weight: 500;
}

.reference-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reference-item {
  font-size: 12px;
}

.reference-item strong {
  color: var(--text-secondary, #aaa);
  margin-right: 8px;
}

.ref-badge {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px 4px 2px 0;
  background: var(--surface-hover, #2a2a2a);
  border-radius: 3px;
  font-size: 11px;
}

/* -----------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */
.dm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted, #888);
}

.empty-icon {
  display: flex;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: #ffd700;
  opacity: 0.5;
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

/* Icon helper wrapper in empty states - inherit size */
.empty-icon .svg-icon,
.empty-icon .svg-icon svg {
  width: 100%;
  height: 100%;
  display: flex;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-top: 4px;
}

/* -----------------------------------------------------------------------------
   Exit Button
   -------------------------------------------------------------------------- */
.exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-secondary, #aaa);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exit-btn:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: var(--text-muted, #888);
  color: var(--text-primary, #e5e5e5);
}

.btn-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

/* Header meta badges */
.header-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-number {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-right: 4px;
}

.header-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.meta-badge {
  padding: 3px 8px;
  background: var(--surface-darker, #141414);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-secondary, #aaa);
}

.plan-quick-ref {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-row {
  font-size: 12px;
}

.ref-row strong {
  color: var(--text-secondary, #aaa);
  margin-right: 8px;
}

/* =============================================================================
   DEPRECATED: Mode Navigation Tabs (replaced by breadcrumbs)
   =============================================================================
   These styles are kept for backwards compatibility but are no longer used.
   The mode tabs have been replaced by the DM Tools Breadcrumb Navigation.
   See .panel-dm-tools-breadcrumb styles below for the new navigation.
*/

/* =============================================================================
   Dashboard Panel
   =============================================================================
   Overview dashboard with stats cards and quick actions
*/

.dm-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.dm-stat-card {
  padding: 16px;
  background: linear-gradient(135deg,
    rgba(255, 215, 0, 0.08) 0%,
    rgba(255, 215, 0, 0.02) 50%,
    var(--surface-darker, #141414) 100%);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 6px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 215, 0, 0.05);
  position: relative;
  overflow: hidden;
}

/* Subtle gold shimmer effect */
.dm-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 215, 0, 0.03) 50%,
    transparent 100%);
  transition: left 0.5s ease;
}

.dm-stat-card:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(255, 215, 0, 0.1),
              inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.dm-stat-card:hover::before {
  left: 100%;
}

.dm-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #ffd700;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  position: relative;
}

.dm-stat-label {
  font-size: 11px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.dm-quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dm-quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: linear-gradient(180deg,
    var(--surface-darker, #141414) 0%,
    rgba(255, 215, 0, 0.02) 100%);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Icon glow container */
.dm-quick-action-card .action-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.1);
  transition: all 0.2s ease;
}

.dm-quick-action-card:hover {
  background: linear-gradient(180deg,
    rgba(255, 215, 0, 0.1) 0%,
    rgba(255, 215, 0, 0.03) 100%);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3),
              0 0 25px rgba(255, 215, 0, 0.15);
}

.dm-quick-action-card:hover .action-icon-wrapper {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.dm-quick-action-card svg {
  width: 28px;
  height: 28px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.dm-quick-action-card:hover svg {
  opacity: 1;
  color: #ffd700;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* Action card label */
.dm-quick-action-card .action-label {
  text-align: center;
  line-height: 1.3;
}

.dm-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle, #222);
}

.dm-activity-item:last-child {
  border-bottom: none;
}

.dm-activity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  color: #ffd700;
}

.dm-activity-icon svg {
  width: 16px;
  height: 16px;
}

.dm-activity-content {
  flex: 1;
}

.dm-activity-text {
  font-size: 13px;
  color: var(--text-primary, #e5e5e5);
}

.dm-activity-time {
  font-size: 11px;
  color: var(--text-muted, #888);
}

/* =============================================================================
   Session Card Grid
   =============================================================================
   Card-based layout for session plans with status indicators
*/

.session-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.session-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-left: 4px solid var(--border-color, #6b7280);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.session-card:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: rgba(255, 215, 0, 0.5);
}

.session-card--selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.05);
}

/* Status-based left border colors */
.session-card--draft { border-left-color: #6b7280; }
.session-card--ready { border-left-color: #3b82f6; }
.session-card--in_progress { border-left-color: #22c55e; }
.session-card--completed { border-left-color: #a855f7; opacity: 0.8; }

.session-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
}

.session-card-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.session-status-badge--draft { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.session-status-badge--ready { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.session-status-badge--in_progress { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.session-status-badge--completed { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.session-card-progress {
  margin: 8px 0;
}

.progress-bar {
  height: 4px;
  background: var(--surface-hover, #2a2a2a);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ffed4a);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted, #888);
}

.session-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.session-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--surface-hover, #2a2a2a);
  border-radius: 3px;
  font-size: 10px;
  color: var(--text-secondary, #aaa);
}

.session-meta-badge svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.session-card-actions {
  display: none;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #333);
}

.session-card:hover .session-card-actions {
  display: flex;
}

.session-action-btn {
  flex: 1;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-secondary, #aaa);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.session-action-btn:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: #ffd700;
  color: #ffd700;
}

.session-action-btn--primary {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  color: #ffd700;
}

.session-action-btn--primary:hover {
  background: rgba(255, 215, 0, 0.2);
}

/* =============================================================================
   Lore Browser Badges & Icons
   =============================================================================
   Faction badges, NPC type icons, difficulty badges
*/

/* Faction badges */
.faction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Default faction styling */
.faction-badge {
  background: rgba(168, 139, 250, 0.15);
  color: #a78bfa;
}

/* Named faction colors */
.faction-badge--sandmere { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.faction-badge--crimson_tide { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.faction-badge--silver_hand { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.faction-badge--emerald_enclave { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.faction-badge--azure_consortium { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.faction-badge--shadow_guild { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

/* NPC type icons */
.npc-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
}

.npc-type-icon svg {
  width: 12px;
  height: 12px;
}

.npc-type-icon--ally {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.npc-type-icon--enemy {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.npc-type-icon--neutral {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.npc-type-icon--quest-giver {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

/* Difficulty badges */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.difficulty-badge svg {
  width: 12px;
  height: 12px;
}

.difficulty-badge--easy {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.difficulty-badge--medium {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.difficulty-badge--hard {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.difficulty-badge--deadly {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* District color indicators */
.district-indicator {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  flex-shrink: 0;
}

.district-indicator--market { background: #facc15; }
.district-indicator--docks { background: #60a5fa; }
.district-indicator--temple { background: #a78bfa; }
.district-indicator--noble { background: #f472b6; }
.district-indicator--slums { background: #6b7280; }
.district-indicator--magic { background: #c084fc; }
.district-indicator--guild { background: #4ade80; }

/* Location cards with district color */
.location-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.location-card:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: rgba(255, 215, 0, 0.3);
}

.location-card-content {
  flex: 1;
  min-width: 0;
}

.location-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
  margin: 0 0 4px;
}

.location-card-district {
  font-size: 11px;
  color: var(--text-muted, #888);
}

/* NPC cards with type icon and faction */
.npc-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.npc-card:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: rgba(255, 215, 0, 0.3);
}

.npc-card-content {
  flex: 1;
  min-width: 0;
}

.npc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.npc-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
  margin: 0;
}

.npc-card-role {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 6px;
}

.npc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Quest cards with difficulty */
.quest-card {
  padding: 14px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quest-card:hover {
  background: var(--surface-hover, #2a2a2a);
  border-color: rgba(255, 215, 0, 0.3);
}

.quest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.quest-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
  margin: 0;
  flex: 1;
}

.quest-card-description {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
  margin: 0 0 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quest-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quest-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted, #888);
}

.quest-meta-item svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

/* =============================================================================
   DM Tools Breadcrumb Navigation
   =============================================================================
   Breadcrumb navigation bar showing current location with "Return to Game" button.
   Replaces the mode tabs for a cleaner, more intuitive navigation pattern.
*/

.panel-dm-tools-breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-darker, #141414);
  border-bottom: 1px solid var(--border-color, #333);
  flex-shrink: 0;
}

.dm-breadcrumb-nav {
  flex: 1;
  min-width: 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-link {
  color: var(--text-muted, #888);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.breadcrumb-link:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.breadcrumb-link.active {
  color: #ffd700;
}

.breadcrumb-current {
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
}

.breadcrumb-separator {
  color: var(--text-muted, #666);
  font-size: 11px;
  padding: 0 2px;
  user-select: none;
}

/* Compact mode for smaller screens */
@media (max-width: 400px) {
  .panel-dm-tools-breadcrumb {
    padding: 8px 12px;
  }

  .breadcrumb-link,
  .breadcrumb-current {
    font-size: 12px;
    padding: 3px 6px;
  }
}

/* =============================================================================
   DM Button System
   =============================================================================
   Unified button styling for all DM Tools panels.
   Use these classes for consistent button appearance across the DM workspace.
*/

/* Base button - default state */
.dm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-terminal, 'JetBrains Mono', monospace);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dm-btn:hover {
  border-color: #ffd700;
  color: var(--text-primary, #e5e5e5);
  background: var(--surface-hover, #2a2a2a);
}

.dm-btn:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.dm-btn:active {
  transform: translateY(1px);
}

.dm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button - gold highlight for main actions */
.dm-btn--primary {
  background: #ffd700;
  border-color: #ffd700;
  color: #1a1a1a;
  font-weight: 600;
}

.dm-btn--primary:hover {
  background: #ffed4a;
  border-color: #ffed4a;
  color: #1a1a1a;
}

/* Secondary button - subtle background */
.dm-btn--secondary {
  background: var(--surface-darker, #141414);
}

.dm-btn--secondary:hover {
  background: var(--surface-hover, #2a2a2a);
}

/* Danger button - for destructive actions */
.dm-btn--danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.dm-btn--danger:hover {
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Ghost button - minimal styling */
.dm-btn--ghost {
  border-color: transparent;
  background: transparent;
}

.dm-btn--ghost:hover {
  border-color: transparent;
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

/* Size variants */
.dm-btn--small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  gap: 0.25rem;
}

.dm-btn--large {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Icon-only button */
.dm-btn--icon {
  padding: 0.375rem;
  width: 2rem;
  height: 2rem;
}

.dm-btn--icon.dm-btn--small {
  padding: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
}

.dm-btn--icon.dm-btn--large {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

/* Button with icon */
.dm-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.dm-btn--small svg {
  width: 0.75rem;
  height: 0.75rem;
}

.dm-btn--large svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Button group - for adjacent buttons */
.dm-btn-group {
  display: inline-flex;
  gap: 0;
}

.dm-btn-group .dm-btn {
  border-radius: 0;
}

.dm-btn-group .dm-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.dm-btn-group .dm-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.dm-btn-group .dm-btn:not(:last-child) {
  border-right-width: 0;
}

.dm-btn-group .dm-btn:not(:last-child):hover {
  border-right-width: 1px;
  margin-right: -1px;
}

/* Full-width button */
.dm-btn--block {
  width: 100%;
}

/* Loading state */
.dm-btn--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.dm-btn--loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dm-btn-spin 0.6s linear infinite;
}

@keyframes dm-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   DM Panel Context Header
   =============================================================================
   Consistent header for showing current context within a panel
*/

.dm-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-darker, #141414);
  border-bottom: 1px solid var(--border-color, #333);
}

.dm-context-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #ffd700;
  margin: 0;
}

.dm-context-title svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.dm-context-subtitle {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin: 4px 0 0;
}

.dm-context-actions {
  display: flex;
  gap: 8px;
}

/* =============================================================================
   Campaign Rules Panel
   ============================================================================= */

.panel-campaign-rules {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-dark, #1a1a1a);
  color: var(--text-primary, #e5e5e5);
}

.campaign-rules-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  background: linear-gradient(180deg,
    rgba(255, 215, 0, 0.08) 0%,
    rgba(255, 215, 0, 0.02) 50%,
    var(--surface-darker, #141414) 100%);
}

.campaign-rules-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Campaign Name Input */
.campaign-name-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.campaign-name-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-darker, #141414);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  color: var(--text-primary, #e5e5e5);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.campaign-name-input:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2),
              0 0 20px rgba(255, 215, 0, 0.1);
}

.campaign-name-input::placeholder {
  color: var(--text-muted, #888);
}

/* Campaign Rules Footer */
.campaign-rules-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  background: linear-gradient(180deg,
    var(--surface-darker, #141414) 0%,
    rgba(255, 215, 0, 0.03) 100%);
}

/* =============================================================================
   Unified Lore Browser Panel
   =============================================================================
   Tree-based world lore browser with world selection, expandable folders,
   character discoveries, and world events.
*/

.panel-lore-browser-unified {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-dark, #1a1a1a);
  color: var(--text-primary, #e5e5e5);
}

.lore-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  background: linear-gradient(180deg,
    rgba(255, 215, 0, 0.08) 0%,
    rgba(255, 215, 0, 0.02) 50%,
    var(--surface-darker, #141414) 100%);
}

.lore-panel-header .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.lore-panel-header .panel-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.lore-panel-header .panel-icon svg {
  width: 100%;
  height: 100%;
}

.lore-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* World Selector */
.lore-world-selector {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.lore-world-selector .selector-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted, #888);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lore-world-selector .world-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.lore-world-selector .world-select:focus {
  outline: none;
  border-color: #ffd700;
}

/* Lore Sections */
.lore-section {
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  overflow: hidden;
}

.lore-section .section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-darker, #141414);
  cursor: pointer;
  transition: background 0.15s ease;
}

.lore-section .section-header:hover {
  background: rgba(255, 215, 0, 0.05);
}

.lore-section .section-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: #ffd700;
  opacity: 0.8;
}

.lore-section .section-icon svg {
  width: 100%;
  height: 100%;
}

.lore-section .section-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e5e5e5);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lore-section .section-toggle {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--text-muted, #888);
  transition: transform 0.2s ease;
}

.lore-section .section-toggle svg {
  width: 100%;
  height: 100%;
}

.lore-section .section-content {
  padding: 8px;
  background: var(--surface-dark, #1a1a1a);
  max-height: 400px;
  overflow-y: auto;
}

.lore-section .section-content.collapsed {
  display: none;
}

/* Count badges */
.discovery-count,
.event-count {
  padding: 2px 8px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  font-size: 11px;
  color: #ffd700;
  font-weight: 600;
}

/* Tree Structure */
.lore-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-folder {
  margin-bottom: 4px;
}

.tree-folder .folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tree-folder .folder-header:hover {
  background: rgba(255, 215, 0, 0.05);
}

.tree-folder .folder-toggle {
  font-size: 10px;
  color: var(--text-muted, #888);
  width: 12px;
  text-align: center;
}

.tree-folder .folder-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: #ffd700;
  opacity: 0.7;
}

.tree-folder .folder-icon svg {
  width: 100%;
  height: 100%;
}

.tree-folder .folder-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #e5e5e5);
}

.tree-folder .folder-count {
  padding: 2px 6px;
  background: var(--surface-darker, #141414);
  border-radius: 8px;
  font-size: 10px;
  color: var(--text-muted, #888);
}

/* Folder Contents */
.folder-contents {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  display: none;
}

.tree-folder.expanded .folder-contents {
  display: block;
}

/* Tree Items */
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tree-item:hover {
  background: rgba(255, 215, 0, 0.08);
}

.tree-item .item-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary, #e5e5e5);
}

.tree-item .item-subtitle {
  font-size: 10px;
  color: var(--text-muted, #888);
}

/* Subfolders (e.g., districts) */
.tree-subfolder {
  margin-bottom: 4px;
}

.tree-subfolder .subfolder-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary, #aaa);
  transition: background 0.15s ease;
}

.tree-subfolder .subfolder-header:hover {
  background: rgba(255, 215, 0, 0.05);
}

.tree-subfolder .subfolder-toggle {
  font-size: 9px;
  width: 10px;
  text-align: center;
}

.tree-subfolder .subfolder-name {
  font-weight: 500;
}

.subfolder-contents {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
}

.subfolder-contents.collapsed {
  display: none;
}

/* Loading & Empty States */
.tree-loading,
.tree-error,
.empty-state {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #888);
}

.tree-loading .loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color, #333);
  border-top-color: #ffd700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-item,
.error-item,
.empty-item {
  padding: 8px;
  font-size: 11px;
  color: var(--text-muted, #888);
}

.error-item {
  color: #f87171;
}

/* Discoveries List */
.discoveries-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.discovery-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: var(--surface-darker, #141414);
}

.discovery-item .discovery-type {
  font-size: 9px;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.discovery-item .discovery-summary {
  font-size: 12px;
  color: var(--text-primary, #e5e5e5);
}

.discovery-item .discovery-date {
  font-size: 10px;
  color: var(--text-muted, #888);
}

/* Events List */
.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: var(--surface-darker, #141414);
  border-left: 3px solid var(--border-color, #333);
}

.event-item[data-visibility="public"] {
  border-left-color: #4ade80;
}

.event-item[data-visibility="rumor"] {
  border-left-color: #facc15;
}

.event-item[data-visibility="witnessed"] {
  border-left-color: #60a5fa;
}

.event-item .event-type {
  font-size: 9px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-item .event-description {
  font-size: 12px;
  color: var(--text-primary, #e5e5e5);
}

.event-item .event-date {
  font-size: 10px;
  color: var(--text-muted, #888);
}

/* Detail View */
.lore-detail-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-dark, #1a1a1a);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.lore-detail-view.hidden {
  display: none;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #333);
  background: var(--surface-darker, #141414);
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-secondary, #aaa);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.detail-back-btn:hover {
  border-color: #ffd700;
  color: #ffd700;
}

.detail-back-btn svg {
  width: 14px;
  height: 14px;
}

.detail-type {
  font-size: 10px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.detail-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #ffd700;
}

.detail-description {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary, #aaa);
  line-height: 1.5;
}

.detail-field {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-primary, #e5e5e5);
}

.detail-field strong {
  color: var(--text-muted, #888);
  margin-right: 6px;
}

.detail-features {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-primary, #e5e5e5);
}

.detail-features strong {
  color: var(--text-muted, #888);
  display: block;
  margin-bottom: 6px;
}

.detail-features ul {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: disc;
}

.detail-features li {
  margin-bottom: 4px;
  color: var(--text-secondary, #aaa);
}

/* -----------------------------------------------------------------------------
   Search Container
   -------------------------------------------------------------------------- */
.lore-search-container {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
}

.lore-search-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface-darker, #141414);
  border: 1px solid var(--border-color, #333);
  border-radius: 4px;
  color: var(--text-primary, #e5e5e5);
  font-size: 12px;
  font-family: inherit;
}

.lore-search-input:focus {
  outline: none;
  border-color: #ffd700;
}

.lore-search-input::placeholder {
  color: var(--text-muted, #888);
}

.lore-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  color: #ffd700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lore-search-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.lore-search-btn svg {
  width: 14px;
  height: 14px;
}

/* -----------------------------------------------------------------------------
   Search Results
   -------------------------------------------------------------------------- */
.lore-search-results {
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  background: var(--surface-darker, #141414);
  overflow: hidden;
  margin-bottom: 8px;
}

.lore-search-results.hidden {
  display: none;
}

.search-loading,
.search-error,
.search-empty {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #888);
}

.search-error {
  color: #f87171;
}

.search-header {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted, #888);
  border-bottom: 1px solid var(--border-color, #333);
  background: var(--surface-dark, #1a1a1a);
}

.search-results-list {
  max-height: 200px;
  overflow-y: auto;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-subtle, #222);
}

.search-result-card:last-child {
  border-bottom: none;
}

.search-result-card:hover {
  background: rgba(255, 215, 0, 0.08);
}

.result-type-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.result-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #e5e5e5);
}

.result-desc {
  width: 100%;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted, #888);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Breadcrumb Navigation
   -------------------------------------------------------------------------- */
.lore-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 6px 0;
  min-height: 24px;
}

.lore-breadcrumb:empty {
  display: none;
}

.breadcrumb-item {
  font-size: 11px;
  color: var(--text-muted, #888);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.breadcrumb-item:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.breadcrumb-item.active {
  color: var(--text-primary, #e5e5e5);
  cursor: default;
}

.breadcrumb-item.active:hover {
  background: transparent;
  color: var(--text-primary, #e5e5e5);
}

/* -----------------------------------------------------------------------------
   Related Entities Section
   -------------------------------------------------------------------------- */
.related-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #333);
}

.related-section strong {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.related-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* -----------------------------------------------------------------------------
   Quick Actions Section
   -------------------------------------------------------------------------- */
.quick-actions-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #333);
}

.quick-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-action-btn {
  padding: 6px 12px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  color: #ffd700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-action-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

/* -----------------------------------------------------------------------------
   Clickable References in Detail View
   -------------------------------------------------------------------------- */
.lore-clickable {
  color: #ffd700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: all 0.15s ease;
}

.lore-clickable:hover {
  color: #ffed4a;
  text-decoration-style: solid;
}

/* -----------------------------------------------------------------------------
   Type Badges (for search results and related entities)
   -------------------------------------------------------------------------- */
.lore-type-npc {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.lore-type-location {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.lore-type-faction {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.lore-type-quest {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

.lore-type-creature {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.lore-type-magic_item,
.lore-type-item {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

.lore-type-unknown {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}
