:root {
  /* Colors */
  --header-height: 80px;
  --color-background: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #000000;
  --color-text-secondary: #666666;
  --color-primary: #2d6a8e;
  --color-primary-hover: #1d4ed8;
  --color-primary-active: #1e40af;
  --color-secondary: rgba(0, 0, 0, 0.1);
  --color-secondary-hover: rgba(0, 0, 0, 0.15);
  --color-secondary-active: rgba(0, 0, 0, 0.2);
  --color-border: #000000;
  --color-accent: #f6ad55;
  --color-accent-hover: #ed8936;
  --color-btn-primary-text: #ffffff;
  --color-card-border: #000000;
  --color-card-border-inner: #000000;
  --color-error: #dc3545;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-info: #17a2b8;
  --color-focus-ring: rgba(45, 106, 142, 0.4);
  --color-select-caret: #000000;

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-size-xs: 14px;
  --font-size-sm: 16px;
  --font-size-base: 18px;
  --font-size-md: 18px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 28px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;
  --letter-spacing-wide: 0.02em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* Dark mode colors */
[data-theme="dark"] {
  --color-background: #000000;
  --color-surface: #111111;
  --color-text: #ffffff;
  --color-text-secondary: #cccccc;
  --color-primary: #4299e1;
  --color-primary-hover: #3182ce;
  --color-primary-active: #2b6cb0;
  --color-secondary: rgba(255, 255, 255, 0.1);
  --color-secondary-hover: rgba(255, 255, 255, 0.15);
  --color-secondary-active: rgba(255, 255, 255, 0.2);
  --color-border: #ffffff;
  --color-accent: #fbd38d;
  --color-accent-hover: #f6ad55;
  --color-btn-primary-text: #000000;
  --color-card-border: #ffffff;
  --color-card-border-inner: #ffffff;
  --color-error: #ff5757;
  --color-success: #32c8c6;
  --color-warning: #e6e097;
  --color-info: #a7a9a9;
  --color-focus-ring: rgba(66, 153, 225, 0.4);
  --color-select-caret: #ffffff;
}

/* Base styles */
html {
  box-sizing: border-box;
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  padding-top: var(--header-height);
  font-family: var(--font-family-base);
  position: relative;
  overflow-x: hidden;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
  font-size: var(--font-size-base);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

strong, b {
  font-weight: var(--font-weight-bold);
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
  max-width: var(--container-xl);
}

@media (min-width: 640px) {
  .container {
    padding-right: var(--space-24);
    padding-left: var(--space-24);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-right: var(--space-32);
    padding-left: var(--space-32);
  }
}


/* Fonts */
.josefin-sans-uniquifier {
  font-family: "Josefin Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

h1, h2, h3, h4, h5, h6, nav, .nav-link, .btn, .case-study-title, .case-study-impact, .case-study-domain, span, .footer__logo, .dashboard-hero__title, .dashboard-hero__subtitle, .description-title, .description-card__title, .panel-title, .sensor-name, .chart-legend-title, .notification-message, .control-group label, .control-group select, .control-group button, .emergency-button, .sensor-model-selector label, .sensor-model-selector select, .spectrogram-selector label, .spectrogram-selector select {
    font-family: "Josefin Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
}

.poppins-semibold {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-style: normal;
}



p, .text, .case-study-content, .gallery__caption, .result-card__description, .contact__description, .footer__tagline, .footer__link, .case-study-hero__subtitle, .case-study-hero__impact, .impact-metric, .impact-separator, .timeline-description, .timeline-metric, .cta-description, .description-card__text, .range-title, .value-label, .value-number, .prediction-title, .prediction-value, .prediction-accuracy, .analytics-card__title, .analytics-card__value, .notification-timestamp, .refresh-info, .refresh-time, .chart-legend, .range-labels, .legend-item, .chart-legend-items, .chart-legend-item {
    font-family: "Poppins", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.case-study-title {
  font-size: 1.25rem; /* Match .result-card__title */
  font-weight: var(--font-weight-bold, 700);
  margin-bottom: 0.5rem;
  color: var(--color-text, #222);
  line-height: 1.3;
}

.case-study-impact {
  font-size: 1.125rem; /* Match .result-card__metric */
  font-weight: var(--font-weight-bold, 700);
  margin-bottom: 0.5rem;
  color: var(--color-primary, #0078d4);
  line-height: 1.2;
}

.case-study-domain {
  font-size: 1rem;
  font-weight: var(--font-weight-medium, 600);
  color: var(--color-text-secondary, #666);
  margin-bottom: 0.25rem;
}

.case-study-content {
  font-size: 1rem; /* Match .result-card__description */
  color: var(--color-text, #222);
  line-height: 1.6;
}

.case-study-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-lg);
  background: var(--color-border);
}

.case-study-card:hover .case-study-content {
  background: var(--color-border);
}

.case-study-card:hover .case-study-title,
.case-study-card:hover .case-study-impact,
.case-study-card:hover .case-study-domain {
  color: var(--color-background);
}

/* Results Section */
.results__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.result-card {
  background: var(--color-surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.result-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.result-card:hover * {
  color: var(--color-background) !important;
}

.result-card__metric {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1;
  transition: color 0.3s ease;
}

.result-card__title {
  margin-bottom: 1.5rem;
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  transition: color 0.3s ease;
}


.result-card__description {
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
}

.result-card__description p {
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.result-card__description p:last-child {
  margin-bottom: 0;
}

/* Contact Section */
.contact {
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
}

.contact__content {
  max-width: 80rem;
  margin: 0 auto;
  text-align: center;
}

.contact__title {
  margin-bottom: 1.5rem;
  font-weight: var(--font-weight-bold);
  font-size: 2.5rem;
  color: var(--color-text);
}

.contact__description {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.contact__methods {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.contact__method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-background);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.3s ease;
  border: 2px solid var(--color-border);
}

.contact__method:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
  color: var(--color-background);
}

.contact__method-icon {
  font-size: 1.75rem;
}

.contact__method-text {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

/* Footer */
.footer {
  background: var(--color-background);
  padding: 4rem 0 2rem;
  border-top: 2px solid var(--color-border);
}

.footer__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.footer__logo {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.footer__tagline {
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  font-weight: var(--font-weight-medium);
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color 0.3s ease;
  font-size: var(--font-size-sm);
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Animation classes for scroll effects */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Case Study Hero Background */
.case-study-hero {
  padding: 8rem 0 4rem;
  background: var(--color-background);
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Hero background overlay for better text readability */
.case-study-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.6)
  );
  z-index: 1;
}

.case-study-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 65rem;
  margin: 0 auto;
  color: white;
}

.case-study-hero__title {
  font-size: 3.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
  letter-spacing: var(--letter-spacing-tight);
}

.case-study-hero__subtitle {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-weight: var(--font-weight-medium);
}

.case-study-hero__impact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.impact-metric {
  font-size: 1.125rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.impact-separator {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-bold);
}

/* When hero has background image, make text white */
.case-study-hero[style*="background-image"] .case-study-hero__title,
.case-study-hero[style*="background-image"] .case-study-hero__subtitle,
.case-study-hero[style*="background-image"] .impact-metric {
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Case Study Specific Styles */

/* Case Study Sections */
.case-study-section {
  padding: 6rem 0;
  background: var(--color-background);
}

.case-study-section--alt {
  background: var(--color-surface);
}

/* Executive Summary */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.summary-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  height: 100%;
}

.summary-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.summary-card:hover * {
  color: var(--color-background) !important;
}

.summary-card__title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 1.5rem;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.summary-card__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.7;
  transition: color 0.3s ease;
}

/* Metrics Showcase */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.metric-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.metric-card:hover * {
  color: var(--color-background) !important;
}

.metric-card__value {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1;
  transition: color 0.3s ease;
}

.metric-card__label {
  font-size: 1.125rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.metric-card__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  transition: color 0.3s ease;
}

/* Technical Cards */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.tech-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  height: 100%;
}

.tech-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.tech-card:hover * {
  color: var(--color-background) !important;
}

.tech-card__header {
  margin-bottom: 1.5rem;
}

.tech-card__title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tech-badge {
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  transition: all 0.3s ease;
}

/* Keep the same blue background with white text on hover for better visibility */
.tech-card:hover .tech-badge {
  background: var(--color-primary);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tech-card__description {
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
}

/* Timeline */
.timeline-container {
  max-width: 60rem;
  margin: 0 auto;
}

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin: 3rem 0;
  padding-left: 6rem;
}

.timeline-marker {
  position: absolute;
  left: 1.125rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--color-primary);
  border-radius: 50%;
  border: 4px solid var(--color-background);
  box-shadow: 0 0 0 3px var(--color-border);
}

.timeline-content {
  background: var(--color-background);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-md);
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
}

.timeline-description {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-base);
}

.timeline-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-metric {
  background: var(--color-surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* Impact Cards */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.impact-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
}

.impact-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-lg);
  background: var(--color-border);
}

.impact-card:hover * {
  color: var(--color-background) !important;
}

.impact-card__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.impact-card__title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.impact-card__value {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.impact-card:hover .impact-card__value {
  color: var(--color-background) !important;
}

.impact-card__description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: var(--font-size-sm);
  transition: color 0.3s ease;
}

/* Lessons Learned */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.lessons-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  height: 100%;
}

.lessons-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-md);
}

