/* — CSS CUSTOM PROPERTIES — */
:root {
  /* Colors */
  --primary-blue: #2563eb;
  --primary-blue-light: #3b82f6;
  --primary-blue-dark: #1d4ed8;
  --secondary-blue: #e0f2fe;
  --accent-blue: #0ea5e9;
  
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
}

/* — GLOBAL RESET — */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* — LAYOUT UTILITIES — */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* — HERO SECTION — */
.hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  padding: var(--space-20) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-12);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--font-size-5xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: var(--space-6);
}

.hero-description p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
  opacity: 0.95;
  text-align: left;
}

.hero-image {
  position: relative;
}

.responsive-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

/* — SECTION LAYOUT — */
.section {
  padding: var(--space-20) 0;
}

.section.alt-bg {
  background-color: white;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-4);
}

.section-description {
  font-size: var(--font-size-lg);
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

/* — VISUALIZATION CONTAINERS — */
.visualization-container {
  margin-bottom: var(--space-12);
}

.tableau-wrapper {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow-x: auto;
  overflow-y: visible;
}

.tableau-wrapper .tableauPlaceholder {
  width: 100% !important;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* — ANALYSIS CONTENT — */
.analysis-content {
  max-width: 1000px;
  margin: 0 auto;
}

.analysis-text {
  background: white;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.analysis-text h3 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-6);
}

.analysis-text p {
  margin-bottom: var(--space-4);
  color: var(--gray-700);
  line-height: 1.7;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.analysis-card {
  background: white;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.analysis-card h4 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: var(--space-3);
}

.analysis-summary {
  background: var(--gray-100);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-blue);
}

/* — HIGHLIGHT SECTIONS — */
.analysis-highlights {
  margin-bottom: var(--space-8);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.highlight-item {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  text-align: center;
  color: white;
}

.highlight-item.critical {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

.highlight-item.positive {
  background: linear-gradient(135deg, var(--success), #059669);
}

.highlight-item.warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
}

.highlight-item h4 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.highlight-item p {
  font-size: var(--font-size-sm);
  opacity: 0.95;
}

/* — CTA SECTION — */
.cta-section {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  color: white;
  padding: var(--space-20) 0;
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h3 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.cta-content p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-8);
  opacity: 0.9;
}

.cta-button {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--font-size-lg);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.cta-button:hover {
  background: var(--primary-blue-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* — FOOTER — */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-12) 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.footer-sources h4 {
  color: white;
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.source-links a {
  color: var(--gray-300);
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.source-links a:hover {
  color: white;
  border-color: var(--primary-blue);
  background: var(--primary-blue);
}

.footer-info {
  text-align: right;
}

.footer-info p {
  font-size: var(--font-size-sm);
  color: var(--gray-400);
}

/* — RESPONSIVE DESIGN — */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .hero-highlight {
    text-align: left !important;
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .hero {
    padding: var(--space-16) 0;
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-highlight {
    font-size: var(--font-size-xl);
  }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
  
  .tableau-wrapper {
    padding: var(--space-4);
  }
  
  .analysis-text {
    padding: var(--space-6);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .footer-info {
    text-align: left;
  }
  
  .source-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: var(--font-size-2xl);
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
  }
  
  .highlight-grid {
    grid-template-columns: 1fr;
  }
  
  .tableau-wrapper {
    padding: var(--space-3);
  }
}

/* — TABLEAU RESPONSIVE OVERRIDES — */
.tableauViz {
  width: 100% !important;
}

@media (max-width: 1200px) {
  .tableau-wrapper {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .tableau-wrapper {
    padding: var(--space-4);
    overflow-x: auto;
  }
  
  .visualization-container {
    margin-left: -var(--space-4);
    margin-right: -var(--space-4);
    width: calc(100% + var(--space-8));
  }
}

@media (max-width: 480px) {
  .tableau-wrapper {
    padding: var(--space-3);
    overflow-x: auto;
  }
  
  .visualization-container {
    margin-left: -var(--space-3);
    margin-right: -var(--space-3);
    width: calc(100% + var(--space-6));
  }
}
