:root {
  /* Colors */
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);
  --color-select-caret: rgba(19, 52, 59, 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

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

  /* 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;

  /* 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.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --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;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

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

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: rgba(31, 33, 33, 1);
    --color-surface: rgba(38, 40, 40, 1);
    --color-text: rgba(245, 245, 245, 1);
    --color-text-secondary: rgba(167, 169, 169, 0.7);
    --color-primary: rgba(50, 184, 198, 1);
    --color-primary-hover: rgba(45, 166, 178, 1);
    --color-primary-active: rgba(41, 150, 161, 1);
    --color-secondary: rgba(119, 124, 124, 0.15);
    --color-secondary-hover: rgba(119, 124, 124, 0.25);
    --color-secondary-active: rgba(119, 124, 124, 0.3);
    --color-border: rgba(119, 124, 124, 0.3);
    --color-error: rgba(255, 84, 89, 1);
    --color-success: rgba(50, 184, 198, 1);
    --color-warning: rgba(230, 129, 97, 1);
    --color-info: rgba(167, 169, 169, 1);
    --color-focus-ring: rgba(50, 184, 198, 0.4);
    --color-btn-primary-text: rgba(19, 52, 59, 1);
    --color-card-border: rgba(119, 124, 124, 0.2);
    --color-card-border-inner: rgba(119, 124, 124, 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(119, 124, 124, 0.2);
    --color-border-secondary: rgba(119, 124, 124, 0.2);
    --color-select-caret: rgba(245, 245, 245, 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: 50, 184, 198;
    --color-error-rgb: 255, 84, 89;
    --color-warning-rgb: 230, 129, 97;
    --color-info-rgb: 167, 169, 169;
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  --color-background: rgba(31, 33, 33, 1);
  --color-surface: rgba(38, 40, 40, 1);
  --color-text: rgba(245, 245, 245, 1);
  --color-text-secondary: rgba(167, 169, 169, 0.7);
  --color-primary: rgba(50, 184, 198, 1);
  --color-primary-hover: rgba(45, 166, 178, 1);
  --color-primary-active: rgba(41, 150, 161, 1);
  --color-secondary: rgba(119, 124, 124, 0.15);
  --color-secondary-hover: rgba(119, 124, 124, 0.25);
  --color-secondary-active: rgba(119, 124, 124, 0.3);
  --color-border: rgba(119, 124, 124, 0.3);
  --color-error: rgba(255, 84, 89, 1);
  --color-success: rgba(50, 184, 198, 1);
  --color-warning: rgba(230, 129, 97, 1);
  --color-info: rgba(167, 169, 169, 1);
  --color-focus-ring: rgba(50, 184, 198, 0.4);
  --color-btn-primary-text: rgba(19, 52, 59, 1);
  --color-card-border: rgba(119, 124, 124, 0.15);
  --color-card-border-inner: rgba(119, 124, 124, 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(119, 124, 124, 0.2);
  --color-select-caret: rgba(245, 245, 245, 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: 50, 184, 198;
  --color-error-rgb: 255, 84, 89;
  --color-warning-rgb: 230, 129, 97;
  --color-info-rgb: 167, 169, 169;
}

[data-color-scheme="light"] {
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  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;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  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;
}

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

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

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

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

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

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

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

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

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

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

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

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

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

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

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

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

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
  position: relative;
}

.search-input {
  margin-bottom: 8px;
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

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

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://www.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

:root {
  /* Colors */
  --color-background: rgba(252, 252, 249, 1);
  --color-surface: rgba(255, 255, 253, 1);
  --color-text: rgba(19, 52, 59, 1);
  --color-text-secondary: rgba(98, 108, 113, 1);
  --color-primary: rgba(33, 128, 141, 1);
  --color-primary-hover: rgba(29, 116, 128, 1);
  --color-primary-active: rgba(26, 104, 115, 1);
  --color-secondary: rgba(94, 82, 64, 0.12);
  --color-secondary-hover: rgba(94, 82, 64, 0.2);
  --color-secondary-active: rgba(94, 82, 64, 0.25);
  --color-border: rgba(94, 82, 64, 0.2);
  --color-btn-primary-text: rgba(252, 252, 249, 1);
  --color-card-border: rgba(94, 82, 64, 0.12);
  --color-card-border-inner: rgba(94, 82, 64, 0.12);
  --color-error: rgba(192, 21, 47, 1);
  --color-success: rgba(33, 128, 141, 1);
  --color-warning: rgba(168, 75, 47, 1);
  --color-info: rgba(98, 108, 113, 1);
  --color-focus-ring: rgba(33, 128, 141, 0.4);
  --color-focus-ring: rgba(33, 128, 141, 0.4);
  --color-select-caret: rgba(19, 52, 59, 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

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

  /* 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;

  /* 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.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --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;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

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

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: rgba(31, 33, 33, 1);
    --color-surface: rgba(38, 40, 40, 1);
    --color-text: rgba(245, 245, 245, 1);
    --color-text-secondary: rgba(167, 169, 169, 0.7);
    --color-primary: rgba(50, 184, 198, 1);
    --color-primary-hover: rgba(45, 166, 178, 1);
    --color-primary-active: rgba(41, 150, 161, 1);
    --color-secondary: rgba(119, 124, 124, 0.15);
    --color-secondary-hover: rgba(119, 124, 124, 0.25);
    --color-secondary-active: rgba(119, 124, 124, 0.3);
    --color-border: rgba(119, 124, 124, 0.3);
    --color-error: rgba(255, 84, 89, 1);
    --color-success: rgba(50, 184, 198, 1);
    --color-warning: rgba(230, 129, 97, 1);
    --color-info: rgba(167, 169, 169, 1);
    --color-focus-ring: rgba(50, 184, 198, 0.4);
    --color-btn-primary-text: rgba(19, 52, 59, 1);
    --color-card-border: rgba(119, 124, 124, 0.2);
    --color-card-border-inner: rgba(119, 124, 124, 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(119, 124, 124, 0.2);
    --color-border-secondary: rgba(119, 124, 124, 0.2);
    --color-select-caret: rgba(245, 245, 245, 0.8);

    /* RGB versions for dark mode */
    --color-success-rgb: 50, 184, 198;
    --color-error-rgb: 255, 84, 89;
    --color-warning-rgb: 230, 129, 97;
    --color-info-rgb: 167, 169, 169;
  }
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  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;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  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;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

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

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

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

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

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

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

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

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Application-specific styles */
.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
}

.app-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-8) 0;
  box-shadow: var(--shadow-sm);
}

.app-header h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-8);
  color: var(--color-text);
}

.app-header p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-16);
}

.commodity-filter {
  display: flex;
  gap: var(--space-8);
}

.filter-btn {
  transition: all var(--duration-fast) var(--ease-standard);
}

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

.main-content {
  flex: 1;
  display: flex;
  height: calc(100vh - 120px);
}

.map-container {
  flex: 1.5;
  position: relative;
  background-color: var(--color-surface);
}

#map {
  width: 100%;
  height: 100%;
}

.map-legend {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 1000;
}

.map-legend h4 {
  margin-bottom: var(--space-12);
  font-size: var(--font-size-md);
  color: var(--color-text);
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-8);
  font-size: var(--font-size-sm);
}

.legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: var(--space-8);
}

.legend-marker.primary-hub {
  background-color: #e74c3c;
  animation: pulse 2s infinite;
}

.legend-marker.destination {
  background-color: #3498db;
}
.legend-marker.Source {
  background-color: #3498db;
}
.legend-marker.production {
  background-color: #27ae60;
}

.legend-line {
  width: 20px;
  height: 3px;
  margin-right: var(--space-8);
  border-radius: var(--radius-sm);
}

.legend-line.mango-flow {
  background-color: #ff8c00;
}

.legend-line.mosambi-flow {
  background-color: #32cd32;
}

.legend-note {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-8);
  font-style: italic;
}

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

.side-panel {
  flex: 1.5;
  background-color: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.panel-tabs {
  display: flex;
  background-color: var(--color-secondary);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-12) var(--space-16);
  border: none;
  background-color: transparent;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

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

.tab-btn.active {
  background-color: var(--color-surface);
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-16);
}

.tab-content {
  display: none;
}

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

.tab-content h3 {
  margin-bottom: var(--space-16);
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--space-8);
}

.tab-content h4 {
  margin: var(--space-16) 0 var(--space-12) 0;
  color: var(--color-text);
}

.tab-content h5 {
  margin: var(--space-8) 0 var(--space-8) 0;
  color: var(--color-text);
  text-align: center;
}

/* Overview Tab Styles */
.overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-12);
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.stat-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.infrastructure-info,
.transport-info {
  margin-bottom: var(--space-24);
}

.info-item,
.transport-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.info-item:last-child,
.transport-item:last-child {
  border-bottom: none;
}

.info-label,
.transport-type {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.info-value,
.transport-capacity {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.production-share {
  margin-bottom: var(--space-24);
}

.share-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-12);
}

.share-commodity {
  width: 80px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.share-bar {
  flex: 1;
  height: 20px;
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
  margin: 0 var(--space-12);
  overflow: hidden;
}

.share-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width var(--duration-normal) var(--ease-standard);
}

.share-fill.mango {
  background-color: #ff8c00;
}

.share-fill.mosambi {
  background-color: #32cd32;
}

.share-percent {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  min-width: 50px;
  text-align: right;
}

/* Dependencies Tab Styles */
.commodity-section {
  margin-bottom: var(--space-32);
}

.dependency-chart-container {
  height: 250px;
  margin-bottom: var(--space-16);
}

/* Enhanced Table Styling */
.dependency-table {
  margin-bottom: var(--space-24);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
}

.dependency-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--font-size-sm);
  background: transparent;
}

.dependency-table thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: var(--color-btn-primary-text);
}

.dependency-table th {
  padding: var(--space-16) var(--space-12);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
  border: none;
  position: relative;
}

.dependency-table th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.dependency-table tbody tr {
  transition: all var(--duration-fast) var(--ease-standard);
  border-bottom: 1px solid var(--color-border);
}

.dependency-table tbody tr:hover {
  background: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dependency-table tbody tr:last-child {
  border-bottom: none;
}

.dependency-table td {
  padding: var(--space-12);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  border: none;
  vertical-align: middle;
}

/* Alternating row colors */
.dependency-table tbody tr:nth-child(even) {
  background-color: rgba(var(--color-primary-rgb, 33, 128, 141), 0.02);
}

/* Special styling for different data types */
.dependency-table td:nth-child(2) {
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

.dependency-table td:nth-child(3) {
  font-family: var(--font-family-mono);
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  margin: var(--space-2);
  text-align: center;
}

/* Percentage indicators */
.dependency-table td[data-type="percentage"]::after {
  content: '%';
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

/* Volume indicators with icons */
.dependency-table td[data-type="volume"] {
  position: relative;
}

.dependency-table td[data-type="volume"]::before {
  content: '📦';
  margin-right: var(--space-4);
  font-size: var(--font-size-xs);
}

/* State area and production tables */
#tbl-state-area,
#tbl-state-production {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-24);
}

#tbl-state-area thead,
#tbl-state-production thead {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

#tbl-state-area th,
#tbl-state-production th {
  padding: var(--space-16) var(--space-12);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--font-size-xs);
}

#tbl-state-area td,
#tbl-state-production td {
  padding: var(--space-12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background var(--duration-fast) var(--ease-standard);
}

#tbl-state-area tbody tr:hover,
#tbl-state-production tbody tr:hover {
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.1) 0%, transparent 100%);
}

/* Market facilities table */
#tbl-market-facilities {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#tbl-market-facilities thead {
  background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
  color: white;
}

#tbl-market-facilities tbody tr:nth-child(odd) {
  background: rgba(230, 126, 34, 0.05);
}

/* Price tables */
#tbl-prices-yearwise {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#tbl-prices-yearwise thead {
  background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
  color: white;
}

#tbl-prices-yearwise td:not(:first-child) {
  font-family: var(--font-family-mono);
  text-align: right;
  font-weight: var(--font-weight-medium);
}

/* Arrivals table */
#tbl-arrivals-batasingaram {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#tbl-arrivals-batasingaram thead {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  color: white;
}

#tbl-arrivals-batasingaram td:not(:first-child) {
  font-family: var(--font-family-mono);
  text-align: right;
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

/* Interactive elements */
.dependency-table tbody tr {
  cursor: pointer;
}

