/* CSS Utility Classes for Performance Optimization */
.transition-ease { transition: all 0.3s ease; }
.text-black { color: #000000; }
.cursor-pointer { cursor: pointer; }
.text-center { text-align: center; }
.bg-white { background: white; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* Main Container */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Roboto", "Orbitron", sans-serif;
  background-image: url('/static/assets/background1.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  position: relative;
  z-index: 1;
}

/* Main Content Area */
/* MODIFIED: Added extra left padding and flex alignment to shift map left */
.main-content-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  padding-left: var(--spacing-xl); /* ADDED: Extra left padding to shift map left */
  position: relative;
  justify-content: flex-start; /* ADDED: Align content to left side */
}

/* Data Mode Toggle */
.data-mode-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  z-index: 100;
}

.toggle-container {
  display: flex;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: var(--glass-radius);
  padding: 4px;
  box-shadow: var(--glass-shadow);
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: calc(var(--glass-radius) - 2px);
  color: var(--text);
}

.toggle-option:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.toggle-option.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.toggle-icon {
  font-size: 1.2rem;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.toggle-option.active .toggle-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Header */
.header {
  display: flex;
  justify-content: center;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.05);
}

.header-content {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.title-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-right: auto;
  margin-left: 20px;
}

.main-title {
  color: var(--text);
  text-shadow: 
    1px 1px 2px rgba(255, 255, 255, 0.5),
    0 0 6px rgba(0, 0, 0, 0.7);
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  margin: 0;
}

.subtitle {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0;
}

.user-section {
  margin-left: 20px;
}

.dashboard-button {
  background: rgba(111, 195, 235, 0.192);
  color: var(--text);
  border: 2px solid var(--border);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--glass-radius);
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
  text-decoration: none;
  display: inline-block;
  position: relative;
  z-index: 10;
  
  /* ADDED: Pulsating animation */
  animation: redPulsate 2s infinite ease-in-out;
}

/* ADDED: Keyframe animation for red pulsating effect */
@keyframes redPulsate {
  0% {
    box-shadow: var(--glass-shadow), 0 0 0 0 rgba(255, 68, 68, 0.7);
    border-color: var(--border);
    background: rgba(111, 195, 235, 0.192);
  }
  50% {
    box-shadow: var(--glass-shadow), 0 0 0 8px rgba(255, 68, 68, 0.3), 0 0 15px rgba(255, 68, 68, 0.5);
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.25);
    transform: scale(1.02);
  }
  100% {
    box-shadow: var(--glass-shadow), 0 0 0 0 rgba(255, 68, 68, 0);
    border-color: var(--border);
    background: rgba(111, 195, 235, 0.192);
  }
}

.dashboard-button:hover {
  background: rgba(255, 68, 68, 0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 68, 68, 0.6);
  border-color: #ff4444;
  animation-play-state: paused; /* Pause pulsating on hover */
}

