/* ==========================================================================
   SSB TAT Interactive Reference & Visualization Suite - Stylesheet
   Design System: Modern Glassmorphism & High-Contrast Military/Aviation Slate
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Color Palette - Premium Dark Mode (Default) */
  --bg-primary: #0a0f1d;
  --bg-secondary: #11192e;
  --bg-tertiary: #17233f;
  --bg-surface: rgba(23, 35, 63, 0.7);
  --bg-surface-hover: rgba(32, 49, 87, 0.85);
  --bg-glass: rgba(17, 25, 46, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Tactical Accents */
  --accent-primary: #6366f1;       /* Indigo / Decision */
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #06b6d4;     /* Cyan / Coordination */
  --accent-success: #10b981;       /* Emerald / Execution */
  --accent-warning: #f59e0b;       /* Amber / Caution */
  --accent-danger: #ef4444;        /* Crimson / Crisis */
  --accent-purple: #8b5cf6;       /* Violet / Leadership */
  --accent-military: #14b8a6;      /* Teal / Service */

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-surface-hover: rgba(241, 245, 249, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmospheric Mesh */
.bg-grid-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Layout Container */
.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

/* Header & Top Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
  margin: 0 -1.5rem 1.5rem -1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  letter-spacing: 1px;
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-titles p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

/* Quick Stats Bar */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-secondary); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.stat-info h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.stat-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Nav Tabs */
.nav-tabs-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  min-width: max-content;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

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

.nav-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.tab-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Main Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Tab 1: Blueprint & Methodology (The 7-Step Action Engine & OLQs)
   ========================================================================== */
.blueprint-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.blueprint-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 840px;
  line-height: 1.7;
}

/* 7-Step Action Logic Stepper */
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.stepper-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
  position: relative;
}

.stepper-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  position: relative;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.stepper-card:hover, .stepper-card.active {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.step-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.step-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.step-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Interactive Action Step Compare Box */
.action-compare-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 840px) {
  .action-compare-box {
    grid-template-columns: 1fr;
  }
}

.compare-col {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.compare-col.blunder {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.compare-col.officer {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.compare-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
}

.compare-col.blunder .compare-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.compare-col.officer .compare-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* 4 Factor Groups of OLQs */
.factor-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.factor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.factor-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.factor-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent-secondary);
}

.factor-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.olq-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.olq-chip {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.olq-chip:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* 3 Practice Patterns Banner */
.patterns-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.pattern-banner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border-left: 4px solid var(--accent-primary);
}

.pattern-banner-card.crisis {
  border-left-color: var(--accent-danger);
}

.pattern-banner-card.team {
  border-left-color: var(--accent-secondary);
}

/* ==========================================================================
   Tab 2: Interactive Logic Knowledge Graph
   ========================================================================== */
.graph-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 780px;
}

.graph-toolbar {
  padding: 0.85rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  z-index: 10;
}

.graph-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.graph-select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.graph-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  cursor: grab;
}

.graph-viewport:active {
  cursor: grabbing;
}

#knowledgeGraphCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Graph Floating Inspector */
.graph-inspector {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 340px;
  max-height: 480px;
  overflow-y: auto;
  background: rgba(17, 25, 46, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  display: none;
}

/* ==========================================================================
   Tab 3: 459 Professions Matrix & Explorer
   ========================================================================== */
.explorer-search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: var(--radius-lg);
  outline: none;
  transition: var(--transition-normal);
}

