/* Base Styles */
body {
  background-color: #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
               Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
}

/* Layout */
.app-container {
  max-width: 95vw;
  margin: 0 auto;
  padding: 0.5rem;
}

/* Project Name Section */
.project-name-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.project-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  white-space: nowrap;
}

.project-input {
  flex: 1;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* RESOURCE FLOW TAB - THREE COLUMN LAYOUT */
.mechanic-sections {
  display: flex !important;
  gap: 15px !important;
  margin: 20px 0 !important;
}

.mechanic-section {
  flex: 1 !important;
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.section-header {
  color: white !important;
  padding: 12px 16px !important;
  text-align: center !important;
  font-weight: 600 !important;
  margin: 0 !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.core-header {
  background: #3b82f6 !important;
}

.progression-header {
  background: #10b981 !important;
}

.meta-header {
  background: #f59e0b !important;
}

.mechanic-boxes {
  padding: 16px !important;
  min-height: 300px !important;
  background: #f8f9fa !important;
}

.mechanic-box {
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 12px !important;
  margin-bottom: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Resource Flow Tab Resource Badges - Light Colors Like Resources Tab */
.resource-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 4px 8px !important;
  margin: 2px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  color: #495057 !important;
}

.resource-label {
  font-weight: 600 !important;
  color: #6c757d !important;
}

.resource-value {
  font-weight: 500 !important;
  color: #212529 !important;
  font-family: monospace !important;
}

/* RESOURCE FLOW ANALYSIS - NEW LAYOUT */
.resource-flow-analysis {
  margin-top: 50px !important;
  padding: 30px !important;
  background: white !important;
  border-radius: 15px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.flow-boxes {
  display: flex !important;
  align-items: center !important;
  min-height: 120px !important;
  background: white !important;
}

.producers-box {
  flex: 2 !important;
  padding: 25px !important;
  background: linear-gradient(135deg, #c6f6d5, #9ae6b4) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.flow-arrow {
  flex: 0 0 80px !important;
  text-align: center !important;
  font-size: 36px !important;
  font-weight: 900 !important;
  color: #4299e1 !important;
  background: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.resource-header {
  flex: 1 !important;
  background: linear-gradient(45deg, #4facfe, #00f2fe) !important;
  padding: 20px !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.resource-name {
  font-weight: 800 !important;
  font-size: 24px !important;
  color: white !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
}

.consumers-box {
  flex: 2 !important;
  padding: 25px !important;
  background: linear-gradient(135deg, #fed7d7, #feb2b2) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* Typography */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.app-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.noor-logo {
  height: 75px;
  width: auto;
  object-fit: contain;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #e5e7eb;
  color: #374151;
  border: none;
  margin-right: 0.25rem;
}

.tab-btn.active {
  background-color: #3b82f6;
  color: white;
}

/* Tab Content */
.tab-panel {
  display: none;
  background-color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background-color 0.2s;
  color: white;
  border: none;
  cursor: pointer;
}

.btn-green {
  background-color: #10b981;
}

.btn-green:hover {
  background-color: #059669;
}

.btn-blue {
  background-color: #3b82f6;
}

.btn-blue:hover {
  background-color: #2563eb;
}

.btn-red {
  background-color: #ef4444;
}

.btn-red:hover {
  background-color: #dc2626;
}

.btn-gray {
  background-color: #6c757d;
}

.btn-gray:hover {
  background-color: #5a6268;
}

/* Column visibility controls */
.column-visibility-panel {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.column-visibility-panel h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
}

.column-toggle {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

.column-toggle input[type="checkbox"] {
  margin-right: 8px;
}

.column-toggle label {
  cursor: pointer;
  font-size: 13px;
}

/* Hidden column styling */
.hidden-column {
  display: none !important;
}

/* Ensure proper table layout when columns are hidden */
#mechanicsTable {
  border-collapse: collapse;
  width: 100%;
}

#mechanicsTable th,
#mechanicsTable td {
  position: relative;
}

/* Ensure Select2 dropdowns fill their column width */
#mechanicsTable .select2-container {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

#mechanicsTable .select2-selection {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Auto-resize table styling */
.auto-resize-table {
  table-layout: auto;
}

.auto-resize-table th,
.auto-resize-table td {
  width: auto;
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hidden {
  display: none;
}

/* Resource Section */
.resource-section {
  margin-bottom: 1.5rem;
}

.resource-input-group {
  display: flex;
  gap: 1rem;
}

.resource-input {
  border: 1px solid #d1d5db;
  padding: 0.5rem;
  border-radius: 0.375rem;
  flex-grow: 1;
  outline: none;
}

.resource-input.limited-width {
  max-width: 300px;
  flex-grow: 0;
}

.resource-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Table Styles */
.table-container {
  max-width: 100%;
  overflow-x: auto;
}

#mechanicsTable {
  min-width: 1200px;
  border-collapse: collapse;
  table-layout: auto;
}

#mechanicsTable th, 
#mechanicsTable td {
  border: 1px solid #d1d5db;
  padding: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Specific column widths */
#mechanicsTable th:first-child,
#mechanicsTable td:first-child {
  width: 60px;
  min-width: 60px;
}

#mechanicsTable th.system,
#mechanicsTable td.system {
  width: 120px;
  min-width: 120px;
}

#mechanicsTable th.mechanic,
#mechanicsTable td.mechanic {
  width: 150px;
  min-width: 150px;
}

#mechanicsTable th.location,
#mechanicsTable td.location {
  width: 120px;
  min-width: 120px;
}

#mechanicsTable th.resource,
#mechanicsTable td.resource {
  width: 160px;
  min-width: 160px;
}

#mechanicsTable th.progression,
#mechanicsTable td.progression {
  width: 100px;
  min-width: 100px;
}

#mechanicsTable th.description,
#mechanicsTable td.description {
  width: 300px;
  min-width: 300px;
}

/* Sticky table headers and frozen columns */
#mechanicsTable {
  position: relative;
}