/* Deep Research Button */
.deep-research-button {
  background: linear-gradient(135deg, #6a1b9a, #8e24aa);
  color: white;
  border: 2px solid #4a148c;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--glass-radius);
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 1rem;
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

.deep-research-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #7b1fa2, #9c27b0);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(106, 27, 154, 0.4);
}

.deep-research-button:disabled {
  background: linear-gradient(135deg, #9e9e9e, #757575);
  border-color: #616161;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.deep-research-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(106, 27, 154, 0.3);
}

/* Loading state for Deep Research button */
.deep-research-button.loading {
  background: linear-gradient(135deg, #4a148c, #6a1b9a);
  cursor: wait;
}

.deep-research-button.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Deep Research Container - REMOVED full-width container */
.deep-research-container {
  display: none; /* Hide the standalone container */
}

.deep-research-status {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  min-height: 20px;
  transition: all 0.3s ease;
}

.deep-research-status.active {
  color: #6a1b9a;
  font-weight: 700;
}

.deep-research-status.success {
  color: var(--success);
  font-weight: 700;
}

.deep-research-status.error {
  color: var(--danger);
  font-weight: 700;
}

/* Map Container */
/* MODIFIED: Increased size from 70% to 75% width and added positioning for left alignment */
#map-container {
  flex: 1;
  min-width: 75%; /* CHANGED: Increased from 70% to make map bigger */
  max-width: 75%; /* ADDED: Limit width to maintain left positioning */
  background: rgba(0, 179, 224, 0);
  border: 0px solid var(--border);
  border-radius: var(--glass-radius);
  padding: var(--spacing-lg);
  position: relative;
  margin-right: auto; /* ADDED: Push map to left side */
}

.map-instructions {
  text-align: center;
  margin-bottom: var(--spacing-md);
  color: var(--text);
  font-weight: 650;
  font-size: 1.1rem;
}

#us-map {
  width: 100%;
  height: 700px; /* CHANGED: Increased from 500px to make map bigger */
  background: transparent;
}

/* Map Styles */
.state {
  fill: rgba(73, 131, 189, 0.3);
  stroke: var(--border);
  stroke-width: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.state:hover {
  fill: rgba(73, 131, 189, 0.6);
  stroke-width: 2px;
}

.state.selected {
  fill: rgba(73, 131, 189, 0.8);
  stroke-width: 2px;
}

.county {
  fill: rgba(73, 131, 189, 0.2);
  stroke: var(--border);
  stroke-width: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.county:hover {
  fill: rgba(73, 131, 189, 0.7);
  stroke-width: 1px;
}

.county.selected {
  fill: var(--primary);
  stroke-width: 2px;
}

/* Intelligence Panel */
/* MODIFIED: Increased width to accommodate Deep Research content */
#intel-panel {
  position: fixed !important;
  /* Keep panel below the header and inside viewport - FIXED: Position higher */
  top: 180px !important;
  right: var(--spacing-lg) !important;
  left: auto !important;
  transform: none !important;
  width: clamp(380px, 38vw, 720px) !important;
  max-height: calc(100vh - 220px) !important;
  overflow: auto;
  z-index: 1000 !important;
  transition: all 0.3s ease;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--border);
}

.close-panel-btn {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-panel-btn:hover {
  background: #cc0000;
  transform: scale(1.1);
}

.intelligence-content {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

/* Navigation Footer */
.nav-footer {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  border-top: 2px solid var(--border);
  padding: var(--spacing-md);
  margin-top: auto;
}

.nav-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  max-width: 1500px;
  margin: 0 auto;
}

.feature-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: var(--spacing-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.1);
}

.feature-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feature-card.disabled:hover {
  transform: none;
  box-shadow: none;
}

.feature-card.completed {
  border-left: 4px solid var(--success);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 4px rgba(33, 29, 29, 0.882);
}

.ready {
  display: inline-block;
  color: var(--success);
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 0 3px rgba(33, 29, 29, 0.882);
}

.pending {
  display: inline-block;
  color: var(--warning);
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Animation Keyframes for Enhanced Visual Effects */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(211, 47, 47, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

/* Enhanced Child Item Styles */
.child-item:hover {
  animation: none !important; /* Override slide animation on hover */
}

.child-item .shimmer-effect {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 468px 100%;
  animation: shimmer 2s infinite;
}

/* Location Stats Animation */
.location-stat {
  opacity: 0;
  animation: fadeInUp 0.6s forwards;
}

.location-stat:nth-child(1) { animation-delay: 0.1s; }
.location-stat:nth-child(2) { animation-delay: 0.2s; }
.location-stat:nth-child(3) { animation-delay: 0.3s; }
.location-stat:nth-child(4) { animation-delay: 0.4s; }
.location-stat:nth-child(5) { animation-delay: 0.5s; }
.location-stat:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 1200px) {
  .main-content-area {
    flex-direction: column;
  }
  
  #intel-panel {
    position: fixed !important;
    top: 180px !important;
    right: var(--spacing-lg) !important;
    left: auto !important;
    transform: none !important;
    width: clamp(380px, 90vw, 720px) !important;
    max-height: calc(100vh - 220px) !important;
    margin-top: 0 !important;
    z-index: 1000 !important;
  }
  
  #map-container {
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .main-content-area {
    padding: var(--spacing-md);
  }
  
  #us-map {
    height: 400px;
  }
  
  .nav-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-card {
    min-height: 80px;
    padding: var(--spacing-sm);
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .ready, .pending {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .nav-cards-container {
    grid-template-columns: 1fr;
  }
  
  #us-map {
    height: 400px;
  }
  
  .map-instructions {
    font-size: 1rem;
  }
}

/* Base Intelligence Styles */
.base-intelligence-container {
  background: var(--glass-bg);
  max-width: 1500px;
  width: 100%;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: var(--glass-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--glass-shadow);
}

.base-intelligence-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}

.data-section {
  margin-bottom: var(--spacing-lg);
  max-width: none;
  width: 100%;
  padding: var(--spacing-md);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}

.data-section:last-child {
  margin-bottom: 0;
}

.data-section h5 {
  margin: 0 0 var(--spacing-md);
  font-size: 1.3rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: var(--spacing-xs);
}