.search-input-wrap input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Domain Chips Scroller */
.domain-chips-scroller {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.domain-chip {
  white-space: nowrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.domain-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.domain-chip.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* Professions Grid */
.professions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.profession-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.profession-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.prof-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.prof-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.prof-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.prof-domain-badge {
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.prof-env {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.prof-action-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prof-olq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prof-olq-tag {
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Pagination / Results Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
}

.btn-page {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Modal View for Profession Deep-Dive */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Tab 4: 25-Scenario TAT Situation Bank (Part III)
   ========================================================================== */
.situation-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.situation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.situation-card:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sit-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 0.4rem;
}

.sit-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.sit-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.sit-flow-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-secondary);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Tab 5: Timed TAT Practice Simulator & Self-Evaluation Engine
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 1024px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.stimulus-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stimulus-image-wrap {
  width: 100%;
  height: 380px;
  position: relative;
  background: #000;
}

.stimulus-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.observation-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity var(--transition-normal);
}

.observation-timer-text {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

.stimulus-details {
  padding: 1.5rem;
}

.stimulus-selector-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-top: 1rem;
  padding-bottom: 0.5rem;
}

.stimulus-thumb {
  width: 72px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.stimulus-thumb.active {
  border-color: var(--accent-primary);
  opacity: 1;
}

.stimulus-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Story Writing Workspace */
.writing-workspace-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.writing-timer-badge {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.writing-timer-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-warning);
}

.writing-timer-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.story-textarea {
  width: 100%;
  height: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  line-height: 1.6;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  resize: vertical;
  outline: none;
  margin-bottom: 1rem;
  transition: var(--transition-normal);
}

.story-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.writing-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: var(--transition-fast);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Evaluation Radar & Checklist in Simulator */
.evaluation-results-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-top: 2rem;
  display: none;
}

.eval-score-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.eval-score-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-success);
}

/* ==========================================================================
   Tab 6: Master Checklist & Pitfalls (Part IV)
   ========================================================================== */
.checklist-container {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .checklist-container {
    grid-template-columns: 1fr;
  }
}

.checklist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.check-checkbox {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  accent-color: var(--accent-primary);
  margin-top: 0.2rem;
  cursor: pointer;
}

.check-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.pitfall-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Footer */
.app-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.app-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

/* ==========================================================================
   Multi-Mode Simulator (Stage 1 PPDT, Stage 2 TAT, 12-Slide Continuous Battery)
   ========================================================================== */

.simulator-mode-bar {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.simulator-mode-btn {
  flex: 1;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.simulator-mode-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.simulator-mode-btn.active {
  background: var(--bg-tertiary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-focus);
}

/* Battery Progress Bar */
.battery-progress-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.battery-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.battery-slide-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.battery-status-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.battery-track {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.battery-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Stimulus Actions & Category Bar */
.stimulus-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stimulus-chips-wrap {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  flex: 1;
}

.stimulus-category-chip {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.stimulus-category-chip:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.stimulus-category-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.stimulus-quick-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

/* Stage-1 PPDT Interactive Box */
.ppdt-workspace-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.ppdt-box-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  gap: 1rem;
}

.ppdt-box-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: center;
}

@media (max-width: 640px) {
  .ppdt-box-grid {
    grid-template-columns: 1fr;
  }
}

.ppdt-interactive-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 240px;
  background: var(--bg-tertiary);
  border: 2px dashed rgba(6, 182, 212, 0.45);
  border-radius: var(--radius-md);
  cursor: crosshair;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-fast);
}

.ppdt-interactive-box:hover {
  border-color: var(--accent-secondary);
}

.ppdt-interactive-box::before {
  content: "CLICK TO PLOT";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  opacity: 0.4;
  pointer-events: none;
}

.ppdt-token {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  user-select: none;
  cursor: grab;
}

.ppdt-token.is-hero {
  border: 2px solid var(--accent-success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.15);
}

.token-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.token-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.token-del-btn:hover {
  color: var(--accent-danger);
}

.ppdt-box-guidelines {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 3px solid var(--accent-secondary);
}

/* ==========================================================================
   SSB Intel & Resource Library Styles
   ========================================================================== */

.intel-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.intel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

.intel-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.intel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.intel-badge-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.intel-stage-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.intel-highlight-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-success);
}

.intel-size {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.intel-card-body {
  flex: 1;
  margin-bottom: 1.25rem;
}

.intel-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.intel-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 0.5rem;
}

.intel-card-footer {
  display: flex;
  gap: 0.65rem;
}

.intel-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.intel-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.intel-btn-download:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