/* Sticky header row */
#mechanicsTable thead th {
  position: sticky;
  top: 0;
  background-color: #e5e7eb;
  z-index: 10;
  border: 1px solid #d1d5db;
}

/* Frozen left columns - Number column */
#mechanicsTable th:nth-child(1),
#mechanicsTable td:nth-child(1) {
  position: sticky;
  left: 0;
  background-color: #f9fafb;
  z-index: 5;
  border-right: 2px solid #9ca3af;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

/* Frozen left columns - System column */
#mechanicsTable th:nth-child(2),
#mechanicsTable td:nth-child(2) {
  position: sticky;
  left: 80px; /* Width of number column */
  background-color: #f9fafb;
  z-index: 5;
  border-right: 2px solid #9ca3af;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* Frozen left columns - Mechanic column */
#mechanicsTable th:nth-child(3),
#mechanicsTable td:nth-child(3) {
  position: sticky;
  left: 200px; /* Number + System width */
  background-color: #f9fafb;
  z-index: 5;
  border-right: 2px solid #9ca3af;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

/* Header intersection with frozen columns - higher z-index */
#mechanicsTable thead th:nth-child(1),
#mechanicsTable thead th:nth-child(2),
#mechanicsTable thead th:nth-child(3) {
  z-index: 15;
  background-color: #e5e7eb;
}