/* Mobile responsiveness for data-section h5 */
@media (max-width: 768px) {
  .data-section h5 {
    font-size: 1.1rem;
  }
}

.data-field {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  border-left: 4px solid var(--primary);
  background-color: rgba(248, 251, 255, 0.185);
  border-radius: var(--glass-radius);
  border: 2px solid var(--border);
}

.data-field strong {
  color: #000000;
  font-weight: 900;
}

.data-content {
  margin-top: var(--spacing-xs);
  color: #000000;
  font-weight: 600;
  line-height: 1.6;
}

/* AFCARS Metrics Specific Styling */
.data-field.afcars-metric {
  border-left: 4px solid #2196F3;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-field.afcars-metric strong {
  color: #1976D2;
  font-weight: 700;
  font-size: 0.95rem;
}

.data-field.afcars-metric .data-content {
  margin-top: 0;
  font-weight: 600;
  color: #0D47A1;
  font-size: 1.1rem;
  text-align: right;
}

/* AFCARS Section Header */
#afcars-section h5 {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  margin: -var(--spacing-md) -var(--spacing-md) var(--spacing-md) -var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--glass-radius) var(--glass-radius) 0 0;
  text-align: center;
  font-size: 1.2rem;
  border-bottom: none;
}

#afcars-section {
  border: 2px solid #2196F3;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.05), rgba(33, 150, 243, 0.02));
}

/* Enhanced AFCARS Metrics Styling */
.afcars-enhanced-container {
  background: #ffffff;
  border-radius: 8px;
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.afcars-header {
  background: linear-gradient(135deg, #1976D2, #2196F3);
  color: white;
  padding: var(--spacing-md);
  border-radius: 8px 8px 0 0;
  margin-bottom: var(--spacing-md);
}

.afcars-header h4 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
}

.data-source {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  font-style: italic;
  color: #ffffff;
}

.afcars-metric-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
}

.afcars-metric-card:hover {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.metric-header h5 {
  margin: 0 0 var(--spacing-sm) 0;
  color: #000000;
  font-size: 1.1rem;
  font-weight: 900;
  border-bottom: 2px solid #e3f2fd;
  padding-bottom: var(--spacing-xs);
}

.metric-values {
  margin-bottom: var(--spacing-md);
}

.year-comparison {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  background: white;
  padding: var(--spacing-sm);
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.year-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.year-data.current {
  font-weight: 700;
  color: #1976D2;
}

.year-data .year {
  font-size: 0.9rem;
  color: #000000;
  margin-bottom: 4px;
  font-weight: 700;
}

.year-data .value {
  font-size: 1.3rem;
  font-weight: 900;
  color: #000000;
}

.year-data.current .value {
  color: #000000;
  font-weight: 900;
}

.single-year {
  text-align: center;
  background: white;
  padding: var(--spacing-sm);
  border-radius: 4px;
  border: 1px solid #e9ecef;
  margin-bottom: var(--spacing-sm);
}

.single-year .year {
  font-size: 0.9rem;
  color: #000000;
  margin-right: var(--spacing-xs);
  font-weight: 700;
}

.single-year .value {
  font-size: 1.3rem;
  font-weight: 900;
  color: #000000;
}

.trend-signal {
  text-align: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #000000;
  border: 1px solid #bbdefb;
}

.metric-explanation {
  background: white;
  padding: var(--spacing-md);
  border-radius: 4px;
  border-left: 4px solid #2196F3;
}

.metric-explanation p {
  margin: 0 0 var(--spacing-sm) 0;
  line-height: 1.5;
  color: #000000;
  font-weight: 700;
}

.metric-explanation p:last-child {
  margin-bottom: 0;
}

.insight {
  background: #f0f7ff;
  padding: var(--spacing-sm);
  border-radius: 4px;
  margin-top: var(--spacing-sm);
  border: 1px solid #bbdefb;
}

.insight p {
  margin: 0;
  color: #000000;
  font-weight: 700;
  font-style: italic;
}

.system-signals {
  background: linear-gradient(135deg, #fff3e0, #fce4ec);
  border: 2px solid #ff9800;
  border-radius: 6px;
  padding: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.system-signals h5 {
  margin: 0 0 var(--spacing-md) 0;
  color: #000000;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

.signals-content p {
  margin: 0 0 var(--spacing-sm) 0;
  color: #000000;
  font-weight: 700;
  line-height: 1.5;
}

.signal-item {
  background: white;
  padding: var(--spacing-sm);
  border-radius: 4px;
  margin-bottom: var(--spacing-xs);
  border-left: 4px solid #ff9800;
  font-weight: 700;
  color: #000000;
}

.final-note {
  text-align: center;
  font-style: italic;
  color: #000000;
  font-weight: 900;
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: rgba(255, 152, 0, 0.1);
  border-radius: 4px;
}

.bullet-point {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-md);
  position: relative;
  color: var(--text);
  line-height: 1.6;
}

.bullet-point::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text);
  font-weight: 800;
}

.paragraph {
  margin: var(--spacing-sm) 0;
  color: var(--text);
  line-height: 1.6;
}

.link {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--primary);
  border: 2px solid var(--border);
  border-radius: var(--glass-radius);
  transition: all 0.3s ease;
  box-shadow: var(--glass-shadow);
}

.link:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow);
  text-decoration: underline;
}