.dependency-table tbody tr:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive enhancements */
@media (max-width: 768px) {
  .dependency-table {
    font-size: var(--font-size-xs);
  }
  
  .dependency-table th,
  .dependency-table td {
    padding: var(--space-8);
  }
  
  /* Stack table on mobile */
  .dependency-table thead {
    display: none;
  }
  
  .dependency-table tbody tr {
    display: block;
    margin-bottom: var(--space-16);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-sm);
  }
  
  .dependency-table td {
    display: block;
    padding: var(--space-8) var(--space-12);
    border: none;
    border-bottom: 1px solid var(--color-border);
  }
  
  .dependency-table td:before {
    content: attr(data-label) ": ";
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    display: inline-block;
    width: 100px;
  }
}

/* Loading animation for tables */
@keyframes tableLoad {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.dependency-table {
  animation: tableLoad 0.5s var(--ease-standard) forwards;
}

/* Add data attributes to table cells for better mobile display */
.dependency-table td[data-label] {
  position: relative;
}


.source-analysis {
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  margin-top: var(--space-16);
}

.source-analysis p {
  margin-bottom: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.source-analysis p:last-child {
  margin-bottom: 0;
}

/* Flow Patterns Tab Styles */
.flow-analysis {
  margin-bottom: var(--space-32);
}

.flow-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.flow-chart-container {
  height: 200px;
}

.flow-insights {
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  margin-top: var(--space-16);
}

.flow-insights p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/* Seasonality Tab Styles */
.seasonality-charts {
  margin-bottom: var(--space-24);
}

.seasonality-chart-container {
  height: 300px;
  margin-bottom: var(--space-24);
}

.seasonal-insights {
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
}

.insight-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-border);
}

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

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

.insight-value {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Price & Trends Tab Styles */
.price-section {
  margin-bottom: var(--space-24);
}

.price-ranges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.price-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-16);
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
  text-align: center;
}

.price-commodity {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.price-range {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.trends-section {
  margin-bottom: var(--space-24);
}

.trends-chart-container {
  height: 250px;
  margin-bottom: var(--space-16);
}

.trend-insights {
  background-color: var(--color-secondary);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
}

/* Export Panel */
.export-panel {
  position: fixed;
  bottom: var(--space-16);
  right: var(--space-16);
  display: flex;
  gap: var(--space-8);
  z-index: 1000;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  
  .map-container {
    height: 40vh;
  }
  
  .side-panel {
    height: 60vh;
  }
  
  .panel-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 120px;
  }
  
  .overview-stats {
    grid-template-columns: 1fr;
  }
  
  .flow-comparison {
    grid-template-columns: 1fr;
  }
  
  .price-ranges {
    grid-template-columns: 1fr;
  }
  
  .map-legend {
    position: relative;
    top: auto;
    right: auto;
    margin: var(--space-8);
  }
  
  .export-panel {
    position: relative;
    bottom: auto;
    right: auto;
    margin: var(--space-16);
    justify-content: center;
  }
}

/* Chart.js Custom Styles */
.chart-container {
  position: relative;
  height: 100%;
  width: 100%;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Accessibility Improvements */
.tab-btn:focus,
.filter-btn:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.share-fill.watermelon{background:#0fb9b1}
.share-fill.muskmelon{background:#17a2b8}
.share-fill.papaya{background:#e67e22}
.share-fill.guava{background:#27ae60}
.share-fill.banana{background:#f1c40f}
.share-fill.pomegranate{background:#c0392b}
.share-fill.grapes{background:#8e44ad}
.share-fill.dragon{background:#e74c3c}
.share-fill.apple{background:#c0392b}
.share-fill.orange{background:#f39c12}
.flat-list{list-style:none;padding:0;margin:0}
.flat-list li{margin:6px 0;font-size:12px}
.app-header {
  background: #f0f9ff url('assets/header/batasingaram-market.jpg') no-repeat center center;
  background-size: cover;
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Add overlay for better text readability */
.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg, 
    rgba(252, 252, 249, 0.85) 0%, 
    rgba(255, 255, 253, 0.75) 50%,
    rgba(252, 252, 249, 0.9) 100%
  );
  z-index: 1;
}

.app-header .container {
  position: relative;
  z-index: 2;
}

/* Enhance text visibility over the background */
.app-header h1 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: var(--font-weight-bold);
  color: var(--color-text); /* Explicitly set text color */
}

.app-header p {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text-secondary); /* Explicitly set text color */
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-base);
  backdrop-filter: blur(2px);
}
.footfall-total {
  background-color: var(--color-secondary);
  border-top: 2px solid var(--color-primary) !important;
}

.footfall-total td {
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}
/* Enhanced destination and source marker styles */
.destination-marker-enhanced, .source-marker-enhanced {
  background: var(--color-surface);
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.destination-marker-enhanced:hover, .source-marker-enhanced:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.dest-icon, .source-icon {
  font-size: 14px;
}
/* Enhanced Filter System Styles */
.filter-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.commodity-filters,
.flow-classification-filters,
.scope-filters {
  margin-bottom: var(--space-16);
}

.commodity-filters h5,
.flow-classification-filters h5,
.scope-filters h5 {
  margin: 0 0 var(--space-8) 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-buttons {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.flow-buttons .filter-btn,
.scope-buttons .filter-btn {
  font-size: var(--font-size-xs);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-btn-primary-text);
  box-shadow: var(--shadow-sm);
}

/* Filter Status Display */
.filter-status {
  padding: var(--space-12);
  background: var(--color-secondary);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
  margin-top: var(--space-12);
}

.active-filters {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  align-items: center;
}

.active-filters::before {
  content: 'Active Filters:';
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-right: var(--space-4);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid;
}

.commodity-tag {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.flow-tag {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border-color: #3498db;
}

.scope-tag {
  background: rgba(142, 68, 173, 0.1);
  color: #8e44ad;
  border-color: #8e44ad;
}

/* Enhanced Flow Line Styling */
.arrival-flow {
  stroke-dasharray: 8,4;
  animation: flowAnimationInbound 2s linear infinite;
}

.dispatch-flow {
  stroke-dasharray: 12,6;
  animation: flowAnimationOutbound 2.5s linear infinite;
}

@keyframes flowAnimationInbound {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

@keyframes flowAnimationOutbound {
  100% { stroke-dashoffset: 0; }
  0% { stroke-dashoffset: 36; }
}

/* Enhanced Tooltips */
.arrival-tooltip {
  background: rgba(27, 158, 119, 0.95) !important;
  color: white !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(27, 158, 119, 1) !important;
}

.dispatch-tooltip {
  background: rgba(217, 95, 2, 0.95) !important;
  color: white !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(217, 95, 2, 1) !important;
}

/* Responsive Design for Filter System */
@media (max-width: 768px) {
  .filter-buttons {
    justify-content: center;
  }
  
  .filter-btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
  
  .active-filters {
    justify-content: center;
  }
  
  .active-filters::before {
    width: 100%;
    text-align: center;
    margin-bottom: var(--space-4);
  }
}

/* Filter Animation Effects */
.filter-btn {
  transition: all var(--duration-fast) var(--ease-standard);
  position: relative;
  overflow: hidden;
}

.filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--duration-normal) var(--ease-standard);
}

.filter-btn:hover::before {
  left: 100%;
}
/* Unified Filter System */
.unified-filter-system {
  background: var(--color-surface);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-12);
}

.filter-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-12);
  gap: var(--space-12);
}

.filter-row:last-child {
  margin-bottom: 0;
}

.row-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  min-width: 100px;
  flex-shrink: 0;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
}

.unified-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-10);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}

.unified-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-secondary);
  transform: translateY(-1px);
}

.unified-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.unified-status {
  text-align: center;
  padding: var(--space-8);
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: var(--space-12);
}

.status-unified {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
}

.status-commodity {
  color: var(--color-text);
}

.status-separator {
  color: var(--color-text-secondary);
}

.status-flow {
  color: var(--color-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
  }
  
  .row-label {
    min-width: auto;
  }
  
  .button-group {
    justify-content: center;
    width: 100%;
  }
  
  .unified-btn {
    flex: 0 1 auto;
    min-width: 70px;
    text-align: center;
  }
}

/* Button animation effects */
.unified-btn {
  position: relative;
  overflow: hidden;
}

.unified-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--duration-normal) var(--ease-standard);
}

.unified-btn:hover::before {
  left: 100%;
}

.unified-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
/* Upstream/Downstream Tab Specific Styles */
.analysis-section {
  margin-bottom: var(--space-24);
  background: var(--color-surface);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.analysis-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.analysis-section h4 {
  margin-bottom: var(--space-16);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--space-4);
}