.lessons-card--success {
  border-left: 6px solid #28a745;
}

.lessons-card--challenges {
  border-left: 6px solid #ffc107;
}

.lessons-card__title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

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

.lessons-card__list li {
  padding: 0.75rem 0;
  color: var(--color-text-secondary);
  position: relative;
  padding-left: 2rem;
  font-size: var(--font-size-base);
  line-height: 1.6;
  border-bottom: 1px solid var(--color-surface);
}

.lessons-card__list li:last-child {
  border-bottom: none;
}

.lessons-card--success .lessons-card__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
  font-size: 1.125rem;
}

.lessons-card--challenges .lessons-card__list li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: #ffc107;
  font-weight: bold;
  font-size: 1.125rem;
}

/* Call to Action */
.case-study-cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, #764ba2 100%);
  padding: 6rem 0;
  color: white;
  position: relative;
  overflow: hidden;
}

.case-study-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 65rem;
  margin: 0 auto;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: white;
  margin-bottom: 1.5rem;
  letter-spacing: var(--letter-spacing-tight);
}

.cta-description {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
  line-height: 1.7;
  font-weight: var(--font-weight-medium);
}

.cta-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.case-study-cta .btn {
  color: white;
  border-color: white;
}

.case-study-cta .btn--primary {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.case-study-cta .btn--primary:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.case-study-cta .btn--outline {
  background: transparent;
  color: white;
  border-color: white;
}

.case-study-cta .btn--outline:hover {
  background: white;
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Responsive Design - Fixed Version */

/* First, let's add mobile navigation styles that were missing */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-background);
  z-index: 2000;
  padding: 2rem;
  box-sizing: border-box;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.mobile-menu.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-size: 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  text-align: center;
}