/* Table container with scroll */
.table-container {
  overflow: auto;
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Remove sticky first row styling - only header should be sticky */

th.system, th.mechanic, th.location, 
th.progression, th.description, th.resource {
  background-color: #e5e7eb;
}

/* Mechanic Type Colors - Higher specificity for Select2 */
.select2-container--default .select2-selection--single.mechanic-type-core {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  border-color: #3b82f6 !important;
}

.select2-container--default .select2-selection--single.mechanic-type-progression {
  background-color: #dcfce7 !important;
  color: #166534 !important;
  border-color: #16a34a !important;
}

.select2-container--default .select2-selection--single.mechanic-type-meta {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border-color: #ca8a04 !important;
}

.select2-container--default .select2-selection--single.mechanic-type-monetization {
  background-color: #fce7f3 !important;
  color: #be185d !important;
  border-color: #ec4899 !important;
}

/* Resources Tab Styles */
.resources-tables-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resource-section {
  margin-bottom: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.resource-title {
  background-color: #f3f4f6;
  padding: 1rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.resources-table th, 
.resources-table td {
  border: 1px solid #d1d5db;
  padding: 0.75rem;
  box-sizing: border-box;
  word-wrap: break-word;
  vertical-align: top;
}

/* Two column layout by default */
.resources-table th,
.resources-table td {
  width: 50%;
}

/* Three column layout when requirements exist */
.resources-table tr:has(.requires-header) th,
.resources-table tr:has(.requires-cell) td {
  width: 33.33%;
}

.source-header {
  background-color: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.drain-header {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 600;
}

.requires-header {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.mechanic-display {
  padding: 0.25rem 0;
}

.mechanic-name {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.mechanic-details {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.2;
}

/* Resource Flow Analysis Styles */
.resource-flow-analysis {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.flow-analysis-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  text-align: center;
}

.flow-analysis-description {
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  text-align: center;
}

.flow-section {
  margin-bottom: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.flow-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #374151;
  text-align: center;
  padding: 0.5rem;
  border-radius: 6px;
}

.core-to-progression .flow-section-title {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 2px solid #059669;
}

.progression-to-core .flow-section-title {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  border: 2px solid #7c3aed;
}

.flow-section-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  text-align: center;
  font-style: italic;
}

.no-flows {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 6px;
  border: 2px dashed #d1d5db;
}

.flows-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flow-item {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.flow-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #059669, #7c3aed);
}

.flow-resource-header {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: center;
  background: #f3f4f6;
  padding: 0.5rem;
  border-radius: 6px;
  border-left: 4px solid #3b82f6;
}

.flow-visual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.flow-side {
  flex: 1;
  text-align: center;
}

.flow-arrow {
  flex: 0 0 auto;
  font-size: 2rem;
  color: #3b82f6;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

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

.flow-mechanics-box {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.producers-box {
  border-color: #059669;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.consumers-box {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.flow-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.producers-box .flow-label {
  color: #065f46;
}

.consumers-box .flow-label {
  color: #991b1b;
}

.flow-mechanic-name {
  font-weight: 500;
  margin: 0.25rem 0;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  font-size: 0.875rem;
}

.producers-box .flow-mechanic-name {
  color: #059669;
  border-left: 3px solid #059669;
}

.consumers-box .flow-mechanic-name {
  color: #dc2626;
  border-left: 3px solid #dc2626;
}

.mechanic-name {
  font-weight: 600;
  color: #1f2937;
  margin-right: 0.5rem;
}

.resource-symbol {
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.resource-symbol.benefit {
  background-color: #d1fae5;
  color: #065f46;
}

.resource-symbol.cost {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Dependency Chain Visualization */
.dependency-container {
  padding: 1rem;
}

.dependency-visualization {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dependency-chain {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.resource-title {
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  text-align: center;
}

.flow-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.flow-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.flow-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  margin: 0;
}

.flow-title.produce {
  background-color: #d1fae5;
  color: #065f46;
}

.flow-title.consume {
  background-color: #fee2e2;
  color: #991b1b;
}

.flow-title.requires {
  background-color: #dbeafe;
  color: #1e40af;
}

.mechanic-box {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 60px;
}

.mechanic-box.producer {
  border-left: 3px solid #10b981;
}

.mechanic-box.consumer {
  border-left: 3px solid #ef4444;
}

.mechanic-box.requirement {
  border-left: 3px solid #3b82f6;
}

.flow-section.requirements {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 2px solid #60a5fa;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
}

.system-tag {
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  align-self: flex-start;
}

.resource-flow {
  font-weight: 700;
  font-size: 0.875rem;
}

.flow-arrow {
  font-size: 1.5rem;
  color: #6b7280;
  font-weight: bold;
}

.resource-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-weight: 600;
  text-align: center;
  min-width: 80px;
}

.no-mechanics {
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.25rem;
}

.balance-info {
  padding: 0.75rem;
  border-radius: 0.375rem;
  text-align: center;
  font-weight: 500;
  margin-top: 1rem;
}

.balance-info.balanced {
  background-color: #d1fae5;
  color: #065f46;
}

.balance-info.warning {
  background-color: #fef3cd;
  color: #92400e;
}

.balance-info.info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Enhanced Analysis Section */
.analysis-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.analysis-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-align: center;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.analysis-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
}

.card-title {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  text-align: center;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.metric-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  cursor: help;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.metric-label:hover {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

.metric-value {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.metrics-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.insight-text {
  color: white;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  border-left: 3px solid #60a5fa;
}

.recommendation-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.25rem;
  border-left: 3px solid #fbbf24;
  margin-bottom: 0.5rem;
}

.chain-example {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.25rem;
  border-left: 3px solid #10b981;
}

/* Systems Tab Styles */
.systems-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  padding: 20px;
  align-items: start;
}

.system-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: fit-content;
  overflow: hidden;
}

.system-header {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 0;
  text-align: left;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.mechanics-label {
  margin-bottom: 0;
  text-align: left;
  background: linear-gradient(to right, #f8fafc, #f1f5f9);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 500;
}

.system-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background: #fafbfc;
}

.mechanic-item {
  padding: 1rem;
  background: white;
  border: none;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mechanic-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mechanic-item strong {
  color: #1e293b;
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.mechanic-info-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
  align-items: center;
}

.mechanic-location {
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: #eff6ff;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #bfdbfe;
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.mechanic-type {
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: #fef2f2;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #fecaca;
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.mechanic-description {
  color: #374151;
  font-size: 0.875rem;
  text-align: left;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  border-left: 3px solid #d1d5db;
}

.resource-info {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: #f3f4f6;
  border-radius: 4px;
  border-left: 3px solid #7c3aed;
}

.resource-info small {
  color: #7c3aed;
  font-weight: 500;
  font-size: 0.875rem;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .systems-container {
    grid-template-columns: 1fr;
  }
}

/* Mind Map Styles */
.mindmap-controls {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.mindmap-controls {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.mindmap-controls .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mindmap-controls .btn-primary {
  background-color: #007bff;
  color: white;
}

.mindmap-controls .btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.mindmap-controls .btn-secondary {
  background-color: #6c757d;
  color: white;
}

.mindmap-controls .btn-secondary:hover {
  background-color: #545b62;
  transform: translateY(-1px);
}

.resource-filters {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.resource-filters h4 {
  margin: 0 0 0.5rem 0;
  color: #495057;
}

.filter-actions {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  border: 1px solid #495057;
  background: #6c757d;
  color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.btn-small:hover {
  background: #5a6268;
  border-color: #343a40;
}

#filter-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-item input[type="checkbox"] {
  margin: 0;
}

.filter-item label {
  margin: 0;
  cursor: pointer;
  font-size: 14px;
}

.mindmap-legend {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 12px;
  max-height: 70vh;
  overflow-y: auto;
  min-width: 180px;
  cursor: grab;
  user-select: none;
  z-index: 1000;
}

.mindmap-legend:active {
  cursor: grabbing;
}

.legend-section {
  margin-bottom: 12px;
}

.legend-section h5 {
  margin: 0 0 6px 0;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 3px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.legend-box {
  width: 16px;
  height: 16px;
  border: 2px solid;
  border-radius: 3px;
}

.legend-box.resource {
  background: #e3f2fd;
  border-color: #1976d2;
}

.legend-box.mechanic-core {
  background: #f3e5f5;
  border-color: #7b1fa2;
}

.legend-box.mechanic-progression {
  background: #e8f5e8;
  border-color: #388e3c;
}

.legend-box.mechanic-meta {
  background: #fff3e0;
  border-color: #f57c00;
}

.legend-arrow-solid {
  width: 20px;
  height: 2px;
  background: #666;
  position: relative;
}

.legend-arrow-solid::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 0;
  height: 0;
  border-left: 6px solid #666;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.legend-arrow-dashed {
  width: 20px;
  height: 2px;
  background: linear-gradient(to right, #666 50%, transparent 50%);
  background-size: 4px 2px;
  position: relative;
}

.legend-arrow-dashed::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 0;
  height: 0;
  border-left: 6px solid #666;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* Game Loop Styles */
.game-loop-container {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.game-loop-column {
  flex: 1;
  min-width: 300px;
}

.column-title {
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: white;
}

.column-title.core-mechanics {
  background-color: #6366f1;
}

.column-title.progression-mechanics {
  background-color: #10b981;
}

.monetization-header {
  background-color: #d32f2f;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.mechanic-sections-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mechanic-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .mechanic-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.mechanics-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mechanic-box {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid #e5e7eb;
}

.mechanic-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mechanic-box.core {
  border-left-color: #6366f1;
}

.mechanic-box.progression {
  border-left-color: #10b981;
}

.mechanic-box.meta {
  border-left-color: #e65100;
}

.mechanic-box.monetization {
  border-left-color: #d32f2f;
}

.mechanic-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.mechanic-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mechanic-system {
  background-color: #ddd6fe;
  color: #5b21b6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.mechanic-location {
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.mechanic-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.resource-tag {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.resource-tag.benefit {
  background-color: #d1fae5;
  color: #065f46;
}

.resource-tag.cost {
  background-color: #fee2e2;
  color: #991b1b;
}

.empty-state {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
  background-color: #f9fafb;
}

/* Settings Tab Styles */
.settings-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.settings-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f8fafc;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}

.subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.warning-text {
  font-size: 0.875rem;
  color: #dc2626;
  margin-top: 0.75rem;
  font-style: italic;
}

.info-text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* Documentation Styles */
.documentation-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tab-doc {
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.tab-doc-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.tab-doc-text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* License Styles */
.license-content {
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.license-text {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  margin: 0.25rem 0;
}

/* Manage Values Styles */
.manage-values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.value-column {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
}

.value-column-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.value-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.value-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background-color: #f8fafc;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
}

.value-name {
  font-size: 0.875rem;
  color: #374151;
  flex-grow: 1;
}

.value-name.none {
  color: #6b7280;
  font-style: italic;
}

.rename-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.rename-btn:hover {
  background-color: #2563eb;
}

.rename-btn:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* Dropdown Editor Styles */
.dropdown-editor {
  background-color: #f8fafc;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
}

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

.editor-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.dropdown-type-select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: white;
  font-size: 0.875rem;
  min-width: 200px;
}

.values-list {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
}

.values-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.values-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.values-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.value-edit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: #f8fafc;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
}

.value-input {
  flex-grow: 1;
  padding: 0.375rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.value-input:disabled {
  background-color: #f3f4f6;
  color: #6b7280;
}

.remove-value-btn {
  padding: 0.25rem 0.5rem;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.remove-value-btn:hover {
  background-color: #dc2626;
}

.remove-value-btn:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.btn-gray {
  background-color: #6b7280;
  color: white;
}

.btn-gray:hover {
  background-color: #4b5563;
}
  border-radius: 0.5rem;
  border: 2px dashed #d1d5db;
}

/* Resource Cell Styling */
td.resource select {
  width: 100%;
  max-width: 150px;
  padding: 0.25rem;
  border: none;
  outline: none;
  box-sizing: border-box;
  font-size: 0.875rem;
}

.select2-selection.resource-cost {
  background-color: #fecaca !important;
  color: #991b1b !important;
}

.select2-selection.resource-benefit {
  background-color: #86efac !important;
  color: #14532d !important;
}

.select2-selection.resource-requires {
  background-color: #bfdbfe !important;
  color: #1e40af !important;
}

.select2-selection.resource-cost-dice {
  background-color: #fed7aa !important;
  color: #ea580c !important;
}

.select2-selection.resource-benefit-dice {
  background-color: #a7f3d0 !important;
  color: #065f46 !important;
}

.select2-selection.resource-cost-benefit {
  background-color: #c7d2fe !important;
  color: #3730a3 !important;
}

.select2-selection.resource-cost-benefit-both-dice {
  background-color: #fef3c7 !important;
  color: #92400e !important;
}

.select2-selection.resource-cost-dice-benefit {
  background-color: #fce7f3 !important;
  color: #be185d !important;
}

.select2-selection.resource-cost-benefit-dice {
  background-color: #ddd6fe !important;
  color: #6d28d9 !important;
}

.select2-selection.resource-none {
  background-color: #f3f4f6 !important;
  color: #6b7280 !important;
}

/* Select2 Overrides */
.select2-container {
  width: 100% !important;
  max-width: 150px;
}

/* Flow Section Styles matching reference images */
.flow-section {
    margin-bottom: 1.5rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.flow-title {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
    color: #1e293b !important;
    padding: 0.875rem 1rem !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    border: 2px solid #6366f1 !important;
    border-radius: 8px 8px 0 0 !important;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1) !important;
}

.flow-description {
    background: #f8fafc !important;
    color: #64748b !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    font-size: 0.875rem !important;
    text-align: center !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.resource-flow-item {
    padding: 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.resource-flow-item:last-child {
    border-bottom: none !important;
}

.resource-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    background: #f1f5f9 !important;
    padding: 0.5rem !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
}

.flow-boxes {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

.producers-box .box-title, .consumers-box .box-title {
    text-align: center !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    opacity: 0.8 !important;
}

.producers-box .box-title {
    color: #065f46 !important;
}

.consumers-box .box-title {
    color: #991b1b !important;
}

.mechanic-item {
    padding: 0.25rem 0 !important;
    font-size: 0.875rem !important;
    text-align: center !important;
}

.producers-box, .consumers-box {
    border-radius: 6px !important;
    padding: 0.75rem !important;
    min-height: 60px !important;
}

.producers-box {
    background: #d1fae5 !important;
    border: 1px solid #10b981 !important;
}

.consumers-box {
    background: #fecaca !important;
    border: 1px solid #ef4444 !important;
}

.box-header {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    margin-bottom: 0.5rem !important;
    opacity: 0.8 !important;
}

.producers-box .box-header {
    color: #065f46 !important;
}

.consumers-box .box-header {
    color: #991b1b !important;
}

.flow-arrow {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: #64748b !important;
    text-align: center !important;
}

/* Game Loop Tab - Visual Style Matching Reference Images */

/* Section Headers */
.section-header {
    text-align: center !important;
    padding: 0.75rem !important;
    margin-bottom: 1rem !important;
    font-weight: 600 !important;
    color: white !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
}

.core-header {
    background-color: #3b82f6 !important; /* Blue for Core */
}

.progression-header {
    background-color: #10b981 !important; /* Green for Progression */
}

.meta-header {
    background-color: #8b5cf6 !important; /* Purple for Meta */
}

/* Mechanic Sections */
.mechanic-sections {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 1rem !important;
    margin-bottom: 2rem !important;
}

.mechanic-section {
    background: #f8fafc !important;
    border-radius: 12px !important;
    padding: 1rem !important;
}

.mechanic-boxes {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

/* Mechanic Cards */
.mechanic-box {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.mechanic-name {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-bottom: 0.5rem !important;
}

.mechanic-info {
    margin-bottom: 0.75rem !important;
    font-size: 0.75rem !important;
}

.info-line {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.info-line .label {
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    font-size: 0.65rem !important;
    min-width: 65px !important;
}

.info-line .value {
    color: #475569 !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
}

.info-line .value.system {
    color: #3b82f6 !important;
}

.info-line .value.location {
    color: #059669 !important;
}

/* Resource Flows - Horizontal Bars */
.resource-flows {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
}

.resource-flow {
    display: flex !important;
    align-items: center !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    min-height: 24px !important;
}

/* Resource Flow Colors with better contrast */
.resource-flow.benefit {
    background-color: #f0f9ff !important;
    color: #000000 !important;
    border-left: 3px solid #10b981 !important;
}

.resource-flow.cost {
    background-color: #fef2f2 !important;
    color: #000000 !important;
    border-left: 3px solid #ef4444 !important;
}

.resource-flow.requires {
    background-color: #fffbeb !important;
    color: #000000 !important;
    border-left: 3px solid #f97316 !important;
}

.flow-symbol {
    font-weight: bold !important;
    font-size: 0.75rem !important;
    margin-right: 0.375rem !important;
    min-width: 16px !important;
    text-align: center !important;
}

.resource-name {
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    color: #000000 !important;
}

/* Resource Flow Analysis Section */
.game-loop-analysis {
    margin-top: 2rem !important;
}

.analysis-title {
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    margin-bottom: 1rem !important;
}

.game-loop-header h2 {
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    margin-bottom: 1rem !important;
}

.analysis-subtitle {
    font-size: 0.875rem !important;
    color: #64748b !important;
    margin-bottom: 1.5rem !important;
}

.flow-sections {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

/* Split Icon Styling for Game Loop */
.flow-indicator {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  display: inline-block;
  text-align: center;
  min-width: 10rem;
  white-space: nowrap;
}

.flow-indicator.cost {
  background-color: #fecaca;
  color: #991b1b;
}

.flow-indicator.benefit {
  background-color: #86efac;
  color: #14532d;
}

.flow-indicator.requires {
  background-color: #bfdbfe;
  color: #1e40af;
}

.flow-indicator.cost-probability {
  background-color: #fed7aa;
  color: #ea580c;
}

.flow-indicator.benefit-probability {
  background-color: #a7f3d0;
  color: #065f46;
}

.flow-indicator.cost-benefit {
  background-color: #c7d2fe;
  color: #3730a3;
}

/* Specific styling for each dice combination */
.flow-indicator.cost-benefit-both-dice {
  background-color: #fef3c7;
  color: #92400e;
}

.flow-indicator.cost-dice-benefit {
  background-color: #fce7f3;
  color: #be185d;
}

.flow-indicator.cost-benefit-dice {
  background-color: #ddd6fe;
  color: #6d28d9;
}

.select2-container .select2-selection--single {
  border: none;
  background: transparent;
  height: auto;
}

.select2-container .select2-selection__rendered {
  padding: 0.5rem;
  line-height: normal;
}

.select2-container .select2-selection__arrow {
  height: 100%;
  top: 0;
  right: 0.5rem;
}

/* Remove dropdown option colors - keep only selected value colors */

/* Row Number Styling */
td:first-child {
  text-align: center;
  width: 50px;
}

td:first-child button {
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

td:first-child button:hover {
  opacity: 1;
}

th.resource button {
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

th.resource button:hover {
  opacity: 1;
}

/* Description Input */
td.description input {
  width: 100%;
  max-width: 280px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  outline: none;
  transition: border-color 0.2s;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-sizing: border-box;
}

td.description input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Game Loop Tab Styles */
.game-loop-container {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.game-loop-column {
  flex: 1;
  min-width: 0;
}

.column-title {
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  margin-bottom: 0;
  text-align: center;
}

.column-title.core-mechanics {
  background-color: #3b82f6;
  color: white;
}

.column-title.progression-mechanics {
  background-color: #10b981;
  color: white;
}

.mechanics-list {
  border: 2px solid #e5e7eb;
  border-radius: 0 0 0.5rem 0.5rem;
  min-height: 400px;
  padding: 1rem;
  background-color: #f8fafc;
}

.mechanic-box {
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mechanic-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mechanic-name {
  font-weight: 600;
  font-size: 1rem;
  color: #1f2937;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.resource-flows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}



.flow-indicator {
  font-weight: bold;
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

.flow-indicator.cost {
  color: #991b1b;
}

.flow-indicator.benefit {
  color: #14532d;
}

.flow-indicator.cost-probability {
  color: #92400e;
}

.flow-indicator.benefit-probability {
  color: #365314;
}

.flow-indicator.cost-benefit {
  color: #3730a3;
}

.resource-name {
  font-size: 0.875rem;
  color: #374151;
  text-transform: capitalize;
}

.resource-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
}

/* Resource flow backgrounds removed - using flow-indicator backgrounds only */

/* Mechanic Type Dropdown Colors - Match Game Loop Headers */
.select2-container .select2-selection--single.mechanic-type-core {
  background-color: #6366f1 !important;
  color: white !important;
  border-color: #6366f1 !important;
}

.select2-container .select2-selection--single.mechanic-type-core .select2-selection__rendered {
  color: white !important;
}

.select2-container .select2-selection--single.mechanic-type-progression {
  background-color: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

.select2-container .select2-selection--single.mechanic-type-progression .select2-selection__rendered {
  color: white !important;
}

.select2-container .select2-selection--single.mechanic-type-meta {
  background-color: #e65100 !important;
  color: white !important;
  border-color: #e65100 !important;
}

.select2-container .select2-selection--single.mechanic-type-meta .select2-selection__rendered {
  color: white !important;
}

.select2-container .select2-selection--single.mechanic-type-monetization {
  background-color: #d32f2f !important;
  color: white !important;
  border-color: #d32f2f !important;
}

.select2-container .select2-selection--single.mechanic-type-monetization .select2-selection__rendered {
  color: white !important;
}

/* Game Loop mechanic details styling */
.mechanic-details {
  margin-bottom: 0.75rem;
}

.detail-item {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.detail-label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mechanic-system {
  color: #3b82f6;
  font-weight: 500;
  background-color: #eff6ff;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

.mechanic-location {
  color: #10b981;
  font-weight: 500;
  background-color: #ecfdf5;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-loop-container {
    flex-direction: column;
  }

  .game-loop-column {
    min-width: auto;
  }

  .tab-nav {
    overflow-x: auto;
  }

  .tab-btn {
    white-space: nowrap;
    margin-bottom: 0.25rem;
  }

  .action-buttons {
    justify-content: center;
  }

  .resource-input-group {
    flex-direction: column;
  }
}

/* Mind Map Legend Shape Styles */
.legend-shape {
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 8px;
  border-width: 2px;
  border-style: solid;
}

.legend-rect-purple {
  background: #e1bee7;
  border-color: #6a1b9a;
  border-radius: 3px;
  width: 18px;
  height: 12px;
}

.legend-rect-green {
  background: #c8e6c9;
  border-color: #2e7d32;
  border-radius: 3px;
  width: 18px;
  height: 12px;
}

.legend-rect-orange {
  background: #ffe0b2;
  border-color: #e65100;
  border-radius: 3px;
  width: 18px;
  height: 12px;
}

.legend-rect-red {
  background: #ffcdd2;
  border-color: #d32f2f;
  border-radius: 3px;
  width: 18px;
  height: 12px;
}

.legend-ellipse {
  background: #e0e0e0;
  border-color: #666;
  border-radius: 50%;
  width: 20px;
  height: 14px;
}