/* Remove old list styles */
#list-upstream, #list-downstream,
#list-upstream li, #list-downstream li {
    display: none;
}
/* Classification badges for interdependency matrices */
.classification-badge {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classification-badge.moderate-sink {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.classification-badge.low-sink {
  background: rgba(230, 126, 34, 0.1);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.classification-badge.state-sink {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.classification-badge.high-source {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.classification-badge.moderate-source {
  background: rgba(155, 89, 182, 0.1);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.classification-badge.low-source {
  background: rgba(52, 73, 94, 0.1);
  color: #34495e;
  border: 1px solid rgba(52, 73, 94, 0.3);
}

.classification-badge.state-source {
  background: rgba(26, 188, 156, 0.1);
  color: #1abc9c;
  border: 1px solid rgba(26, 188, 156, 0.3);
}
/* Enhanced classification badges for consolidated dependencies */
.classification-badge {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Outbound (sink) classifications */
.classification-badge.moderate-sink {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.classification-badge.low-sink {
  background: rgba(230, 126, 34, 0.1);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.classification-badge.primary-sink {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.classification-badge.major-sink {
  background: rgba(155, 89, 182, 0.1);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

/* Inbound (source) classifications */
.classification-badge.high-source {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.classification-badge.moderate-source {
  background: rgba(155, 89, 182, 0.1);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.classification-badge.low-source {
  background: rgba(52, 73, 94, 0.1);
  color: #34495e;
  border: 1px solid rgba(52, 73, 94, 0.3);
}

.classification-badge.primary-source {
  background: rgba(26, 188, 156, 0.1);
  color: #1abc9c;
  border: 1px solid rgba(26, 188, 156, 0.3);
}

/* Enhanced table styling for consolidated dependencies */
.commodity-section h4 {
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-8);
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
}

/* Column-specific styling */
#tab-outbound td:nth-child(2), #tab-inbound td:nth-child(2) {
  font-weight: var(--font-weight-semibold);
  color: var(--color-success);
}

#tab-outbound td:nth-child(3), #tab-inbound td:nth-child(3) {
  font-family: var(--font-family-mono);
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  text-align: center;
}

#tab-outbound td:nth-child(4), #tab-inbound td:nth-child(4) {
  font-family: var(--font-family-mono);
  color: var(--color-info);
  text-align: center;
}
/* Seasonality Tab Specific Styles */
.seasonality-controls {
  margin-bottom: var(--space-24);
  background: var(--color-secondary);
  padding: var(--space-16);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border);
}

.seasonality-chart-section {
  margin-bottom: var(--space-32);
}

.seasonality-chart-section h4 {
  margin-bottom: var(--space-16);
  text-align: center;
  color: var(--color-text);
  padding: var(--space-8);
  background: var(--color-secondary);
  border-radius: var(--radius-base);
}

.seasonality-chart-container {
  height: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.commodity-details {
  margin-bottom: var(--space-32);
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-base);
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.detail-card h5 {
  margin-bottom: var(--space-12);
  color: var(--color-primary);
  font-size: var(--font-size-md);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-8);
}

.season-info {
  border-left: 4px solid var(--color-primary);
}

.peak-months {
  border-left: 4px solid var(--color-warning);
}

.seasonality-summary {
  margin-top: var(--space-32);
}

.seasonality-summary h4 {
  margin-bottom: var(--space-16);
  color: var(--color-text);
  text-align: center;
  padding: var(--space-8);
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border-radius: var(--radius-base);
}

/* Pattern badges */
.pattern-badge {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pattern-badge.highly-seasonal {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.pattern-badge.moderately-seasonal {
  background: rgba(243, 156, 18, 0.1);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.pattern-badge.year-round-availability {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

/* Enhanced seasonality table */
#tbl-seasonality-summary {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#tbl-seasonality-summary thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
}

#tbl-seasonality-summary th {
  padding: var(--space-16) var(--space-12);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--font-size-sm);
}

#tbl-seasonality-summary td {
  padding: var(--space-12);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

#tbl-seasonality-summary tbody tr:hover {
  background: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive design for seasonality */
@media (max-width: 768px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .seasonality-chart-container {
    height: 300px;
    padding: var(--space-12);
  }
  
  .seasonality-controls {
    padding: var(--space-12);
  }
}
/* Category badges for price summary (similar to seasonality badges) */
.category-badge {
    display: inline-block;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.major {
    background: rgba(33, 128, 141, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(33, 128, 141, 0.3);
}

.category-badge.premium {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.category-badge.exotic {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.category-badge.standard {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

/* Enhanced price details grid for all commodities (same as seasonality) */
.price-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-16);
    max-height: 600px;
    overflow-y: auto;
}

/* Price variation styling */
.price-variation {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-warning);
    background: rgba(var(--color-warning-rgb), 0.1);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
}
/* Fixed upstream/downstream styling - better visibility and light background */
.simple-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
    padding: var(--space-12);
    /* Light background instead of harsh white */
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-base);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.simple-search-input {
    flex: 1;
    padding: var(--space-10) var(--space-14);
    border: 2px solid #d1d5db;
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    /* Light background instead of white */
    background: #ffffff;
    color: #1f2937; /* Dark text for good contrast */
    transition: all var(--duration-fast) var(--ease-standard);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.simple-search-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

.simple-search-input::placeholder {
    color: #6b7280; /* Better contrast for placeholder */
    opacity: 1;
}

.search-count {
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    color: white;
    padding: var(--space-6) var(--space-12);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(33, 128, 141, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Enhanced flat list styling - prevent layout shift */
#list-upstream, #list-downstream {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    border: 1px solid var(--color-border);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: var(--shadow-inner);
    scroll-behavior: smooth;
}

/* Custom scrollbar styling */
#list-upstream::-webkit-scrollbar, #list-downstream::-webkit-scrollbar {
    width: 8px;
}

#list-upstream::-webkit-scrollbar-track, #list-downstream::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: var(--radius-full);
}

#list-upstream::-webkit-scrollbar-thumb, #list-downstream::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), rgba(33, 128, 141, 0.7));
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#list-upstream::-webkit-scrollbar-thumb:hover, #list-downstream::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(33, 128, 141, 0.3);
}

/* Enhanced list items with better visibility */
#list-upstream li, #list-downstream li {
    margin-bottom: var(--space-12);
    padding: var(--space-14) var(--space-16);
    /* Light background instead of white */
    background: #ffffff;
    border-radius: var(--radius-base);
    border-left: 4px solid var(--color-primary);
    transition: all var(--duration-standard) var(--ease-standard);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    /* Better text color for visibility */
    color: #1f2937;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

#list-upstream li:last-child, #list-downstream li:last-child {
    margin-bottom: 0;
}

#list-upstream li:hover, #list-downstream li:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, rgba(33, 128, 141, 0.9) 100%);
    color: white;
    transform: translateX(6px) translateY(-1px);
    box-shadow: 0 6px 20px rgba(33, 128, 141, 0.25);
    border-left-color: white;
    border-color: var(--color-primary);
}

#list-upstream li strong, #list-downstream li strong {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    display: inline-block;
    min-width: 28px;
    margin-right: var(--space-8);
}

#list-upstream li:hover strong, #list-downstream li:hover strong {
    color: #fef3c7; /* Better contrast on hover */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#list-upstream li, #list-downstream li {
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Enhanced section containers - prevent layout shift */
.analysis-section {
    margin-bottom: var(--space-24);
    /* Light background instead of white */
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    /* Prevent layout shift */
    contain: layout;
}

.analysis-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(33, 128, 141, 0.6) 50%, var(--color-primary) 100%);
}

.analysis-section h4 {
    margin-bottom: var(--space-20);
    /* Better text color for visibility */
    color: #111827;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    padding-bottom: var(--space-12);
    border-bottom: 2px solid var(--color-primary);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.analysis-section h4::before {
    content: '📊';
    font-size: 1.2em;
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    padding: var(--space-6);
    border-radius: var(--radius-full);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(33, 128, 141, 0.3);
}

#tab-upstream-downstream .analysis-section {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#tab-upstream-downstream .analysis-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Loading states - prevent layout shift */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6b7280;
    font-style: italic;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--radius-base);
}

/* Prevent flash of unstyled content */
#list-upstream li, #list-downstream li {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#list-upstream li.loaded, #list-downstream li.loaded {
    opacity: 1;
}

/* Responsive design - maintain good contrast */
@media (max-width: 768px) {
    .simple-search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-12);
        padding: var(--space-16);
    }
    
    .search-count {
        text-align: center;
        background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.9));
    }
    
    #list-upstream, #list-downstream {
        max-height: 350px;
        padding: var(--space-12);
        min-height: 250px;
    }
    
    #list-upstream li, #list-downstream li {
        padding: var(--space-12);
        font-size: var(--font-size-sm);
        color: #374151; /* Maintain good contrast on mobile */
    }
    
    .analysis-section {
        padding: var(--space-16);
        margin-bottom: var(--space-20);
    }
}

/* Additional fixes for text visibility */
.simple-search-input::-webkit-input-placeholder { color: #6b7280; opacity: 1; }
.simple-search-input:-ms-input-placeholder { color: #6b7280; opacity: 1; }
.simple-search-input::placeholder { color: #6b7280; opacity: 1; }

/* High contrast mode support */
@media (prefers-contrast: high) {
    #list-upstream li, #list-downstream li {
        color: #000000;
        border: 2px solid #000000;
    }
    
    .simple-search-input {
        color: #000000;
        border: 2px solid #000000;
    }
    
    .simple-search-input::placeholder {
        color: #666666;
    }
}
/* Enhanced Price & Trends Tab Styling with Light Backgrounds */

/* Main tab content background */
#tab-price {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    margin: var(--space-8);
    border: 1px solid #e2e8f0;
}

/* Price controls background */
.price-controls {
    margin-bottom: var(--space-24);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: var(--space-16);
    border-radius: var(--radius-base);
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.price-controls h4 {
    margin-bottom: var(--space-16);
    color: #1f2937;
    font-weight: var(--font-weight-semibold);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--space-8);
}

/* Enhanced form control styling */
.price-controls .form-control {
    background: #ffffff;
    border: 2px solid #d1d5db;
    color: #1f2937;
    font-weight: var(--font-weight-medium);
}

.price-controls .form-control:focus {
    border-color: var(--color-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
}

.price-controls .form-label {
    color: #374151;
    font-weight: var(--font-weight-semibold);
}

/* Price chart section */
.price-chart-section {
    margin-bottom: var(--space-32);
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.price-chart-section h4 {
    margin-bottom: var(--space-16);
    text-align: center;
    color: #1f2937;
    padding: var(--space-12);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: var(--radius-base);
    border: 1px solid #d1d5db;
}

.price-chart-container {
    height: 400px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

/* Price details section */
.price-details {
    margin-bottom: var(--space-32);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #e5e7eb;
}

.price-details h4 {
    margin-bottom: var(--space-16);
    color: #1f2937;
    text-align: center;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    color: white;
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
}

/* Enhanced price details grid */
.price-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-16);
    max-height: 500px;
    overflow-y: auto;
    padding: var(--space-8);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-base);
}

/* Enhanced price cards */
.price-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all var(--duration-standard) var(--ease-standard);
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.price-card h5 {
    margin-bottom: var(--space-12);
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--space-8);
}

/* Enhanced price metrics */
.price-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.price-metric {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: var(--space-12);
    border-radius: var(--radius-base);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.price-metric label {
    font-size: var(--font-size-xs);
    color: #6b7280;
    display: block;
    margin-bottom: var(--space-4);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: #1f2937;
}

/* Price variation styling */
.price-variation {
    text-align: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-base);
    margin-bottom: var(--space-12);
    border: 1px solid #f59e0b;
}

.price-variation strong {
    color: #92400e;
    font-weight: var(--font-weight-bold);
}

/* Enhanced trend and volatility badges */
.trend-badge, .volatility-badge {
    display: inline-block;
    padding: var(--space-6) var(--space-10);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: capitalize;
    letter-spacing: 0.5px;
    margin: var(--space-2);
    border: 1px solid;
}

/* Trend badge colors with better contrast */
.trend-badge.increasing {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #10b981;
}

.trend-badge.stable {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-color: #3b82f6;
}

.trend-badge.volatile {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #ef4444;
}

/* Volatility badge colors */
.volatility-badge.moderate {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #10b981;
}

.volatility-badge.high {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #f59e0b;
}

.volatility-badge.very-high {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #9a3412;
    border-color: #ea580c;
}

.volatility-badge.extreme {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #ef4444;
}

/* Price summary section */
.price-summary {
    margin-top: var(--space-32);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.price-summary h4 {
    margin-bottom: var(--space-16);
    color: var(--color-btn-primary-text);
    text-align: center;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
}

/* Enhanced price summary table */
.price-summary table {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.price-summary thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, rgba(33, 128, 141, 0.8) 100%);
    color: white;
}

.price-summary th {
    padding: var(--space-16) var(--space-12);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--font-size-sm);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.price-summary td {
    padding: var(--space-12);
    border-bottom: 1px solid #f1f5f9;
    font-size: var(--font-size-sm);
    color: #374151;
    background: #ffffff;
}

.price-summary tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.price-summary tbody tr:hover td {
    background: linear-gradient(90deg, rgba(33, 128, 141, 0.05) 0%, transparent 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Price range indicators in table */
.price-range {
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    background: rgba(33, 128, 141, 0.1);
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-sm);
}

/* Responsive design for price tab */
@media (max-width: 768px) {
    #tab-price {
        padding: var(--space-16);
        margin: var(--space-4);
    }
    
    .price-details-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
    }
    
    .price-chart-container {
        height: 300px;
        padding: var(--space-12);
    }
    
    .price-controls {
        padding: var(--space-12);
    }
    
    .price-metrics {
        grid-template-columns: 1fr;
    }
}

/* Custom scrollbar for price details grid */
.price-details-grid::-webkit-scrollbar {
    width: 8px;
}

.price-details-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: var(--radius-full);
}

.price-details-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary), rgba(33, 128, 141, 0.7));
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.price-details-grid::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(33, 128, 141, 0.3);
}

/* Loading state for price tab */
.price-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--radius-base);
    color: #6b7280;
    font-style: italic;
}

/* Animation for price cards */
.price-card {
    animation: priceCardFadeIn 0.5s ease-out;
}

@keyframes priceCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Professional styling for Comprehensive Price Summary table */
.price-summary {
    margin-top: var(--space-24);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 0;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.price-summary h4 {
    margin: 0;
    color: var(--color-text);
    text-align: left;
    padding: var(--space-20);
    background: linear-gradient(135deg, var(--color-surface) 0%, #f8fafc 100%);
    border-bottom: 2px solid var(--color-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
}

/* Professional price summary table */
.price-summary .dependency-table {
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.price-summary .dependency-table table {
    background: var(--color-surface);
    border-radius: 0;
    margin: 0;
    border: none;
    width: 100%;
    border-collapse: collapse;
}

.price-summary .dependency-table thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.price-summary .dependency-table th {
    padding: var(--space-16) var(--space-12);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-sm);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
}

.price-summary .dependency-table th:last-child {
    border-right: none;
}

.price-summary .dependency-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all var(--duration-fast) var(--ease-standard);
}

.price-summary .dependency-table tbody tr:hover {
    background: #f8fafc;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(33, 128, 141, 0.1);
}

.price-summary .dependency-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.price-summary .dependency-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

.price-summary .dependency-table td {
    padding: var(--space-14) var(--space-12);
    border: none;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

/* Professional price range styling */
.price-summary .price-range {
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-semibold);
    color: #2c3e50;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Professional trend and volatility badges */
.price-summary .trend-badge,
.price-summary .volatility-badge {
    display: inline-block;
    padding: var(--space-4) var(--space-10);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #4b5563;
}
/* Professional styling for Complete Historical Price Analysis table - matching Comprehensive Price Summary */
.yearwise-price-section {
    margin-top: var(--space-24);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.yearwise-price-header {
    text-align: center;
    margin-bottom: var(--space-16);
    color: white;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
}

.yearwise-price-header h4 {
    color: var(--color-btn-primary-text) !important;
    margin-bottom: var(--space-8);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

.yearwise-price-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.5;
}

/* Professional year-wise table styling - exactly matching price summary */
.yearwise-price-section .dependency-table {
    margin: 0;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
}

.yearwise-price-section .dependency-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: var(--font-size-sm);
    background: transparent;
    table-layout: auto; /* Let the browser handle column widths */
}

.yearwise-price-section .dependency-table thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: var(--color-btn-primary-text);
}

.yearwise-price-section .dependency-table th {
    padding: var(--space-12) var(--space-8);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    letter-spacing: 0.2px;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.yearwise-price-section .dependency-table th:last-child {
    border-right: none;
}

.yearwise-price-section .commodity-header {
    text-align: left !important;
    width: 20%; /* Use percentage for flexible width */
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%) !important;
}

.yearwise-price-section .year-header {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%) !important;
}

.yearwise-price-section .price-type-header {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1) !important;
}