.mobile-menu-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--color-text);
  cursor: pointer;
  z-index: 2100;
}

/* Large screens - 3 cards per row */
@media (max-width: 1200px) {
  .services__grid,
  .expertise__grid,
  .results__grid,
  .impact-studies__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
    gap: 2rem;
  }
     
  .profile-image-placeholder {
    width: 24rem;
    height: 28rem;
  }
     
  .summary-grid,
  .metrics-grid,
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
     
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium screens - 2 cards per row */
@media (max-width: 992px) {
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
     
  .hero__image {
    justify-self: center;
    margin-top: 2rem;
  }
     
  .hero__stats {
    justify-content: center;
    grid-template-columns: repeat(2, 1fr); /* Keep 2 stats per row */
    gap: 1.5rem;
  }
     
  .stat {
    text-align: center;
  }
     
  .hero__actions {
    justify-content: center;
  }
     
  .hero__social {
    justify-content: center;
  }
     
  .profile-image-placeholder {
    width: 20rem;
    height: 24rem;
  }
     
  .case-study-hero__title {
    font-size: 2.75rem;
  }
     
  .case-study-hero__subtitle {
    font-size: 1.25rem;
  }
     
  /* Keep 2 cards per row on medium screens */
  .services__grid,
  .expertise__grid,
  .results__grid,
  .impact-studies__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
     
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Hide desktop nav, show mobile menu toggle */
  .nav {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: flex !important;
  }

  /* 1 card per row for all main grids */
  .services__grid,
  .expertise__grid,
  .results__grid,
  .impact-studies__grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 0 1rem !important;
  }

  /* Make cards full width */
  .service-card,
  .expertise-card,
  .result-card,
  .case-study-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Footer layout stack */
  .footer__content {
    flex-direction: column !important;
    gap: 2rem !important;
    text-align: center !important;
  }
  .footer__links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1.5rem !important;
  }

  /* Profile image sizing */
  .profile-image-placeholder {
    width: 18rem !important;
    height: 22rem !important;
  }

  /* Logo container sizing */
  .expertise__logo-container {
    width: 6rem !important;
    height: 4.5rem !important;
    padding: 0.75rem !important;
  }

  /* All summary/metrics/tech/impact/lessons grids: 1 column */
  .summary-grid,
  .metrics-grid,
  .tech-grid,
  .impact-grid,
  .lessons-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hero stats: 1 per row */
  .hero__stats {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Case study hero impact: stack vertically */
  .case-study-hero__impact {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* Hide impact separator */
  .impact-separator {
    display: none !important;
  }

  /* Timeline adjustments */
  .timeline::before {
    left: 1rem !important;
  }
  .timeline-item {
    padding-left: 3rem !important;
  }
  .timeline-marker {
    left: 0.25rem !important;
  }

  /* CTA actions stack */
  .cta-actions {
    flex-direction: column !important;
    align-items: center !important;
  }
  .cta-actions .btn {
    width: 100% !important;
    max-width: 20rem !important;
  }

  /* Hero section: stack content vertically and center */
  .hero__content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2rem !important;
    text-align: center !important;
  }
  .hero__image {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 2rem auto !important;
    display: flex !important;
    justify-content: center !important;
  }
  .profile-image {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
}

/* Extra small screens - optimize everything for tiny screens */
@media (max-width: 576px) {
  html {
    font-size: 16px;
  }

  .hero__name {
    font-size: 2.25rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__tagline {
    font-size: 1rem;
  }

  .stat__value {
    font-size: 2rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .profile-image-placeholder {
    width: 12rem;
    height: 14rem;
  }

  /* Make sure cards have proper spacing on very small screens */
  .services__grid,
  .expertise__grid,
  .results__grid,
  .impact-studies__grid {
    padding: 0 0.25rem;
    gap: 0.75rem;
  }

  .service-card,
  .expertise-card,
  .result-card,
  .case-study-card {
    min-width: 0;
    min-height: 180px;
    height: auto;
    padding: 1rem;
  }

  .case-study-content {
    padding: 0.75rem;
  }

  .case-study-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  /* Smaller logo containers on mobile */
  .expertise__logo-container {
    width: 4rem;
    height: 3rem;
    padding: 0.25rem;
  }

  .case-study-hero__title {
    font-size: 1.5rem;
  }

  .case-study-hero__subtitle {
    font-size: 1rem;
  }

  .cta-title {
    font-size: 1.5rem;
  }

  .cta-description {
    font-size: 1rem;
  }

  .metric-card__value {
    font-size: 1.5rem;
  }

  .timeline-content {
    padding: 1rem;
  }

  .timeline-metrics {
    flex-direction: column;
    gap: 0.25rem;
  }

  .btn {
    width: 100%;
    padding: var(--space-12) var(--space-8);
    font-size: 1rem;
    box-sizing: border-box;
  }
  
  .profile-image-placeholder {
    width: 12rem;
    height: 12rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface, #f5f5f5);
    border-radius: 1rem;
    border: none !important; /* Remove border on mobile */
    box-shadow: none !important; /* Remove any shadow if present */
    padding: 0 !important;
  }
  .profile-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 1rem !important;
  }
}

/* Mobile font scaling */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  body {
    font-size: 0.95rem;
  }
  h1 {
    font-size: 1.7rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  h3 {
    font-size: 1.1rem;
  }
  h4, h5, h6 {
    font-size: 1rem;
  }
  .nav__link,
  .mobile-menu a {
    font-size: 1.1rem;
    padding: 0.75rem 0.5rem;
  }
  .mobile-menu {
    padding: 1rem;
  }
  .mobile-menu-close {
    font-size: 1.5rem;
    top: 1rem;
    right: 1rem;
  }
  .btn,
  .btn--primary,
  .btn--outline,
  .btn--secondary {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
  .hero__name {
    font-size: 1.2rem;
  }
  .hero__subtitle {
    font-size: 1rem;
  }
  .stat__value {
    font-size: 1.1rem;
  }
  .section-title {
    font-size: 1.2rem;
  }
  .service-card__title {
    font-size: 1.1rem;
  }
  .service-card__description,
  .service-card__features li {
    font-size: 0.95rem;
  }
  .result-card__title,
  .result-card__description {
    font-size: 1rem;
  }
  .case-study-title {
    font-size: 1rem;
  }
  .case-study-impact {
    font-size: 0.95rem;
  }
  .case-study-domain {
    font-size: 0.9rem;
  }
  .expertise__name {
    font-size: 1rem;
  }
  .expertise__description {
    font-size: 0.9rem;
  }
  .gallery__caption {
    font-size: 0.9rem;
  }
  .contact__title {
    font-size: 1.1rem;
  }
  .contact__description {
    font-size: 0.95rem;
  }
  .footer__logo {
    font-size: 1rem;
  }
  .footer__tagline {
    font-size: 0.9rem;
  }
  .footer__link {
    font-size: 0.95rem;
  }
}

/* --- Aggressive mobile scaling for all text and UI elements --- */
@media (max-width: 600px) {
  html {
    font-size: 15.88px; /* 1.3% smaller than 16.0901px for consistency */
  }
  body {
    font-size: 0.9935rem; /* 1.3% smaller than 1.00664rem */
  }
  .header__content, .footer__content, .container {
    padding-left: 0.89rem;
    padding-right: 0.89rem;
  }
  .header__logo .logo-text {
    font-size: 1.985rem;
  }
  .nav__list {
    flex-direction: column;
    gap: 0.7rem;
    align-items: flex-start;
  }
  .nav__link, .mobile-menu .nav__link {
    font-size: 1.19rem;
    padding: 0.9935rem 0.596rem;
    display: block;
  }
  .mobile-menu {
    padding-top: 1.985rem;
    width: 90vw;
    left: 5vw;
    right: 5vw;
    border-radius: 1.2rem;
  }
  .mobile-menu-close {
    font-size: 1.985rem;
    width: 2.98rem;
    height: 2.98rem;
  }
  .dashboard-hero__title, .section-title, .hub-title, .description-title {
    font-size: 1.7rem;
    text-align: left;
    margin-bottom: 0.7em;
  }
  .dashboard-hero__subtitle, .section-subtitle, .description-card__title {
    font-size: 1.05rem;
    margin-bottom: 0.5em;
  }
  .dashboard-hero__content, .description-content, .control-panel__content, .metrics-showcase, .footer__info, .footer__links {
    gap: 0.7rem;
  }
  .description-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .description-card {
    padding: 0.7rem 0.89rem;
    margin-bottom: 0.7rem;
  }
  .control-panel__content {
    flex-direction: column;
    gap: 0.7rem;
    align-items: stretch;
  }
  .control-group label, .control-group span, .control-group button, .emergency-button {
    font-size: 1rem;
  }
  .agentic-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }
  .compact-sensors-panel {
    width: 100%;
    min-width: 0;
    margin-bottom: 0.7rem;
    order: 1;
  }
  .agentic-hub {
    width: 100%;
    min-width: 0;
    margin-bottom: 0.7rem;
    order: 2;
  }
  .chatbot-panel {
    width: 100%;
    min-width: 0;
    margin-bottom: 0.7rem;
    order: 3;
    position: static !important;
  }
  .agent {
    font-size: 1.2rem;
    width: 2rem;
    height: 2rem;
  }
  .agent-activity {
    font-size: 0.9rem;
    max-height: 100px;
  }
  .chatbot-title {
    font-size: 1.1rem;
  }
  .chat-messages {
    font-size: 0.98rem;
    max-height: 160px;
    min-height: 80px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
  }
  .chat-input-area {
    flex-direction: row;
    gap: 0.5rem;
  }
  .chat-input {
    font-size: 1rem;
    padding: 0.5rem 0.7rem;
  }
  .send-button {
    font-size: 1.1rem;
    padding: 0.5rem 0.7rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .metric-card {
    font-size: 0.98rem;
    padding: 0.7rem 0.89rem;
    margin-bottom: 0.7rem;
  }
  .footer__logo {
    font-size: 1.19rem;
  }
  .footer__tagline, .footer__link, .footer__bottom {
    font-size: 0.93rem;
  }
  .footer__links {
    flex-direction: column;
    gap: 0.5rem;
  }
  .footer__bottom {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    text-align: left;
  }
  /* Reduce all vertical and horizontal gaps, paddings, and margins for compactness */
  section, .case-study-section, .system-description, .dashboard-main, .control-panel {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
  }
  h1, h2, h3, h4, h5, h6, p {
    margin-bottom: 0.5em;
  }
}

/* ...existing code... */

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.btn:hover {
  background: var(--color-border);
  color: var(--color-background);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--primary {
  background: #dc3545;
  color: #ffffff;
  border-color: #dc3545;
  font-weight: var(--font-weight-bold);
}

.btn--primary:hover {
  background: #c82333;
  color: #ffffff;
  border-color: #c82333;
}

.btn--primary:active {
  background: #bd2130;
  border-color: #bd2130;
  transform: translateY(0);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-border);
  color: var(--color-background);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-border);
  color: var(--color-background);
  transform: translateY(-2px);
}

.btn--sm {
  padding: var(--space-8) var(--space-16);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-16) var(--space-32);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

.btn--full-width {
  width: 100%;
}

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

/* Header - Always visible */
.header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  background: var(--color-background);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--color-border);
  transition: none !important;
  min-height: var(--header-height);
  box-shadow: var(--shadow-md);
  transform: translateY(0) !important;
}