/* Data Links (URLs in content) */
.data-link {
  color: #1976D2;
  text-decoration: none;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(33, 150, 243, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(33, 150, 243, 0.3);
  transition: all 0.3s ease;
  display: inline-block;
  margin: 2px;
  word-break: break-all;
}

.data-link:hover {
  background: rgba(33, 150, 243, 0.2);
  border-color: #1976D2;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-link:visited {
  color: #7B1FA2;
}

/* Data Item Cards for Arrays */
.data-item-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  transition: all 0.3s ease;
}

.data-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.item-field {
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
  color: #000000;
  font-weight: 600;
}

.item-field:last-child {
  margin-bottom: 0;
}

.item-field strong {
  color: #000000;
  font-weight: 900;
}

/* ============================================================================ */
/* NATIONAL CPS OVERVIEW PANEL STYLES - GLOBAL CSS ONLY */
/* ============================================================================ */

.national-overview-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 100vh;
  z-index: 1001;
  display: none;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  overflow-y: auto;
}

.national-overview-panel.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.national-overview-panel .glass-panel {
  margin: var(--spacing-md);
  padding: var(--spacing-md);
  color: var(--text);
  font-weight: 900;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--border);
}

.national-overview-panel .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 1002;
}

.national-overview-panel .close-btn:hover {
  background: var(--glass-bg);
}

.dataset-selector select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Dataset Info Card */
.dataset-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dataset-card h4 {
  margin: 0 0 8px 0;
  color: var(--accent-color);
  font-size: 1.2rem;
}

.dataset-card p {
  margin: 0 0 12px 0;
  color: #666;
  line-height: 1.5;
}

.dataset-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
}

.dataset-stats span {
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  color: #495057;
  border: 1px solid #dee2e6;
}

/* National Summary */
.summary-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary-card h4 {
  margin: 0 0 15px 0;
  color: var(--accent-color);
  font-size: 1.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
}

/* Foster Care Images */
.foster-care-images {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.foster-care-images h4 {
  margin: 0 0 15px 0;
  color: var(--accent-color);
  font-size: 1.2rem;
}

.image-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.image-item {
  cursor: pointer;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: white;
}

.image-item:hover {
  border-color: var(--accent-color);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.image-caption {
  padding: 8px;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  background: #f8f9fa;
  text-transform: capitalize;
}

/* State Details */
.state-details {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid var(--accent-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.state-card h4 {
  margin: 0 0 15px 0;
  color: var(--accent-color);
  font-size: 1.3rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 8px;
}

.state-stats {
  margin-bottom: 20px;
}

.state-stat-item {
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  justify-content: space-between;
}

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

.state-data-table {
  margin-top: 15px;
}

.state-data-table h5 {
  margin: 0 0 10px 0;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.state-data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.state-data-table th,
.state-data-table td {
  padding: 6px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.state-data-table th {
  background: #f8f9fa;
  font-weight: bold;
  color: #495057;
}

.state-data-table td {
  background: white;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  cursor: pointer;
}

.modal-content {
  text-align: center;
  max-width: 95vw;
  max-height: 95vh;
}

.modal-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-caption {
  color: white;
  font-size: 1.2rem;
  margin-top: 15px;
  text-transform: capitalize;
}

/* National CPS Tooltip */
.national-cps-tooltip {
  background: rgba(139, 0, 0, 0.9) !important;
  color: white !important;
  border: 2px solid white !important;
  border-radius: 6px !important;
  padding: 10px 14px !important;
  font-family: Arial, sans-serif !important;
  font-size: 14px !important;
  pointer-events: none !important;
  z-index: 1000 !important;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .main-title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .base-intelligence-title {
    font-size: 1.5rem;
  }
  
  .national-overview-panel {
    width: 100vw;
    right: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .image-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
}