.yearwise-price-section .trend-header {
    width: 16%; /* Use percentage for flexible width */
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%) !important;
}

.yearwise-price-section .dependency-table tbody tr {
    transition: all var(--duration-fast) var(--ease-standard);
    border-bottom: 1px solid var(--color-border);
}

.yearwise-price-section .dependency-table tbody tr:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.yearwise-price-section .dependency-table tbody tr:nth-child(even) {
    background-color: rgba(var(--color-primary-rgb, 33, 128, 141), 0.02);
}

.yearwise-price-section .dependency-table tbody tr:nth-child(even):hover {
    background: var(--color-secondary);
}

.yearwise-price-section .commodity-name-cell {
    padding: var(--space-12);
    font-weight: var(--font-weight-semibold);
    text-align: left;
    color: var(--color-text);
    border: none;
    vertical-align: middle;
}

.yearwise-price-section .commodity-name-cell strong {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.yearwise-price-section .price-cell {
    padding: var(--space-4);
    text-align: center;
    font-family: var(--font-family-mono);
    font-size: 11px;
    color: var(--color-text);
    border: none;
    vertical-align: middle;
    width: 12%; /* Use percentage for flexible width */
}

.yearwise-price-section .min-price {
    background: none;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.yearwise-price-section .max-price {
    background: none;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.yearwise-price-section .price-variation {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
    margin-top: var(--space-1);
}

.yearwise-price-section .trend-cell {
    padding: var(--space-8);
    text-align: center;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    border: none;
    vertical-align: middle;
}

.yearwise-price-section .trend-indicator {
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-4);
    display: inline-block;
    background: var(--color-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.yearwise-price-section .trend-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-medium);
    display: block;
}

/* Professional insights section - matching price summary style */
.price-insights {
    margin-top: 0;
    background: var(--color-surface);
    border-radius: 0;
    padding: var(--space-20);
    border: none;
    border-top: 1px solid var(--color-border);
}

.price-insights h5 {
    color: var(--color-btn-primary-text) !important;
    margin-bottom: var(--space-16);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    border-radius: var(--radius-base);
    padding: var(--space-12);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-12);
}

.insight-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-12);
    background: var(--color-secondary);
    border-radius: var(--radius-base);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    transition: all var(--duration-fast) var(--ease-standard);
}

.insight-card:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.insight-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    text-transform: none;
    letter-spacing: normal;
}

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

/* Remove all trend badge colors - keep them neutral like price summary */
.yearwise-price-section .trend-indicator.trend-increasing,
.yearwise-price-section .trend-indicator.trend-decreasing,
.yearwise-price-section .trend-indicator.trend-stable {
    background: var(--color-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* Professional hover states - matching price summary */
.yearwise-price-section .dependency-table tbody tr:hover {
    cursor: default;
}

.yearwise-price-section .dependency-table tbody tr:active {
    transform: none;
    box-shadow: none;
}

/* Clean, professional borders - matching price summary */
.yearwise-price-section .dependency-table tbody tr {
    border-left: none;
}

.yearwise-price-section .commodity-name-cell strong {
    color: var(--color-text);
}

/* Professional table striping - matching price summary */
.yearwise-price-section tbody tr:nth-child(odd) {
    background: var(--color-surface);
}

.yearwise-price-section tbody tr:nth-child(even) {
    background: rgba(var(--color-primary-rgb, 33, 128, 141), 0.02);
}

/* Responsive design for professional tables */
@media (max-width: 1200px) {
    .yearwise-price-section .dependency-table {
        font-size: 11px; /* Slightly smaller font for medium screens */
    }
    .yearwise-price-section .dependency-table th,
    .yearwise-price-section .dependency-table td {
        padding: var(--space-8) var(--space-4);
    }
    .yearwise-price-section .price-variation {
        display: none; /* Hide variation on smaller screens to save space */
    }
}

@media (max-width: 992px) {
    .yearwise-price-section .dependency-table {
        font-size: 10px; /* Even smaller font for tablets */
    }
    .yearwise-price-section .commodity-header {
        min-width: 90px;
    }
    .yearwise-price-section .trend-header {
        min-width: 90px;
    }
    .yearwise-price-section .dependency-table th,
    .yearwise-price-section .dependency-table td {
        padding: var(--space-6) var(--space-2);
    }
}

@media (max-width: 768px) {
    .yearwise-price-section .dependency-table {
        display: block;
        overflow-x: auto;
    }
    .insights-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    .yearwise-price-section {
        padding: var(--space-12);
    }
    .yearwise-price-header {
        padding: var(--space-10);
    }
}

/* Executive summary styling - matching price summary */
.yearwise-price-section tbody tr:first-child {
    border-top: 3px solid var(--color-primary);
}

/* Professional data presentation - matching price summary */
.yearwise-price-section .dependency-table table {
    border-spacing: 0;
    border-collapse: collapse;
}

/* Enhanced readability - matching price summary */
.yearwise-price-section .dependency-table td {
    line-height: 1.4;
}

/* Clean focus states - matching price summary */
.yearwise-price-section .dependency-table tbody tr:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}
/* New commodity trend indicator */
.yearwise-price-section .trend-indicator.trend-new {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.3);
    font-weight: var(--font-weight-bold);
}

.yearwise-price-section .trend-indicator.trend-new:hover {
    background: rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

/* Tab Navigation Controls */
.tab-navigation {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  gap: 12px;
}

.tab-navigation.visible {
  display: flex;
}

.nav-button {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  justify-content: center;
}

.nav-button:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

.nav-button.prev-btn {
  flex-direction: row;
}

.nav-button.next-btn {
  flex-direction: row;
}

.tab-indicator {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  color: #495057;
  font-weight: 600;
  min-width: 120px;
  text-align: center;
}

.nav-icon {
  font-size: 10px;
}

/* Layout-specific panel tabs visibility */
/* Normal view: Show only first 2 tabs */
.main-content[data-layout="normal"] .panel-tabs .tab-btn {
  display: none;
}

.main-content[data-layout="normal"] .panel-tabs .tab-btn:nth-child(1),
.main-content[data-layout="normal"] .panel-tabs .tab-btn:nth-child(2) {
  display: flex;
}

/* Map focus: Show only first tab */
.main-content[data-layout="map-focus"] .panel-tabs .tab-btn {
  display: none;
}

.main-content[data-layout="map-focus"] .panel-tabs .tab-btn:nth-child(1) {
  display: flex;
}

/* Panel focus: Show all tabs */
.main-content[data-layout="panel-focus"] .panel-tabs .tab-btn {
  display: flex;
}

/* Navigation visibility based on layout */
.main-content[data-layout="normal"] .tab-navigation,
.main-content[data-layout="map-focus"] .tab-navigation {
  display: flex;
}

.main-content[data-layout="panel-focus"] .tab-navigation {
  display: none;
}

.main-content[data-layout="fullscreen"] .tab-navigation {
  display: flex;
}
/* Enhanced styling for new price analysis tables */

/* Complete Historical Price Analysis section */
.complete-price-analysis {
    margin-top: var(--space-24);
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #fb923c;
    box-shadow: 0 4px 16px rgba(251, 146, 60, 0.15);
}


.complete-price-analysis h4 {
    margin-bottom: var(--space-16);
    color: #1f2937 !important;
    text-align: center;
    padding: var(--space-12);
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    border: 2px solid #ea580c !important;
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Price insights section - matching style */
.complete-price-insights {
    margin-top: var(--space-24);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    border: 1px solid #16a34a;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

.complete-price-insights h5 {
    color: white;
    margin-bottom: var(--space-16);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    text-align: center;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border-radius: var(--radius-base);
    padding: var(--space-12);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Enhanced table styling for complete price analysis */
.complete-price-analysis .dependency-table,
.complete-price-insights .dependency-table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.complete-price-analysis .dependency-table thead {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
    color: white;
}

.complete-price-insights .dependency-table thead {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
}

.complete-price-analysis .dependency-table th,
.complete-price-insights .dependency-table th {
    padding: var(--space-16) var(--space-12);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    letter-spacing: 0.5px;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.complete-price-analysis .dependency-table tbody tr,
.complete-price-insights .dependency-table tbody tr {
    transition: all var(--duration-fast) var(--ease-standard);
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.8);
}

.complete-price-analysis .dependency-table tbody tr:hover,
.complete-price-insights .dependency-table tbody tr:hover {
    background: rgba(251, 146, 60, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.complete-price-insights .dependency-table tbody tr:hover {
    background: rgba(34, 197, 94, 0.08);
}

.complete-price-analysis .dependency-table tbody tr:nth-child(even),
.complete-price-insights .dependency-table tbody tr:nth-child(even) {
    background-color: rgba(251, 146, 60, 0.02);
}

.complete-price-insights .dependency-table tbody tr:nth-child(even) {
    background-color: rgba(34, 197, 94, 0.02);
}

.complete-price-analysis .dependency-table tbody tr:nth-child(even):hover,
.complete-price-insights .dependency-table tbody tr:nth-child(even):hover {
    background: rgba(251, 146, 60, 0.08);
}

.complete-price-insights .dependency-table tbody tr:nth-child(even):hover {
    background: rgba(34, 197, 94, 0.08);
}

/* Enhanced cell styling for price data */
.complete-price-analysis .dependency-table td,
.complete-price-insights .dependency-table td {
    padding: var(--space-12);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    border: none;
    vertical-align: middle;
    background: inherit;
}

/* Special styling for price values */
.complete-price-analysis .dependency-table td:not(:first-child),
.complete-price-insights .dependency-table td:not(:first-child) {
    font-family: var(--font-family-mono);
    text-align: right;
    font-weight: var(--font-weight-medium);
}

/* Commodity name styling */
.complete-price-analysis .dependency-table td:first-child,
.complete-price-insights .dependency-table td:first-child {
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

/* Price range indicators */
.price-high {
    color: #dc2626;
    font-weight: var(--font-weight-bold);
}

.price-medium {
    color: #ea580c;
    font-weight: var(--font-weight-medium);
}

.price-low {
    color: #16a34a;
    font-weight: var(--font-weight-medium);
}

/* Responsive design for complete price tables */
@media (max-width: 768px) {
    .complete-price-analysis,
    .complete-price-insights {
        padding: var(--space-16);
        margin: var(--space-8);
    }

    .complete-price-analysis .dependency-table,
    .complete-price-insights .dependency-table {
        font-size: var(--font-size-xs);
    }

    .complete-price-analysis .dependency-table th,
    .complete-price-analysis .dependency-table td,
    .complete-price-insights .dependency-table th,
    .complete-price-insights .dependency-table td {
        padding: var(--space-8) var(--space-6);
    }

    /* Stack table on mobile for better readability */
    .complete-price-analysis .dependency-table thead,
    .complete-price-insights .dependency-table thead {
        display: none;
    }

    .complete-price-analysis .dependency-table tbody tr,
    .complete-price-insights .dependency-table tbody tr {
        display: block;
        margin-bottom: var(--space-16);
        border-radius: var(--radius-base);
        box-shadow: var(--shadow-sm);
        background: rgba(255, 255, 255, 0.9);
    }

    .complete-price-analysis .dependency-table td,
    .complete-price-insights .dependency-table td {
        display: block;
        padding: var(--space-8) var(--space-12);
        border: none;
        border-bottom: 1px solid var(--color-border);
        text-align: left !important;
    }

    .complete-price-analysis .dependency-table td:before,
    .complete-price-insights .dependency-table td:before {
        content: attr(data-label) ": ";
        font-weight: var(--font-weight-semibold);
        color: var(--color-primary);
        display: inline-block;
        width: 100px;
    }
}

/* Loading animation for new tables */
.complete-price-analysis,
.complete-price-insights {
    animation: slideInFromBottom 0.6s var(--ease-standard) forwards;
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced data visualization indicators */
.price-trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.trend-increasing {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.trend-stable {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.trend-decreasing {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Highlight important price data */
.price-extreme {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    font-weight: var(--font-weight-bold);
    color: #92400e;
}

/* Professional insights section */
.price-insights {
    margin-top: 0;
    background: var(--color-surface);
    border-radius: 0;
    padding: var(--space-20);
    border: none;
    border-top: 1px solid var(--color-border);
}

.price-insights h5 {
    color: var(--color-text);
    margin-bottom: var(--space-16);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-align: left;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--space-8);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-16);
}

.insight-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    padding: var(--space-16);
    background: #f8fafc;
    border-radius: var(--radius-base);
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--color-primary);
    transition: all var(--duration-fast) var(--ease-standard);
}

.insight-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #f1f5f9;
}

.insight-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-value {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

/* Enhanced background colors for ALL tabs - better visibility */

/* Main application container */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* All tab content containers */
.tab-content {
    display: none;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    margin: var(--space-8);
    border: 1px solid #e5e7eb;
    min-height: calc(100vh - 200px);
}

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

/* Tab content headers */
.tab-content h3 {
    margin-bottom: var(--space-20);
    color: #1f2937;
    border-bottom: 3px solid var(--color-primary);
    padding-bottom: var(--space-12);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: var(--space-16);
    border-radius: var(--radius-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Overview Tab */
#tab-overview {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Outbound Tab */
#tab-outbound {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Inbound Tab */
#tab-inbound {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

/* Upstream-Downstream Tab */
#tab-upstream-downstream {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

/* Flow Patterns Tab */
#tab-flows {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

/* Seasonality Tab */
#tab-seasonality {
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 100%);
}

/* Price & Trends Tab */
#tab-price {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

/* State Area & Production Tab */
#tab-state {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
}

/* Enhanced section containers across all tabs */
.overview-stats,
.commodity-section,
.flow-analysis,
.seasonality-controls,
.price-controls,
.analysis-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

/* Enhanced table backgrounds */
.dependency-table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Enhanced card backgrounds */
.card,
.stat-item,
.info-item,
.price-item,
.detail-card,
.price-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(5px);
}

/* Text contrast improvements */
.tab-content h3,
.tab-content h4,
.tab-content h5 {
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.tab-content p,
.tab-content li,
.tab-content td {
    color: #374151;
}

/* Enhanced form controls */
.form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.12);
    color: #1f2937;
    backdrop-filter: blur(5px);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
}

/* Enhanced button styling */
.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.9));
    color: white;
    box-shadow: 0 4px 12px rgba(33, 128, 141, 0.3);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(5px);
}

/* Chart containers */
.seasonality-chart-container,
.price-chart-container,
.dependency-chart-container,
.flow-chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

/* Side panel background */
.side-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 1px solid #e5e7eb;
}