.header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
  padding: var(--space-8) 0;
}

.header__logo .logo-text {
  font-size: 1.3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.nav__list {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav__link {
  text-decoration: none;
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  transition: color 0.3s ease;
  position: relative;
  font-size: var(--font-size-sm);
}

.nav__link:hover {
  color: var(--color-primary);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle with Black Icons */
.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-background);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.theme-toggle:hover {
  background: var(--color-border);
  color: var(--color-background);
  transform: scale(1.1);
}

.theme-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: var(--theme-toggle-bg, #f3f3f3);
  font-size: 1.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  box-sizing: border-box;
  position: relative;
}

/* 🌞 Light Mode: Show BLACK MOON on light background */
.theme-toggle__icon::before {
  content: '🌙';  /* Black moon emoji */
  font-size: 1.25rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: brightness(0) saturate(100%); /* Makes emoji completely black */
}

/* 🌙 Dark Mode: Show BLACK SUN on dark background */
[data-theme="dark"] .theme-toggle__icon::before {
  content: '☀️';  /* Black sun emoji */
  filter: brightness(0) saturate(100%); /* Makes emoji completely black */
}

/* Alternative Method: Using Unicode Text Icons (if emojis don't work well) */
/*
.theme-toggle__icon::before {
  content: '●';  /* Black circle for moon 
  font-size: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000000;  /* Force black color 
}

[data-theme="dark"] .theme-toggle__icon::before {
  content: '◐';  /* Half circle for sun 
  color: #000000;  /* Force black color 
}
*/

/* Method 3: Simple Text Icons (Most Reliable) */
/*
.theme-toggle__icon::before {
  content: 'MOON';
  font-size: 0.7rem;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000000;
  letter-spacing: -0.5px;
}

[data-theme="dark"] .theme-toggle__icon::before {
  content: 'SUN';
  color: #000000;
}
*/

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: none;
  border: 2px solid var(--color-border);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.mobile-menu-toggle span {
  width: 1.75rem;
  height: 0.2rem;
  background: var(--color-text);
  transition: all 0.3s ease;
}

/* Hero Section */
.hero {
  padding: 7rem 0 3rem;
  background: var(--color-background);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.hero__text {
  max-width: 65rem;
}

.hero__title {
  margin-bottom: 1.5rem;
}

.hero__name {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  font-size: 3.5rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

.hero__subtitle {
  display: block;
  font-size: 1.5rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.hero__tagline {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  font-weight: var(--font-weight-medium);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat {
  text-align: left;
}

.stat__value {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat__label {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero__social {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  background: var(--color-border);
  color: var(--color-background);
  transform: translateY(-0.25rem);
}

/* Profile Image - Updated with Real Image Support and No Gradient */
.hero__image {
  justify-self: end;
}

.profile-image-placeholder {
  width: 28rem;
  height: 32rem;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Remove the rotating gradient background */
.profile-image-placeholder::before {
  display: none;
}

.profile-image-placeholder:hover {
  border-color: var(--color-primary);
  background: var(--color-secondary);
  transform: scale(1.02); /* Subtle scale instead of 1.05 */
}

/* Real profile image styles */
.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.profile-image-placeholder:hover .profile-image {
  transform: scale(1.05);
}

/* Hide placeholder content when real image is present */
.profile-image-placeholder:has(.profile-image) .profile-image-content {
  display: none;
}

.profile-image-content {
  text-align: center;
  color: var(--color-text);
}

.profile-image-content svg {
  margin-bottom: 0.75rem;
  opacity: 0.7;
  width: 80px;
  height: 80px;
}

.profile-image-content p {
  margin: 0;
  font-weight: var(--font-weight-bold);
  font-size: 1.25rem;
}

/* Sections */
section {
  padding: 6rem 0;
  background-color: var(--color-background);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 65rem;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  margin-bottom: 1rem;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin: 0;
  font-weight: var(--font-weight-medium);
}

/* Services Section */
.services {
  background: var(--color-surface);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-0.75rem);
  box-shadow: var(--shadow-lg);
  background: var(--color-border);
}

.service-card:hover * {
  color: var(--color-background) !important;
}

.service-card__title {
  margin-bottom: 1.5rem;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.service-card__description {
  margin-bottom: 1.5rem;
  color: var(--color-text-secondary);
  flex-grow: 1;
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
}

.service-card__features {
  list-style: none;
  margin: 0 0 2rem 0;
  padding: 0;
}

.service-card__features li {
  padding: 0.75rem 0;
  color: var(--color-text-secondary);
  position: relative;
  padding-left: 1.75rem;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
}

.service-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-text);
  font-weight: bold;
  transition: color 0.3s ease;
}

.service-card__action {
  margin-top: auto;
}

/* Expertise Section */
.expertise__filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 2rem;
  background: transparent;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: var(--font-size-base);
}

.filter-btn:hover {
  background: var(--color-border);
  color: var(--color-background);
  transform: translateY(-2px);
}

.filter-btn--active {
  background: var(--color-border);
  color: var(--color-background);
}

.expertise__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.expertise__item {
  background: var(--color-surface);
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.expertise__item:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-md);
  background: var(--color-border);
}

.expertise__item:hover * {
  color: var(--color-background) !important;
}

/* Updated Logo Container Styles - Larger and No Border */
.expertise__logo-container {
  width: 14rem;      /* Increased from 8rem */
  height: 12rem;      /* Increased from 6rem */
  padding: 1.5rem;   /* Increased padding */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.expertise__logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: brightness(1) contrast(1);
  opacity: 0;
  animation: logoFadeIn 0.5s ease forwards;
}

/* Dark mode logo adjustments */
[data-theme="dark"] .expertise__logo {
  filter: brightness(1.2) contrast(0.9);
}

/* Hover effects for logo containers - No background change */
.expertise__item:hover .expertise__logo-container {
  background: transparent; /* Keep transparent */
  transform: scale(1.1); /* Slightly larger scale */
}

/* Logo specific hover effects */
.expertise__item:hover .expertise__logo {
  filter: brightness(1.2) contrast(1.1);
  transform: scale(1.05);
}

/* Dark mode hover adjustments */
[data-theme="dark"] .expertise__item:hover .expertise__logo {
  filter: brightness(1.4) contrast(1);
}

/* Remove the old placeholder styles */
.expertise__logo-placeholder {
  display: none;
}

/* Logo loading animation */
@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Error handling for broken images */
.expertise__logo:not([src]),
.expertise__logo[src=""],
.expertise__logo:not([alt]) {
  display: none;
}

/* Fallback placeholder for missing case study images */
.case-study-image-placeholder {
  width: 100%;
  height: 60%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 3rem;
}

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

.expertise__name {
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-bold);
  font-size: 1.25rem;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.expertise__description {
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
}

.expertise__date {
  display: none;
}

/* Impact Case Studies Section - Real Image Thumbnails */
.impact-studies {
  background: var(--color-surface);
}

.impact-studies__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.case-study-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 2px solid var(--color-border);
  cursor: pointer;
  position: relative;
  height: 300px;
  display: flex;
  flex-direction: column;
}

/* Remove the gradient background */
.case-study-card::before {
  display: none;
}

/* Case study image container */
.case-study-image {
  width: 100%;
  height: 60%; /* 60% of card height for image */
  overflow: hidden;
  position: relative;
}

.case-study-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.case-study-card:hover .case-study-image img {
  transform: scale(1.05);
}

/* Case study content updated */
.case-study-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  background: var(--color-background);
  width: 100%;
  color: var(--color-text);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  font-size: 1rem;
  line-height: 1.6;
}

.case-study-content:hover {
  background: var(--color-border);
  color: var(--color-background);
}

.case-study-content:hover * {
  color: var(--color-background) !important;
} 


/* Gallery */

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem; /* Match expertise section gap */
  margin: 0 auto;
  max-width: 1300px;
  padding: 0 1rem;
}

.gallery__item {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: box-shadow 0.1s, transform 0.1s;
  height: 420px; /* Fixed card height for uniformity */
  min-height: 420px;
  max-height: 420px;
}

.gallery__item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-0.5rem);
}