.panel-content {
    background: transparent;
}

/* Panel tabs */
.panel-tabs {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Map legend background */
.map-legend {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Improved text readability on light backgrounds */
.stat-label,
.info-label,
.insight-label {
    color: #6b7280;
    font-weight: var(--font-weight-semibold);
}

.stat-value,
.info-value,
.insight-value {
    color: #1f2937;
    font-weight: var(--font-weight-bold);
}

/* Enhanced hover effects */
.dependency-table tbody tr:hover {
    background: rgba(33, 128, 141, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.card:hover,
.stat-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .tab-content {
        padding: var(--space-16);
        margin: var(--space-4);
    }
    
    .overview-stats,
    .commodity-section,
    .analysis-section {
        padding: var(--space-12);
        margin-bottom: var(--space-16);
    }
}

/* Loading states with better visibility */
.loading {
    background: rgba(255, 255, 255, 0.8);
    color: #6b7280;
    border-radius: var(--radius-base);
    backdrop-filter: blur(5px);
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: no-preference) {
    .tab-content {
        animation: fadeInUp 0.4s ease-out;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tab-content {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .tab-content h3,
    .tab-content h4,
    .tab-content h5 {
        color: #000000;
        text-shadow: none;
    }
    
    .tab-content p,
    .tab-content li,
    .tab-content td {
        color: #000000;
    }
}

/* Print styles */
@media print {
    .tab-content {
        background: white;
        border: none;
        box-shadow: none;
    }
}
/* Fix for year-wise price table header text visibility */
.yearwise-price-header h4 {
    color: white !important; /* Force white text */
    margin-bottom: var(--space-8);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Add shadow for better readability */
}

.yearwise-price-header p {
    color: rgba(255, 255, 255, 0.95) !important; /* Force white text with slight transparency */
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Add shadow for better readability */
}

/* Ensure the header container has proper background */
.yearwise-price-header {
    text-align: center;
    margin-bottom: var(--space-16);
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8)) !important;
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-bold);
}
/* Add these sections to your existing enhanced background system */

/* Enhanced section containers across all tabs - ADD the new price sections */
.overview-stats,
.commodity-section,
.flow-analysis,
.seasonality-controls,
.price-controls,
.analysis-section,
.price-summary,
.yearwise-price-section,
.price-insights {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

/* Enhanced table backgrounds - ADD the new price tables */
.dependency-table,
.price-summary .dependency-table,
.yearwise-price-section .dependency-table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Enhanced card backgrounds - ADD the new price cards */
.card,
.stat-item,
.info-item,
.price-item,
.detail-card,
.price-card,
.insight-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(5px);
}

/* Chart containers - ADD the new price chart containers */
.seasonality-chart-container,
.price-chart-container,
.dependency-chart-container,
.flow-chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

/* Text contrast improvements for new sections */
.price-summary h3,
.price-summary h4,
.price-summary h5,
.yearwise-price-section h3,
.yearwise-price-section h4,
.yearwise-price-section h5,
.price-insights h3,
.price-insights h4,
.price-insights h5 {
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.price-summary p,
.price-summary li,
.price-summary td,
.yearwise-price-section p,
.yearwise-price-section li,
.yearwise-price-section td,
.price-insights p,
.price-insights li,
.price-insights td {
    color: #374151;
}

/* Enhanced hover effects for new sections */
.price-summary .card:hover,
.yearwise-price-section .card:hover,
.price-insights .insight-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive adjustments for new sections */
@media (max-width: 768px) {
    .price-summary,
    .yearwise-price-section,
    .price-insights {
        padding: var(--space-12);
        margin-bottom: var(--space-16);
    }
}

/* Loading states for new sections */
.price-summary .loading,
.yearwise-price-section .loading,
.price-insights .loading {
    background: rgba(255, 255, 255, 0.8);
    color: #6b7280;
    border-radius: var(--radius-base);
    backdrop-filter: blur(5px);
}

/* Enhanced accessibility for new sections */
@media (prefers-reduced-motion: no-preference) {
    .price-summary,
    .yearwise-price-section,
    .price-insights {
        animation: fadeInUp 0.4s ease-out;
    }
}

/* High contrast mode support for new sections */
@media (prefers-contrast: high) {
    .price-summary,
    .yearwise-price-section,
    .price-insights {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .price-summary h3,
    .price-summary h4,
    .price-summary h5,
    .yearwise-price-section h3,
    .yearwise-price-section h4,
    .yearwise-price-section h5,
    .price-insights h3,
    .price-insights h4,
    .price-insights h5 {
        color: #000000;
        text-shadow: none;
    }
    
    .price-summary p,
    .price-summary li,
    .price-summary td,
    .yearwise-price-section p,
    .yearwise-price-section li,
    .yearwise-price-section td,
    .price-insights p,
    .price-insights li,
    .price-insights td {
        color: #000000;
    }
}

/* Print styles for new sections */
@media print {
    .price-summary,
    .yearwise-price-section,
    .price-insights {
        background: white;
        border: none;
        box-shadow: none;
    }
}
/* Fix for price insights heading - center aligned and white color */
.price-insights h5 {
    color: var(--color-btn-primary-text) !important;
    margin-bottom: var(--space-16);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-align: center !important;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), rgba(33, 128, 141, 0.8));
    border-radius: var(--radius-base);
    border-bottom: none;
    padding-bottom: var(--space-12);
}
/* Enhanced commodity filter dropdown styling with better icon visibility */
#price-commodity-filter {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.12);
    color: #1f2937;
    padding: var(--space-10) var(--space-12);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    min-width: 220px;
    font-family: var(--font-family-base);
}

#price-commodity-filter:focus {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
    outline: none;
}

#price-commodity-filter:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced option styling for better icon visibility */
#price-commodity-filter option {
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    background: white;
    color: #1f2937;
    font-family: var(--font-family-base);
}

/* Price controls container styling */
.price-controls {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    margin-bottom: var(--space-20);
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.price-controls label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-right: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .price-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-12);
    }
    
    #price-commodity-filter {
        width: 100%;
        min-width: unset;
    }
    
    .price-controls label {
        margin-right: 0;
        margin-bottom: var(--space-4);
    }
}
/* Enhanced background colors for ALL tabs - Add price controls */
.overview-stats,
.commodity-section,
.flow-analysis,
.seasonality-controls,
.price-controls,
.analysis-section,
.price-summary,
.yearwise-price-section,
.price-insights {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

/* Enhanced table backgrounds - Add price tables */
.dependency-table,
.price-summary .dependency-table,
.yearwise-price-section .dependency-table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Enhanced card backgrounds - Add price cards */
.card,
.stat-item,
.info-item,
.price-item,
.detail-card,
.price-card,
.insight-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(5px);
}

/* Enhanced price commodity filter styling */
#price-commodity-filter {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.12);
    color: #1f2937;
    padding: var(--space-10) var(--space-12);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    min-width: 250px;
    font-family: var(--font-family-base);
}

#price-commodity-filter:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
    outline: none;
}

#price-commodity-filter:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced option styling for fruit icons */
#price-commodity-filter option {
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    background: white;
    color: #1f2937;
    font-family: var(--font-family-base);
}

/* Price controls container styling */
.price-controls {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    margin-bottom: var(--space-20);
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.price-controls label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-right: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Chart containers - Add price chart container */
.seasonality-chart-container,
.price-chart-container,
.dependency-chart-container,
.flow-chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

/* Text contrast improvements for price sections */
.price-controls h3,
.price-controls h4,
.price-controls h5,
.price-summary h3,
.price-summary h4,
.price-summary h5,
.yearwise-price-section h3,
.yearwise-price-section h4,
.yearwise-price-section h5,
.price-insights h3,
.price-insights h4,
.price-insights h5 {
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.price-controls p,
.price-controls li,
.price-controls td,
.price-summary p,
.price-summary li,
.price-summary td,
.yearwise-price-section p,
.yearwise-price-section li,
.yearwise-price-section td,
.price-insights p,
.price-insights li,
.price-insights td {
    color: #374151;
}

/* Enhanced form controls for price section */
.price-controls .form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.12);
    color: #1f2937;
    backdrop-filter: blur(5px);
}

.price-controls .form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.1);
}

/* Mobile responsive adjustments for price controls */
@media (max-width: 768px) {
    .price-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-12);
        padding: var(--space-12);
    }
    
    #price-commodity-filter {
        width: 100%;
        min-width: unset;
    }
    
    .price-controls label {
        margin-right: 0;
        margin-bottom: var(--space-4);
    }
    
    .price-summary,
    .yearwise-price-section,
    .price-insights {
        padding: var(--space-12);
        margin-bottom: var(--space-16);
    }
}

/* Enhanced hover effects for price sections */
.price-controls .card:hover,
.price-summary .card:hover,
.yearwise-price-section .card:hover,
.price-insights .insight-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
/* Enhanced price chart styling for better interactivity and professional appearance */
.price-chart-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-24);
}

.price-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(33, 128, 141, 0.6) 50%, var(--color-primary) 100%);
}

/* Fixed and enhanced price range visualization for cards */
.price-range-indicator {
    position: relative;
    width: 100%;
    height: 70px;
    background: linear-gradient(90deg, 
        rgba(76, 175, 80, 0.1) 0%, 
        rgba(255, 193, 7, 0.1) 50%, 
        rgba(244, 67, 54, 0.1) 100%);
    border-radius: var(--radius-base);
    margin: var(--space-12) 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.price-range-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 25px;
    background: linear-gradient(90deg, 
        #4caf50 0%, 
        #ff9800 50%, 
        #f44336 100%);
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-standard);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
    min-width: 10%;
}

.price-range-tooltip {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: var(--space-8) var(--space-12);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-standard);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.price-range-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.price-range-indicator:hover .price-range-tooltip {
    opacity: 1;
}

/* Interactive price cards with enhanced styling */
.price-card {
    position: relative;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-standard);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--space-18);
    margin-bottom: var(--space-16);
}

.price-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

/* Enhanced price metrics grid */
.price-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-14);
    margin-bottom: var(--space-18);
}

.price-metric {
    text-align: center;
    padding: var(--space-12);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-base);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all var(--duration-fast) var(--ease-standard);
}

.price-metric:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.price-metric label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    display: block;
    margin-bottom: var(--space-6);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    font-family: var(--font-family-mono);
}

/* Enhanced trend and volatility badges */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-12);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--duration-fast) var(--ease-standard);
}

.trend-badge.trend-increasing {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.25));
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.trend-badge.trend-stable {
    background: linear-gradient(135deg, rgba(158, 158, 158, 0.15), rgba(158, 158, 158, 0.25));
    color: #616161;
    border: 1px solid rgba(158, 158, 158, 0.4);
}

.trend-badge.trend-volatile {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.25));
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.volatility-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-12);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volatility-badge.volatility-moderate {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.volatility-badge.volatility-high {
    background: rgba(255, 87, 34, 0.1);
    color: #d84315;
    border: 1px solid rgba(255, 87, 34, 0.3);
}

.volatility-badge.volatility-very-high {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.volatility-badge.volatility-extreme {
    background: rgba(156, 39, 176, 0.1);
    color: #7b1fa2;
    border: 1px solid rgba(156, 39, 176, 0.3);
}
/* Price Range Controls */
.price-range-controls {
    margin-top: var(--space-16);
    padding: var(--space-12);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-base);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.price-range-controls .form-label {
    margin-bottom: var(--space-8);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    display: block;
}

.range-button-group {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
    flex-wrap: wrap;
}

.price-range-btn {
    padding: var(--space-8) var(--space-16);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-base);
    transition: all var(--duration-fast) var(--ease-standard);
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.price-range-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.price-range-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(33, 128, 141, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .range-button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-range-btn {
        min-width: auto;
        width: 100%;
    }
}
/* Enhanced Price Range Color Coding */
.price-range-visual {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin: var(--space-8) 0;
}

.price-range-bar {
    flex: 1;
    height: 24px;
    background: linear-gradient(90deg, 
        #27ae60 0%,     /* Low prices - Green */
        #f39c12 50%,    /* Medium prices - Orange */
        #e74c3c 100%    /* High prices - Red */
    );
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-point {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 28px;
    background: white;
    border: 2px solid var(--color-text);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
}

.price-point:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

/* Color-coded price categories */
.price-category-low {
    color: #27ae60;
    font-weight: var(--font-weight-semibold);
}

.price-category-medium {
    color: #f39c12;
    font-weight: var(--font-weight-semibold);
}

.price-category-high {
    color: #e74c3c;
    font-weight: var(--font-weight-semibold);
}

/* Price trend arrows with colors */
.price-trend-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
}

.trend-up {
    color: #e74c3c;
}

.trend-down {
    color: #27ae60;
}

.trend-stable {
    color: #95a5a6;
}
/* Screen Toggle Controls */
.screen-controls {
    position: fixed;
    bottom: var(--space-20);
    right: var(--space-20);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    z-index: 9999; /* Set a very high z-index to ensure it's always on top */
}

.screen-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.screen-control-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.screen-control-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 128, 141, 0.3);
}

.control-icon {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
}

.control-text {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Layout Modes */
.main-content {
    flex: 1;
    display: flex;
    height: calc(100vh - 120px);
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Normal Mode (Default) */
.main-content[data-layout="normal"] .map-container {
    flex: 2;
}

.main-content[data-layout="normal"] .side-panel {
    flex: 1;
    min-width: 400px;
}

/* Map Focus Mode */
.main-content[data-layout="map-focus"] .map-container {
    flex: 3;
}

.main-content[data-layout="map-focus"] .side-panel {
    flex: 1;
    min-width: 300px;
}

/* Panel Focus Mode */
.main-content[data-layout="panel-focus"] .map-container {
    flex: 1;
}

.main-content[data-layout="panel-focus"] .side-panel {
    flex: 2;
    min-width: 600px;
}

/* Fullscreen Mode */
.main-content[data-layout="fullscreen"] .map-container {
    flex: 1;
    width: 100vw;
}

.main-content[data-layout="fullscreen"] .side-panel {
    display: none;
}

/* Panel Fullscreen Mode */
.main-content[data-layout="panel-fullscreen"] .map-container {
    flex: 0 0 0px !important; /* Collapse the map instead of hiding it */
    width: 0 !important;
    min-width: 0 !important;
    padding: 0;
    border: none;
}

.main-content[data-layout="panel-fullscreen"] .side-panel {
    flex: 1;
    width: 100vw;
    min-width: 100vw;
    height: 100vh;
    max-height: 100vh;
}

.app-container.panel-fullscreen .app-header {
    display: none;
}

.app-container.panel-fullscreen .main-content {
    height: 100vh;
}

#exit-panel-fullscreen-btn {
    display: none; /* Hidden by default */
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.main-content[data-layout="panel-fullscreen"] #exit-panel-fullscreen-btn {
    display: flex; /* Visible only in panel-fullscreen */
}

/* Optimized Side Panel Layout */
.side-panel {
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Compact Panel Tabs */
.panel-tabs {
    display: flex;
    background-color: var(--color-secondary);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    flex-shrink: 0;
}

.tab-btn {
    padding: var(--space-8) var(--space-12);
    border: none;
    background-color: transparent;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    min-width: 80px;
    text-align: center;
}

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

.tab-btn.active {
    background-color: var(--color-surface);
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

/* Optimized Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-12);
}

/* Compact Tab Content */
.tab-content {
    display: none;
}

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

.tab-content h3 {
    margin-bottom: var(--space-12);
    color: var(--color-text);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--space-6);
    font-size: var(--font-size-lg);
}

.tab-content h4 {
    margin: var(--space-12) 0 var(--space-8) 0;
    color: var(--color-text);
    font-size: var(--font-size-md);
}

.tab-content h5 {
    margin: var(--space-8) 0 var(--space-6) 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

/* Compact Overview Stats */
.overview-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-16);
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-8);
    background-color: var(--color-secondary);
    border-radius: var(--radius-base);
    border: 1px solid var(--color-border);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.stat-value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

/* Compact Tables */
.dependency-table {
    margin-bottom: var(--space-16);
    border-radius: var(--radius-base);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}

.dependency-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: var(--font-size-xs);
}

.dependency-table th {
    padding: var(--space-8) var(--space-6);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
}

.dependency-table td {
    padding: var(--space-6) var(--space-6);
    color: var(--color-text);
    font-size: var(--font-size-xs);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .screen-controls {
        bottom: var(--space-12);
        right: var(--space-12);
    }
    
    .screen-control-btn {
        width: 50px;
        height: 50px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .main-content[data-layout="normal"] .map-container,
    .main-content[data-layout="map-focus"] .map-container,
    .main-content[data-layout="panel-focus"] .map-container {
        height: 40vh;
    }
    
    .main-content[data-layout="normal"] .side-panel,
    .main-content[data-layout="map-focus"] .side-panel,
    .main-content[data-layout="panel-focus"] .side-panel {
        height: 60vh;
        min-width: auto;
    }
    
    .panel-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 60px;
    }
}

/* Animation for layout transitions */
@keyframes layoutTransition {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.main-content[data-layout] {
    animation: layoutTransition 0.3s ease-out;
}
/* Enhanced Side Panel with Dynamic Tab Modes */
.side-panel {
    flex: 1;
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Dynamic Tabs Container */
.panel-tabs-container {
    background-color: var(--color-secondary);
    border-bottom: 1px solid var(--color-border);
}

.panel-tabs {
    display: flex;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Tab Button Styling */
.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-10) var(--space-12);
    border: none;
    background-color: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    min-width: 0;
    flex-shrink: 0;
}

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

.tab-btn.active {
    background-color: var(--color-surface);
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

.tab-icon {
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.tab-text {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab Navigation Controls */
.tab-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) var(--space-12);
    background: var(--color-secondary);
    border-top: 1px solid var(--color-border);
}

.nav-btn {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-8);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    font-weight: var(--font-weight-medium);
}

.nav-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

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

.tab-counter {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

/* Mode-specific Tab Display */
/* Map Focus Mode - 1 tab visible */
.side-panel[data-tab-mode="map-focus"] .panel-tabs {
    justify-content: center;
}

.side-panel[data-tab-mode="map-focus"] .tab-btn {
    flex: 1;
    max-width: 200px;
}

.side-panel[data-tab-mode="map-focus"] .tab-btn:not(.visible-tab) {
    display: none;
}

/* Normal Mode - 2 tabs visible */
.side-panel[data-tab-mode="normal"] .tab-btn:not(.visible-tab) {
    display: none;
}

.side-panel[data-tab-mode="normal"] .tab-btn.visible-tab {
    flex: 1;
}

/* Panel Focus Mode - All tabs visible */
.side-panel[data-tab-mode="panel-focus"] .tab-btn {
    flex: 1;
    min-width: 80px;
}

.side-panel[data-tab-mode="panel-focus"] .panel-tabs {
    flex-wrap: wrap;
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-16);
    background: var(--color-background);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--duration-normal) var(--ease-standard);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tab-btn {
        padding: var(--space-6) var(--space-8);
        font-size: var(--font-size-xs);
    }
    
    .tab-text {
        display: none;
    }
    
    .tab-icon {
        font-size: var(--font-size-base);
    }
}
/* Enhanced Side Panel with Dynamic Tab Modes */
.side-panel {
    flex: 1;
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Dynamic Tabs Container */
.panel-tabs-container {
    background-color: var(--color-secondary);
    border-bottom: 1px solid var(--color-border);
}

.panel-tabs {
    display: flex;
    overflow-x: auto; /* Allow horizontal scrolling for tabs */
    transition: all var(--duration-normal) var(--ease-standard);
}

/* Tab Button Styling */
.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-10) var(--space-12);
    border: none;
    background-color: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    min-width: 0;
    flex-shrink: 0;
}

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

.tab-btn.active {
    background-color: var(--color-surface);
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

/* START: Simple Tab Navigation Controls */
.tab-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) var(--space-12);
    background: var(--color-secondary);
    border-top: 1px solid var(--color-border);
}

.nav-btn {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-8);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    font-weight: var(--font-weight-medium);
}

.nav-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-secondary-hover);
    color: var(--color-text-secondary);
}

.tab-counter {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}
/* END: Simple Tab Navigation Controls */

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-16);
    background: var(--color-background);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--duration-normal) var(--ease-standard);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tab-btn {
        padding: var(--space-6) var(--space-8);
        font-size: var(--font-size-xs);
    }
}
/* ================================
   Professional Theme Refinements
   ================================ */

/* 1) Category buttons: toned-down, enterprise look */
.category-toggle-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.category-btn {
  --btn-radius: 10px;
  --pad-y: 8px;
  --pad-x: 14px;

  display: inline-flex;
  align-items: center;
  padding: var(--pad-y) var(--pad-x);
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,245,245,0.8));
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: all 180ms var(--ease-standard);
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.category-btn:hover {
  border-color: var(--color-primary);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.category-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.category-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-hover));
  box-shadow: 0 2px 10px rgba(var(--color-success-rgb, 33,128,141), 0.22);
}