.gallery__placeholder {
  width: 100%;
  height: 70%; /* 60% of card height for image */
  min-height: 0;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform 0.3s;
}

.gallery__item:hover .gallery__image {
  transform: scale(1.04);
}

.gallery__caption {
  width: 100%;
  /* flex: 1 1 0; */
  text-align: match-parent;
  background: var(--color-surface, #f9f9f9);
  padding: 1rem 1rem;
  font-size: 1rem;
  color: var(--color-text, #222);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  border-top: 1px solid #eee;
  /* box-sizing: border-box; */
  line-height: 1;
  display: block;
  align-items: stretch;
  justify-content: stretch;
  /* Justify last line */
  position: static;
}
.gallery__caption::after {
  content: '';
  display: inline-block;
  width: 100%;
  height: 0;
}

@media (max-width: 700px) {
  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  .gallery__item {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
  }
  .gallery__caption {
    font-size: 1rem;
    padding: 1rem 0.5rem;
  }
}



/* Dashboard-specific styles extending the main CSS */
.dashboard-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #764ba2 100%);
  padding: 8rem 0 4rem;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 40vh;
  display: flex;
  align-items: center;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.dashboard-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 65rem;
  margin: 0 auto;
}

.dashboard-hero__title {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: white;
  margin-bottom: 1rem;
  letter-spacing: var(--letter-spacing-tight);
}

.dashboard-hero__subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: var(--font-weight-medium);
}