/* Respect your labels: Major fruits / Others / All Commodities */
.category-btn[data-category="major"].active { background: linear-gradient(180deg, #c47410, #9a5f0f); }
.category-btn[data-category="others"].active { background: linear-gradient(180deg, #5b54cf, #4b45b2); }
.category-btn[data-category="combined"].active { background: linear-gradient(180deg, #21808d, #1b6a74); }

/* 2) Commodity buttons: clean pills */
#commodity-button-row,
#commodity-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#commodity-button-row .filter-btn,
#commodity-buttons-container .filter-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 12px;
  color: var(--color-text);
  transition: all 160ms var(--ease-standard);
}

#commodity-button-row .filter-btn:hover,
#commodity-buttons-container .filter-btn:hover {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

#commodity-button-row .filter-btn.active,
#commodity-buttons-container .filter-btn.active {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border-color: var(--color-primary);
  box-shadow: 0 2px 10px rgba(var(--color-success-rgb, 33,128,141), 0.22);
}

/* 3) Map legend: compact, neutral, legible */
.map-legend {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 220px;
  backdrop-filter: blur(6px);
}

.map-legend h4 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #24323b;
  letter-spacing: 0.2px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #2d3b44;
}

.legend-marker {
  width: 10px;
  height: 10px;
  gap: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: none;
}

.legend-marker.primary-hub { background-color: #c0392b; }
.legend-marker.destination { background-color: #2f80ed; }
.legend-marker.production  { background-color: #27ae60; }
.legend-marker.source { background-color: #27ae60; }

.legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  opacity: 0.85;
}

.legend-line.arrival-flow    { background-color: #1b9e77; }
.legend-line.dispatch-flow   { background-color: #d95f02; }
.legend-line.mango-flow      { background-color: #ff8c00; }
.legend-line.mosambi-flow    { background-color: #32cd32; }

/* 4) Markers: subtle, professional */
.destination-marker-enhanced, .source-marker-enhanced {
  background: #fff;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard);
}

.destination-marker-enhanced:hover, .source-marker-enhanced:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* 5) Flow lines: better contrast, soft glow, refined dash */
.leaflet-overlay-pane svg path.arrival-flow {
  stroke: #1b9e77 !important;
  stroke-opacity: 0.95;
  stroke-width: 2;
  stroke-dasharray: 6 3;
  filter: drop-shadow(0 0 1px rgba(27,158,119,0.35));
}

.leaflet-overlay-pane svg path.dispatch-flow {
  stroke: #d95f02 !important;
  stroke-opacity: 0.95;
  stroke-width: 2;
  stroke-dasharray: 10 5;
  filter: drop-shadow(0 0 1px rgba(217,95,2,0.35));
}

/* Thickness scaling will still come from JS weight; these are base looks */

/* 6) Tooltips: compact, readable, non-intrusive */
.leaflet-tooltip.arrival-tooltip,
.leaflet-tooltip.dispatch-tooltip,
.leaflet-tooltip.upstream-tooltip,
.leaflet-tooltip.downstream-tooltip {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  backdrop-filter: blur(4px);
}

.leaflet-tooltip.arrival-tooltip {
  background: rgba(245, 253, 249, 0.95) !important;
  color: #0f3b2f !important;
  border-color: rgba(27,158,119,0.25) !important;
}

.leaflet-tooltip.dispatch-tooltip {
  background: rgba(255, 248, 242, 0.96) !important;
  color: #5a2e00 !important;
  border-color: rgba(217,95,2,0.25) !important;
}

.leaflet-tooltip.upstream-tooltip {
  background: rgba(244, 249, 255, 0.96) !important;
  color: #19324a !important;
  border-color: rgba(47, 128, 237, 0.22) !important;
}

.leaflet-tooltip.downstream-tooltip {
  background: rgba(255, 246, 238, 0.96) !important;
  color: #442c14 !important;
  border-color: rgba(230, 126, 34, 0.22) !important;
}

/* Ensure tooltips never get huge */
.leaflet-tooltip {
  max-width: 260px !important;
}

/* 7) Side panel and cards: subtle glass card aesthetic */
.card,
.overview-stats,
.commodity-section,
.flow-analysis,
.seasonality-charts,
.price-section,
.trends-section,
.analysis-section {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  backdrop-filter: blur(6px);
}

/* 8) Tabs: cleaner emphasis */
.tab-btn {
  border-bottom: 2px solid transparent;
  background: transparent;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
}

/* 9) Header: reduce “hero” feel, more dashboard */
.app-header {
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.app-header::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.88) 50%, rgba(255,255,255,0.92) 100%);
}

/* 10) Mobile polish */
@media (max-width: 768px) {
  .category-toggle-row { justify-content: center; }
  #commodity-button-row, #commodity-buttons-container { justify-content: center; }
  .map-legend { position: relative; top: auto; right: auto; margin: 8px; }
}
/* Small neutral dot used when no emoji exists */
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -1px;
  background: var(--dot-color, #6b7280);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
/* Mobile-responsive layout polish */
@media (max-width: 768px) {
  /* Stack map above panel */
  .main-content {
    flex-direction: column;
    height: auto;
  }

  /* Map takes 55–65% height; adjust as preferred */
  .map-container {
    height: 55vh !important;
    min-height: 320px;
  }

  /* Panel takes remaining height */
  .side-panel {
    height: auto;
    max-height: 45vh;
    overflow-y: auto;
  }

  /* Keep legend readable and uncluttered */
  .map-legend {
    position: static;
    margin: 8px;
    min-width: auto;
    width: auto;
    padding: 10px;
  }

  /* Tabs: compact, scrollable row */
  .panel-tabs {
    gap: 6px;
    padding: 6px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Commodity/category buttons wrap nicely */
  .category-toggle-row,
  #commodity-button-row,
  #commodity-buttons-container {
    justify-content: center;
  }

  /* Buttons scale for thumb use */
  .category-btn,
  #commodity-button-row .filter-btn,
  #commodity-buttons-container .filter-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Tooltips: narrower on small screens */
  .leaflet-tooltip {
    max-width: 220px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  /* Reduce heavy shadows to improve performance */
  .card, .dependency-table, .map-legend {
    box-shadow: var(--shadow-sm);
  }
}

/* Prevent body from causing double scroll on iOS */
html, body {
  height: 100%;
  overflow: hidden;
}

.app-container {
  height: 100%;
  overflow: hidden;
}

.main-content {
  height: calc(100% - 120px); /* header height approx */
  overflow: hidden;
}

/* Allow inner areas to scroll */
.side-panel .panel-content {
  overflow-y: auto;
}

/* Map occupies its container fully */
#map {
  width: 100%;
  height: 100%;
}

/* Improve Leaflet control tap size on mobile */
.leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 16px;
}
/* Compact Leaflet popups on mobile */
@media (max-width: 768px) {
  .leaflet-popup-content-wrapper, .leaflet-popup-tip {
    max-width: 260px;
  }
  .leaflet-popup-content {
    margin: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
  }
}

/* General compact popup style already used by your markers */
.compact-popup-content {
  padding: 10px;
  min-width: 220px;
}
/* Better tap size for custom markers */
.destination-marker-enhanced, .source-marker-enhanced {
  width: 28px;
  height: 28px;
}
/* Reduce animation load on mobile */
@media (max-width: 768px) {
  .arrival-flow, .dispatch-flow {
    animation-duration: 3.2s !important;
    stroke-opacity: 0.9;
  }
}
/* Horizontal scroll for crowded button bars */
@media (max-width: 768px) {
  #commodity-button-row, #commodity-buttons-container {
    overflow-x: auto;
    white-space: nowrap;
    gap: 4px;
    padding-bottom: 4px;
  }
  #commodity-button-row .filter-btn,
  #commodity-buttons-container .filter-btn {
    display: inline-flex;
  }
}
/* MOBILE RESPONSIVE FIXES (safe overrides) */
html, body, .app-container {
  height: 100%;
}

.main-content {
  height: calc(100% - 120px); /* adjust if header height differs */
  overflow: hidden;
  display: flex;
}

/* Stack map and panel on mobile */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .map-container {
    height: 52vh !important;   /* map first */
    min-height: 320px;
    position: relative;
  }

  .side-panel {
    height: 48vh !important;   /* panel below */
    max-height: 48vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Legend should not overlap map controls on mobile */
  .map-legend {
    position: static;
    margin: 8px;
    width: auto;
    min-width: 0;
  }

  /* Tabs compact */
  .panel-tabs {
    gap: 6px;
    padding: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* Filters: center and scroll horizontally if crowded */
  .category-toggle-row,
  #commodity-button-row,
  #commodity-buttons-container {
    justify-content: center;
  }
  #commodity-button-row,
  #commodity-buttons-container {
    overflow-x: auto;
    white-space: nowrap;
    gap: 6px;
    padding-bottom: 4px;
  }
  #commodity-button-row .filter-btn,
  #commodity-buttons-container .filter-btn {
    display: inline-flex;
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Leaflet UI touch targets */
  .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 16px;
  }

  /* Popups/Tooltips smaller on phones */
  .leaflet-tooltip {
    max-width: 220px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip {
    max-width: 260px;
  }
  .leaflet-popup-content {
    margin: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
  }
}

/* Ensure map canvas fully fills its container */
#map {
  width: 100%;
  height: 100%;
}

/* Make custom markers easier to tap */
.destination-marker-enhanced, .source-marker-enhanced {
  width: 28px;
  height: 28px;
}

/* Reduce line animation load on mobile for smoother performance */
@media (max-width: 768px) {
  .arrival-flow, .dispatch-flow {
    animation-duration: 3.2s !important;
    stroke-opacity: 0.9;
  }
}
/* Let the inner panel area scroll, not the whole page */
.side-panel .panel-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* ================= Legend Professional Styling ================= */

.map-legend {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: var(--space-16);
  min-width: 240px;
  backdrop-filter: blur(6px);
}

.map-legend h4 {
  margin: 0 0 var(--space-10);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.legend-section {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px dashed var(--color-border);
}
.legend-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legend-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.legend-row {
  display: flex;
  gap: var(--space-12);
  margin-bottom: var(--space-6);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 12px;
  color: var(--color-text);
}

.legend-line {
  width: 24px;
  height: 3px;
  border-radius: 2px;
}
.legend-line.arrival-flow {
  background-color: #1b9e77; /* same as arrival flow color */
}
.legend-line.dispatch-flow {
  background-color: #d95f02; /* same as dispatch flow color */
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.legend-marker {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.legend-marker.primary-hub { background-color: #c0392b; }
.legend-marker.production { background-color: #27ae60; }
.legend-marker.destination { background-color: #3498db; }

.legend-note {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: var(--space-6);
  font-style: italic;
}

/* Mobile layout tweak */
@media (max-width: 768px) {
  .map-legend {
    position: static !important;
    width: auto;
    min-width: 0;
    margin: 8px;
    padding: var(--space-12);
  }
  .legend-row { flex-wrap: wrap; gap: var(--space-8); }
}
/* ===== Compact Floating Legend ===== */
.map-legend.compact {
  position: absolute;
  bottom: 145px;
  right: 35px;
  z-index: 1100;
  width: 230px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  font-size: 12px;
}

.map-legend h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.legend-body {
  padding: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.legend-section {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(0,0,0,0.15);
}
.legend-section:last-child {
  border-bottom: none;
}

.legend-subtitle {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  color: rgba(0,0,0,0.6);
  text-transform: uppercase;
}

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

.legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
}
.legend-line.arrival-flow { background: #1b9e77; }
.legend-line.dispatch-flow { background: #d95f02; }

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

.legend-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
}
.legend-marker.primary-hub { background:#c0392b; }
.legend-marker.production { background:#27ae60; }
.legend-marker.destination { background:#2f80ed; }
.legend-marker.source { background-color: #27ae60; }

.legend-note {
  font-size: 10.5px;
  color: rgba(0,0,0,0.6);
  font-style: italic;
  margin-top: 4px;
}

/* Toggle Button */
.legend-toggle {
  appearance: none;
  border: none;
  background: rgba(255,255,255,0.92);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  position: absolute;
  top: 6px;
  right: 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.legend-toggle:hover {
  background: #fff;
}

/* Collapsed State */
.map-legend.is-collapsed .legend-body {
  display: none;
}
.map-legend.is-collapsed {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Mobile Defaults: start collapsed */
@media (max-width: 768px) {
  .map-legend.compact {
    bottom: 12px;
    right: 12px;
    width: auto;
  }
  .map-legend.compact .legend-body {
    max-height: 50vh;
  }
}
/* No CSS needed for hide/show, but optional transition */
#map-legend {
  transition: opacity 0.2s ease;
}
#map-legend[style*="display: none"] {
  opacity: 0;
}
#show-legend-btn {
  position: absolute;
  bottom: 16px;
  left: 16px;  /* 👈 Changed from right: 16px */
  z-index: 1200;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.2s ease;
}
.leaflet-tooltip.marker-tooltip {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  background: rgba(255,255,255,0.95) !important;
  color: #1f2937 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  max-width: 220px !important;
  pointer-events: none;
}
.marker-tooltip .tt-title { font-weight: 700; margin-bottom: 4px; font-size: 11.5px; }
.marker-tooltip .tt-row { display: flex; justify-content: space-between; gap: 8px; }
.marker-tooltip .tt-label { color: #6b7280; }
.marker-tooltip .tt-val { color: #111827; font-weight: 600; }
@media (max-width: 768px){
  .leaflet-tooltip.marker-tooltip { max-width: 180px !important; font-size: 10.5px !important; }
}

.tab-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.nav-button {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

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

.tab-indicator {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}
.flow-filter {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 5px;
    background-color: transparent;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.flow-btn {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.flow-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flow-btn:hover {
    background-color: #f1f3f4;
}

.flow-btn.active:hover {
    background-color: #1867c0;
}

/* Arrival and Dispatch specific styles */
#tab-inbound {
    background-color: #e8f5e9; /* Light green background for Arrival */
}

#tab-outbound {
    background-color: #fff3e0; /* Light orange background for Dispatch */
}

.flow-btn[data-flow="inbound"].active {
    background-color: #4CAF50; /* Green for Arrival button */
    color: white;
}

.flow-btn[data-flow="outbound"].active {
    background-color: #FF9800; /* Orange for Dispatch button */
    color: white;
}

/* ================================
   Comprehensive Mobile/Android UI Enhancements
   ================================ */

/* Prevent body from causing double scroll on iOS/Android */
html, body {
  height: 100%;
  overflow: hidden;
}

.app-container {
  height: 100%;
  overflow: hidden;
}

.main-content {
  height: calc(100% - 120px); /* Adjust if header height differs */
  overflow: hidden;
}

/* Allow inner panel area to scroll */
.side-panel .panel-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

@media (max-width: 768px) {
  /* Stack map and panel vertically */
  .main-content {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .map-container {
    height: 50vh !important;
    min-height: 300px;
    position: relative;
  }

  .side-panel {
    height: 50vh !important;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Make legend more compact and static on mobile */
  .map-legend {
    position: static;
    margin: 8px;
    width: auto;
    min-width: 0;
    padding: 10px;
  }

  /* Make tabs compact and scrollable */
  .panel-tabs {
    gap: 6px;
    padding: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* Center and allow horizontal scroll for crowded filter buttons */
  .category-toggle-row,
  #commodity-button-row,
  #commodity-buttons-container {
    justify-content: flex-start; /* Align to start for scrolling */
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  #commodity-button-row .filter-btn,
  #commodity-buttons-container .filter-btn {
    display: inline-flex;
  }

  /* Make Leaflet UI more touch-friendly */
  .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 16px;
  }

  /* Make popups and tooltips smaller on phones */
  .leaflet-tooltip {
    max-width: 200px !important;
    font-size: 11px !important;
  }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip {
    max-width: 240px;
  }
  .leaflet-popup-content {
    margin: 8px 10px;
    font-size: 12px;
  }

  /* Make custom markers easier to tap */
  .destination-marker-enhanced, .source-marker-enhanced {
    width: 30px;
    height: 30px;
  }

  /* Reduce animation load on mobile for smoother performance */
  .arrival-flow, .dispatch-flow {
    animation-duration: 3.5s !important;
    stroke-opacity: 0.9;
  }
}

/* ================================
   Marker Popups & Tooltips
   ================================ */

/* Compact Popup Styling */
.compact-popup .leaflet-popup-content-wrapper {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.compact-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    font-size: var(--font-size-sm);
}

.compact-popup-content .popup-header {
    background: var(--color-primary);
    color: var(--color-btn-primary-text);
    padding: var(--space-12) var(--space-16);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.compact-popup-content .popup-body {
    padding: var(--space-16);
}

.compact-popup-content .popup-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--color-border);
}

.compact-popup-content .popup-row:last-child {
    border-bottom: none;
}

.compact-popup-content .popup-label {
    color: var(--color-text-secondary);
}

.compact-popup-content .popup-value {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

/* Marker Tooltip Styling */
.marker-tooltip {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-md);
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.marker-tooltip .tt-title {
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    color: var(--color-primary);
}

.marker-tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-16);
}

.marker-tooltip .tt-label {
    color: var(--color-text-secondary);
}

.marker-tooltip .tt-val {
    font-weight: var(--font-weight-medium);
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    height: auto;
  }

  .map-container {
    height: 50vh;
  }

  .side-panel {
    height: 50vh;
    min-width: unset;
  }
}
.excel-upload-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.excel-upload-container label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

#excel-file {
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    padding: 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}
/* Header Layout */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Align items vertically */
  padding: 8px 24px 8px 0; /* Remove left padding */
  gap: 16px;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative; /* Add position relative */
    z-index: 2; /* Ensure this is also above the overlay */
    padding-left: 24px; /* Add padding to the left */
}

.header-right {
    display: flex;
    align-items: center;
}

.header-title {
  flex: 1 1 auto;
  text-align: left;
}

.header-title h1 {
  font-size: 24px;
  margin: 0 0 4px 0;
}

.header-title p {
  font-size: 14px;
  margin: 0;
  color: var(--color-text-secondary);
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  position: relative; /* Add position relative */
  z-index: 2; /* Ensure controls are above the overlay */
}

.commodity-filter, .flow-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.flow-btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#commodity-button-row .filter-btn {
    padding: 4px 8px;
    font-size: 11px;
}

.excel-upload-container label {
    font-size: 12px;
}

#excel-file {
    font-size: 12px;
}

.main-content {
  display: flex;
  flex: 1; /* Use flex shorthand to allow grow and shrink */
  overflow: hidden; /* Prevent overflow issues */
}

.map-container {
  width: 70%;
  position: relative;
}

.resizer {
  width: 8px;
  cursor: ew-resize;
  background-color: #e5e7eb;
  transition: background-color 0.2s ease;
}

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


.side-panel {
  width: 30%;
}

/* Batasingaram/Gaddiannaram Market Popup Styles */
.gaddiannaram-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gaddiannaram-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.market-popup h3 {
  margin-top: 0;
  font-size: 1.2em;
}

.market-images {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.market-images img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.market-details p {
  margin: 5px 0;
}


/* This style is no longer needed as it's handled by the gaddiannaram-popup styles below */

/* Gaddiannaram Market Popup and Marker Styles */
.gaddiannaram-popup .leaflet-popup-content-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.gaddiannaram-popup .leaflet-popup-content {
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
}

.gaddiannaram-popup-content .popup-header {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  padding: var(--space-12) var(--space-16);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.gaddiannaram-popup-content .popup-body {
  padding: var(--space-16);
}

.gaddiannaram-popup-content .popup-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-12);
}

.gaddiannaram-popup-content .popup-stats p {
  margin: 0 0 var(--space-6) 0;
}

.gaddiannaram-popup-content .popup-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.gaddiannaram-popup-content .popup-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-base);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.gaddiannaram-popup-content .popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease-in-out;
}

.gaddiannaram-popup-content .popup-image img:hover {
    transform: scale(1.05);
}

.gaddiannaram-marker .hub-icon {
  font-size: 28px;
  line-height: 1;
}
/* =================================== */
/* Professional Seasonality Tab Styles */
/* =================================== */

#tab-seasonality {
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 100%);
}

.seasonality-controls {
    margin-bottom: var(--space-24);
    background: rgba(255, 255, 255, 0.8);
    padding: var(--space-16);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.seasonality-chart-section {
    margin-bottom: var(--space-32);
}

.seasonality-chart-section h4 {
    margin-bottom: var(--space-16);
    text-align: center;
    color: var(--color-text);
    padding: var(--space-12);
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-base);
    border-bottom: 2px solid var(--color-primary);
}

.seasonality-chart-container {
    height: 400px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    margin-bottom: var(--space-24);
}

.detail-card {
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-base);
    padding: var(--space-16);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.detail-card h5 {
    margin-bottom: var(--space-12);
    color: var(--color-primary);
    font-size: var(--font-size-md);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-8);
}

.seasonality-summary h4 {
    margin-bottom: var(--space-16);
    color: var(--color-btn-primary-text);
    text-align: center;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-base);
}

#tbl-seasonality-summary thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

#tbl-seasonality-summary th {
    padding: var(--space-16) var(--space-12);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--font-size-sm);
    text-align: left;
}

#tbl-seasonality-summary tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

#tbl-seasonality-summary tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb), 0.1);
}

#tbl-seasonality-summary td {
    padding: var(--space-12);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.pattern-badge {
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.pattern-badge.highly-seasonal {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.pattern-badge.moderately-seasonal {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.3);
}

.pattern-badge.year-round-availability {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
}
/* ============================================ */
/* Professional Price & Trends Tab Styles     */
/* ============================================ */

#tab-price {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.price-controls {
    margin-bottom: var(--space-24);
    background: rgba(255, 255, 255, 0.8);
    padding: var(--space-16);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.price-chart-section {
    margin-bottom: var(--space-32);
}

.price-chart-section h4 {
    margin-bottom: var(--space-16);
    text-align: center;
    color: var(--color-text);
    padding: var(--space-12);
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-base);
    border-bottom: 2px solid var(--color-primary);
}

.price-chart-container {
    height: 400px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.price-details h4,
.price-summary h4 {
    margin-bottom: var(--space-16);
    color: var(--color-btn-primary-text);
    text-align: center;
    padding: var(--space-12);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-base);
}

#price-summary-table-container .dependency-table thead,
#yearwise-price-table-container .dependency-table thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

#price-summary-table-container .dependency-table th,
#yearwise-price-table-container .dependency-table th {
    padding: var(--space-16) var(--space-12);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--font-size-sm);
    text-align: left;
}

#price-summary-table-container .dependency-table tbody tr:nth-child(even),
#yearwise-price-table-container .dependency-table tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

#price-summary-table-container .dependency-table tbody tr:hover,
#yearwise-price-table-container .dependency-table tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb), 0.1);
}

#price-summary-table-container .dependency-table td,
#yearwise-price-table-container .dependency-table td {
    padding: var(--space-12);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.price-range {
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

.trend-badge, .volatility-badge, .category-badge {
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.trend-badge.trend-increasing, .trend-badge.premium_increasing {
    background: rgba(39, 174, 96, 0.1); color: #27ae60; border-color: rgba(39, 174, 96, 0.3);
}
.trend-badge.trend-stable, .trend-badge.premium_stable {
    background: rgba(52, 152, 219, 0.1); color: #3498db; border-color: rgba(52, 152, 219, 0.3);
}
.trend-badge.trend-volatile, .trend-badge.premium_volatile, .trend-badge.seasonal_volatile {
    background: rgba(243, 156, 18, 0.1); color: #f39c12; border-color: rgba(243, 156, 18, 0.3);
}
.trend-badge.trend-declining {
    background: rgba(231, 76, 60, 0.1); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3);
}
.trend-badge.trend-new_entry, .trend-badge.exotic_extreme, .trend-badge.premium_extreme {
     background: rgba(155, 89, 182, 0.1); color: #9b59b6; border-color: rgba(155, 89, 182, 0.3);
}

.volatility-badge.volatility-moderate {
    background: rgba(39, 174, 96, 0.1); color: #27ae60; border-color: rgba(39, 174, 96, 0.3);
}
.volatility-badge.volatility-high {
    background: rgba(243, 156, 18, 0.1); color: #f39c12; border-color: rgba(243, 156, 18, 0.3);
}
.volatility-badge.volatility-very_high {
    background: rgba(230, 126, 34, 0.1); color: #e67e22; border-color: rgba(230, 126, 34, 0.3);
}
.volatility-badge.volatility-extreme {
    background: rgba(231, 76, 60, 0.1); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3);
}

.category-badge.category-major {
    background: rgba(52, 152, 219, 0.1); color: #3498db; border-color: rgba(52, 152, 219, 0.3);
}
.category-badge.category-premium {
    background: rgba(155, 89, 182, 0.1); color: #9b59b6; border-color: rgba(155, 89, 182, 0.3);
}
.category-badge.category-exotic {
    background: rgba(231, 76, 60, 0.1); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3);
}
.category-badge.category-standard {
    background: rgba(46, 204, 113, 0.1); color: #2ecc71; border-color: rgba(46, 204, 113, 0.3);
}