.control-panel {
  background: var(--color-surface);
  padding: 2rem 0;
  border-bottom: 2px solid var(--color-border);
}

.control-panel__content {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.control-group {
  background: var(--color-background);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}

.control-group:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.control-group label {
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  margin-bottom: 0.5rem;
}

.control-group select,
.control-group button {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.control-group button {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.control-group button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.emergency-button {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  animation: pulse 2s infinite;
  font-size: 1rem !important;
  padding: 1rem 1.5rem !important;
  font-weight: var(--font-weight-bold) !important;
}

.emergency-button:hover {
  background: #c82333 !important;
  border-color: #c82333 !important;
}

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

.dashboard-main {
  padding: 4rem 0;
  background: var(--color-background);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.sensors-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sensors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.system-description {
  background: var(--color-surface);
  padding: 4rem 0;
  border-bottom: 2px solid var(--color-border);
}

.description-content {
  text-align: center;
  max-width:  80rem;
  margin: 0 auto;
}

.description-title {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 3rem;
  text-align: center;
}

.description-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.description-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  text-align: left;
}

.description-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.description-card__title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1rem;
}

.description-card__text {
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: var(--font-size-base);
}

.chart-legend {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  border: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .chart-legend {
  background: rgba(255, 255, 255, 0.05);
}

.chart-legend-title {
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.chart-legend-items {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-indicator {
  width: 12px;
  height: 3px;
  border-radius: 1px;
}

.sensor-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.sensor-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: var(--shadow-lg);
  background: var(--color-primary);
}

.sensor-card:hover * {
  color: white !important;
}

.sensor-card:hover select {
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--color-text) !important;
  border-color: white !important;
}

.sensor-card:hover .tech-badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sensor-name {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  transition: color 0.3s ease;
}

.status-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

.status-normal {
  background: #4CAF50;
}

.status-warning {
  background: #FF9800;
}

.status-critical {
  background: #f44336;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.sensor-model-selector {
  margin-bottom: 1.5rem;
}

.sensor-model-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  transition: color 0.3s ease;
}

.sensor-model-selector select {
  width: 100%;
  background: var(--color-background);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
}

.sensor-ranges {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .sensor-ranges {
  background: rgba(255, 255, 255, 0.05);
}

.range-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  font-weight: var(--font-weight-medium);
}

.range-bar {
  height: 25px;
  background: linear-gradient(to right, #4CAF50 30%, #FF9800 60%, #f44336 100%);
  border-radius: var(--radius-full);
  position: relative;
  margin-bottom: 0.75rem;
}

.range-indicator {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 35px;
  background: var(--color-text);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.sensor-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.value-item {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

[data-theme="dark"] .value-item {
  background: rgba(255, 255, 255, 0.05);
}

.value-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-medium);
  transition: color 0.3s ease;
}

.value-number {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  transition: color 0.3s ease;
}

.chart-container {
  height: 150px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .chart-container {
  background: rgba(255, 255, 255, 0.05);
}

.model-prediction {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .model-prediction {
  background: rgba(255, 255, 255, 0.05);
}

.prediction-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-medium);
}

.prediction-value {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.prediction-accuracy {
  font-size: var(--font-size-xs);
  color: #4CAF50;
  font-weight: var(--font-weight-medium);
}

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

.analytics-panel,
.spectrogram-panel,
.notifications-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.analytics-panel:hover,
.spectrogram-panel:hover,
.notifications-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.panel-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1.5rem;
  text-align: center;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.analytics-card {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .analytics-card {
  background: rgba(255, 255, 255, 0.05);
}

.analytics-card__title {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-medium);
}

.analytics-card__value {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.spectrogram-selector {
  margin-bottom: 1.5rem;
}

.spectrogram-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.spectrogram-selector select {
  width: 100%;
  background: var(--color-background);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.spectrogram-container {
  height: 300px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  position: relative;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .spectrogram-container {
  background: rgba(255, 255, 255, 0.05);
}

.spectrogram-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .spectrogram-legend {
  background: rgba(255, 255, 255, 0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-xs);
  color: var(--color-text);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.notification-item {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 4px solid;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .notification-item {
  background: rgba(255, 255, 255, 0.05);
}

.notification-warning {
  border-left-color: #FF9800;
}

.notification-critical {
  border-left-color: #f44336;
}

.notification-info {
  border-left-color: #2196F3;
}

.notification-message {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.notification-timestamp {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.refresh-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.refresh-time {
  color: #4CAF50;
  font-weight: var(--font-weight-bold);
}

/* Mobile Responsive Design */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sensors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .description-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-hero__title {
    font-size: 2rem;
  }

  .dashboard-hero__subtitle {
    font-size: 1rem;
  }

  .control-panel__content {
    flex-direction: column;
    gap: 1rem;
  }

  .control-group {
    width: 100%;
    max-width: 300px;
  }

  .sensors-grid {
    grid-template-columns: 1fr;
  }

  .description-grid {
    grid-template-columns: 1fr;
  }

  .sensor-values {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .spectrogram-legend {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .chart-container {
    height: 120px;
  }

  .spectrogram-container {
    height: 250px;
  }

  .chart-legend-items {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .dashboard-hero {
    padding: 6rem 0 3rem;
  }

  .dashboard-hero__title {
    font-size: 1.75rem;
  }

  .sensor-card {
    padding: 1.5rem;
  }

  .analytics-panel,
  .spectrogram-panel,
  .notifications-panel {
    padding: 1.5rem;
  }
}


/* Agentic AI specific styles that extend the main CSS */

/* Agent Hub Central Panel */
.agentic-hub {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 2px solid var(--color-border);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.agentic-hub:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.hub-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.agents-circle {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 2rem;
  border: 2px dashed var(--color-border);
  border-radius: 50%;
  animation: rotate 30s linear infinite;
}

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

.central-brain {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, var(--color-primary) 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: pulse-brain 2s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(45, 106, 142, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.central-brain:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

@keyframes pulse-brain {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

.agent {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: float 3s ease-in-out infinite;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.agent:hover {
  transform: scale(1.2) !important;
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

/* Agent positioning */
.agent-monitor {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 0s;
}

.agent-predict {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  animation-delay: 0.5s;
}

.agent-optimize {
  background: linear-gradient(45deg, #a8edea, #fed6e3);
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 1s;
}

.agent-alert {
  background: linear-gradient(45deg, #ffecd2, #fcb69f);
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  animation-delay: 1.5s;
}

.agent-learn {
  background: linear-gradient(45deg, #667eea, #764ba2);
  top: 80px;
  right: 80px;
  animation-delay: 2s;
}

.agent-coordinate {
  background: linear-gradient(45deg, #f093fb, #f5576c);
  bottom: 80px;
  left: 80px;
  animation-delay: 2.5s;
}

/* Agent Activity Log */
.agent-activity {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .agent-activity {
  background: rgba(255, 255, 255, 0.1);
}

.activity-log {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
  color: var(--color-text-secondary);
}

.activity-timestamp {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

/* Chatbot Panel */
.chatbot-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 600px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.chatbot-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chatbot-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.chatbot-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.chatbot-status {
  font-size: 0.9rem;
  color: #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  animation: blink 1s infinite;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .chat-messages {
  background: rgba(255, 255, 255, 0.05);
}

.message {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.bot-avatar {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.user-avatar {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.system-avatar {
  background: linear-gradient(45deg, var(--color-primary), #764ba2);
}

.message-content {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.message-time {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
}

.chat-input-area {
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-background);
  color: var(--color-text);
  outline: none;
  transition: all 0.3s ease;
}

.chat-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.chat-input::placeholder {
  color: var(--color-text-secondary);
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.send-button:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* Dashboard Layout Override for Agentic */
.agentic-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 400px 1fr;
  gap: 2rem;
}

.compact-sensors-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.compact-sensor-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.compact-sensor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--color-primary);
}

.compact-sensor-card:hover * {
  color: white !important;
}

.compact-sensor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.compact-sensor-name {
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  transition: color 0.3s ease;
}

.compact-sensor-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.compact-value {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

[data-theme="dark"] .compact-value {
  background: rgba(255, 255, 255, 0.05);
}
