/* ==========================================================================
   Urban Climate Explorer - Custom Theme & Glassmorphism Styling
   ========================================================================== */

/* 1. Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* 2. Custom CSS Properties & Design Tokens */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Color Palette Tokens */
  --primary-color: #e76f51;
  --primary-dark: #b8381b;
  --primary-hover: #d85c3f;
  --primary-rgb: 231, 111, 81;
  --secondary-color: #f4a261;
  --secondary-hover: #e08e4c;
  --secondary-rgb: 244, 162, 97;
  --accent-color: #e9c46a;

  /* Surfaces & Glassmorphism */
  --bg-gradient: linear-gradient(135deg, #b8381b 0%, #d45d4a 50%, #c84b31 100%);
  --body-bg: #faf6f5;
  --card-glass-bg: rgba(255, 255, 255, 0.85);
  --card-glass-border: rgba(231, 111, 81, 0.12);
  --card-shadow: 0 10px 30px -5px rgba(200, 75, 49, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 20px 40px -10px rgba(231, 111, 81, 0.18), 0 8px 20px rgba(0, 0, 0, 0.06);

  /* Navigation & Controls */
  --navbar-bg: rgba(250, 246, 245, 0.92);
  --navbar-border: rgba(231, 111, 81, 0.12);
  --text-main: #2b2d42;
  --text-muted: #545e68;

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Base Body & Typography */
body {
  font-family: var(--font-sans);
  background-color: var(--body-bg);
  background-attachment: fixed;
  color: var(--text-main);
  padding-top: 80px;
  min-height: 100vh;
  transition: padding-top 0.35s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #1a252c;
  letter-spacing: -0.02em;
}

/* 4. Top Navigation Bar */
.navbar {
  background: var(--navbar-bg) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: var(--transition-normal);
  padding: 0.5rem 1.5rem;
}

.navbar .container-fluid {
  align-items: center;
  min-height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-right: 1.5rem;
}

.app-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-nav .nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: #4a5568 !important;
  padding: 10px 18px !important;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  margin: 0 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-nav .nav-link:hover {
  color: #b8381b !important;
  background: rgba(var(--primary-rgb), 0.08);
}

.navbar-nav .nav-link.active {
  color: #b8381b !important;
  background: rgba(var(--primary-rgb), 0.12);
  box-shadow: inset 0 -2px 0 var(--primary-color);
}

.navbar-nav .nav-link:focus-visible {
  outline: 2px solid #b8381b !important;
  outline-offset: 2px;
}

/* 5. Hero Metrics Banner */
.hero-banner {
  background: var(--bg-gradient);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-top: 0.5rem;
  margin-bottom: 1.75rem;
  color: #ffffff;
  box-shadow: 0 12px 35px rgba(200, 75, 49, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -15%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(233, 196, 106, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  border-radius: 50%;
}

.hero-banner-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 992px) {
  .hero-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hero-title-group {
  max-width: 520px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.4rem;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0;
  line-height: 1.45;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  width: 100%;
}

@media (min-width: 992px) {
  .hero-metrics-grid {
    grid-template-columns: repeat(4, auto);
    gap: 0.85rem;
    width: auto;
  }
}

.metric-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-fast);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  min-width: 145px;
}

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

.metric-icon {
  font-size: 1.15rem;
  color: #e76f51;
  background: rgba(231, 111, 81, 0.12);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
  white-space: normal;
  word-break: normal;
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 700;
  margin-top: 2px;
  white-space: normal;
}

@media (max-width: 767.98px) {
  .hero-banner {
    padding: 1rem 1.25rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
  }
  .hero-banner-content {
    gap: 0.85rem;
  }
  .hero-title {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
  }
  .hero-subtitle {
    font-size: 0.82rem;
  }
  .hero-metrics-grid {
    gap: 0.5rem;
  }
  .metric-card {
    padding: 0.6rem 0.85rem;
    gap: 0.6rem;
  }
  .metric-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
  .metric-value {
    font-size: 0.95rem;
  }
}

/* 6. Cards & Glassmorphism Elevation */
.bslib-card, .glass-card {
  background: var(--card-glass-bg) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-glass-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--card-shadow) !important;
  transition: var(--transition-normal) !important;
  overflow: hidden;
}

.equal-height-card {
  height: 520px !important;
  max-height: 520px !important;
  min-height: 520px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.equal-height-card .card-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: calc(100% - 54px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 1rem !important;
}

.equal-height-card .shiny-spinner-output-container,
.equal-height-card .html-widget,
.equal-height-card .leaflet-container,
.equal-height-card .leaflet,
.equal-height-card .highcharts-container,
.equal-height-card .highcharts-root {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.bslib-card:hover, .glass-card:hover {
  box-shadow: var(--card-shadow-hover) !important;
}

.bslib-card .card-header, .glass-card .card-header {
  background: rgba(250, 246, 245, 0.75) !important;
  border-bottom: 1px solid rgba(231, 111, 81, 0.12) !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
  padding: 0.9rem 1.25rem !important;
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-title i {
  color: var(--primary-color);
}

.bslib-card .card-body, .glass-card .card-body {
  padding: 1.25rem !important;
}

.card-text-lead {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* 7. Badges & Stat Badges */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(231, 111, 81, 0.08);
  color: #b8381b;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  border: 1px solid rgba(231, 111, 81, 0.22);
}

.badge.bg-secondary {
  background-color: rgba(108, 117, 125, 0.12) !important;
  color: #495057 !important;
  border: 1px solid rgba(108, 117, 125, 0.2);
  border-radius: 20px;
  padding: 0.35em 0.75em;
  font-weight: 600;
}

/* 8. Sub-tabs Navigation */
.nav-tabs {
  border-bottom: 2px solid rgba(231, 111, 81, 0.15) !important;
  margin-bottom: 1.25rem !important;
}

.nav-tabs .nav-link {
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  color: #475569 !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -2px !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 0 !important;
}

.nav-tabs .nav-link:hover {
  color: #b8381b !important;
  background: transparent !important;
  border-bottom-color: rgba(231, 111, 81, 0.3) !important;
}

.nav-tabs .nav-link.active {
  color: #b8381b !important;
  background: transparent !important;
  border-bottom: 3px solid var(--primary-color) !important;
}

.nav-tabs .nav-link:focus-visible {
  outline: 2px solid #b8381b !important;
  outline-offset: 2px;
}

/* 9. Sidebar & Form Controls */
.bslib-sidebar-content, .sidebar-content, .sidebar {
  background: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  padding: 1.25rem !important;
}

.sidebar-card .btn {
  width: 100%;
}

.form-control, .form-select, .selectize-input {
  border-radius: var(--radius-sm) !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0.5rem 0.75rem !important;
  font-family: var(--font-sans) !important;
  transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus, .selectize-input.focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.45) !important;
}

#city + .selectize-control .selectize-input {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.selectize-dropdown .selectize-dropdown-content {
  max-height: 65vh !important;
  overflow-y: auto;
}

.selectize-dropdown {
  z-index: 2000 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
  border: 1px solid #e2e8f0 !important;
}

.selectize-dropdown .option {
  padding: 8px 12px;
  transition: var(--transition-fast);
}

.selectize-dropdown .option:hover,
.selectize-dropdown .option.active,
.selectize-dropdown .option.highlight {
  background-color: rgba(var(--primary-rgb), 0.1) !important;
  color: var(--primary-dark) !important;
}

/* Custom Checkbox & Radio Buttons */
.form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.form-check-input:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.45) !important;
}

/* Buttons */
.btn-primary, .shiny-download-link {
  background: #b8381b !important;
  border-color: #b8381b !important;
  color: #ffffff !important;
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition-fast) !important;
}

.btn-primary:hover, .shiny-download-link:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  box-shadow: 0 4px 12px rgba(231, 111, 81, 0.35) !important;
}

.btn-primary:focus-visible, .shiny-download-link:focus-visible {
  outline: 3px solid var(--primary-color) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.45) !important;
}

/* 10. Floating Glass Notifications & Progress Bars */
#shiny-notification-panel {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 320px !important;
  max-width: 90% !important;
  z-index: 10000 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: flex-end !important;
}

.shiny-notification {
  background: rgba(245, 247, 250, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #2b2d42 !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
  padding: 16px 20px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

.shiny-notification-warning {
  border-left: 4px solid #f4a261 !important;
}

.shiny-notification-error {
  border-left: 4px solid #d90429 !important;
}

.shiny-notification-close {
  position: absolute !important;
  right: 12px !important;
  top: 12px !important;
  cursor: pointer;
  color: #475569 !important;
  opacity: 1;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.shiny-notification-close:hover {
  color: #2b2d42 !important;
  opacity: 1;
}

.shiny-notification-close:focus-visible {
  outline: 2px solid #b8381b !important;
  outline-offset: 2px;
}

.progress-bar {
  background-color: #a5371f !important;
  background-image: linear-gradient(90deg, #a5371f, #c84b31) !important;
  color: #ffffff !important;
}

/* Full-screen card expansion & widgets styling */
.bslib-card.bslib-full-screen,
.card.bslib-full-screen,
[data-bslib-card-full-screen] {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

.bslib-card.bslib-full-screen .card-header,
.card.bslib-full-screen .card-header,
[data-bslib-card-full-screen] .card-header {
  flex: 0 0 auto !important;
}

.bslib-card.bslib-full-screen .card-body,
.card.bslib-full-screen .card-body,
[data-bslib-card-full-screen] .card-body {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 12px 16px !important;
}

/* Fix shinycssloaders spinner wrapper height scaling */
.shiny-spinner-output-container,
.bslib-card.bslib-full-screen .shiny-spinner-output-container,
.card.bslib-full-screen .shiny-spinner-output-container,
[data-bslib-card-full-screen] .shiny-spinner-output-container {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.bslib-card.bslib-full-screen .html-widget,
.card.bslib-full-screen .html-widget,
[data-bslib-card-full-screen] .html-widget,
.bslib-card.bslib-full-screen .leaflet-container,
.card.bslib-full-screen .leaflet-container,
[data-bslib-card-full-screen] .leaflet-container,
.bslib-card.bslib-full-screen .highcharts-container,
.card.bslib-full-screen .highcharts-container,
[data-bslib-card-full-screen] .highcharts-container {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
}

/* 11. Intuitive Map Cursors & Click Interactivity */
.leaflet-container,
.leaflet-grab,
.leaflet-drag-target {
  cursor: crosshair !important;
}

.leaflet-container.leaflet-clickable,
.leaflet-container .leaflet-interactive,
.leaflet-image-layer {
  cursor: crosshair !important;
}

.leaflet-dragging .leaflet-container,
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-drag-target {
  cursor: grabbing !important;
}

.equal-height-card .card-body > .shiny-text-output {
  flex: 0 0 auto;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   12. Tooltip & Info Icon Design System
   ========================================================================== */
.info-tooltip-icon {
  cursor: help !important;
  color: var(--primary-color) !important;
  opacity: 0.75;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.info-tooltip-icon:hover,
.info-tooltip-icon:focus {
  opacity: 1;
  transform: scale(1.22);
  color: var(--primary-hover) !important;
}

/* Bootstrap 5 Glassmorphism Dark Theme Tooltip Override */
.tooltip {
  font-family: var(--font-sans);
  z-index: 1090 !important;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip.show {
  opacity: 1 !important;
}

.tooltip .tooltip-inner {
  background: rgba(28, 32, 42, 0.94) !important;
  color: #f8f9fa !important;
  font-size: 0.8125rem !important;
  font-weight: 450 !important;
  line-height: 1.45 !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  max-width: 260px !important;
  text-align: center;
}

/* Tooltip Arrows */
.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: rgba(28, 32, 42, 0.94) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: rgba(28, 32, 42, 0.94) !important;
}

.bs-tooltip-start .tooltip-arrow::before {
  border-start-color: rgba(28, 32, 42, 0.94) !important;
}

.bs-tooltip-end .tooltip-arrow::before {
  border-end-color: rgba(28, 32, 42, 0.94) !important;
}


/* 12. Modern Tooltips & Info Icons Styling */

/* Info icons styling */
.info-tooltip-icon,
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-color);
  opacity: 0.85;
  margin-left: 6px;
  font-size: 0.95em;
  transition: transform var(--transition-fast), opacity var(--transition-fast), color var(--transition-fast);
  vertical-align: middle;
}

.info-tooltip-icon:hover,
.info-icon:hover {
  opacity: 1;
  color: var(--primary-dark);
  transform: scale(1.15);
}

/* Bootstrap 5 Tooltip Custom Styling (Glassmorphism Dark Theme) */
.tooltip,
.bs-tooltip-auto,
.bs-tooltip-top,
.bs-tooltip-bottom,
.bs-tooltip-start,
.bs-tooltip-end {
  opacity: 1 !important;
  font-family: var(--font-sans);
  z-index: 10050;
}

.bs-tooltip-auto .tooltip-inner,
.bs-tooltip-top .tooltip-inner,
.bs-tooltip-bottom .tooltip-inner,
.bs-tooltip-start .tooltip-inner,
.bs-tooltip-end .tooltip-inner,
.tooltip .tooltip-inner {
  background-color: rgba(35, 39, 47, 0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.825rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 260px;
}

/* Tooltip arrows */
.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: rgba(35, 39, 47, 0.95) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: rgba(35, 39, 47, 0.95) !important;
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-left-color: rgba(35, 39, 47, 0.95) !important;
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-right-color: rgba(35, 39, 47, 0.95) !important;
}

/* Custom CSS tooltips fallback using [data-tooltip] attribute */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: rgba(35, 39, 47, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.825rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 10050;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: rgba(35, 39, 47, 0.95) transparent transparent transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10050;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   13. Collapsible Hero Banner & Toggle Button System
   ========================================================================== */
.hero-banner-wrapper {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.35s ease, padding 0.35s ease;
  max-height: 500px;
  overflow: hidden;
}

.btn-hero-toggle {
  position: absolute;
  top: 6px;
  right: 18px;
  z-index: 10;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  box-shadow: none;
}

.btn-hero-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.hero-banner-wrapper.hero-collapsed {
  max-height: 65px !important;
  margin-bottom: 0.5rem !important;
}

.hero-banner-wrapper.hero-collapsed .hero-banner {
  padding: 10px 65px 10px 18px !important;
  min-height: unset !important;
}

.hero-banner-wrapper.hero-collapsed .hero-subtitle,
.hero-banner-wrapper.hero-collapsed .hero-metrics-grid {
  display: none !important;
  opacity: 0;
}

.hero-banner-wrapper.hero-collapsed .hero-title {
  font-size: 1.15rem !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tab-Specific Compact Metric Header Strip (Maps & Graphs) */
.hero-banner-wrapper.hero-compact-mode {
  max-height: 85px !important;
  margin-bottom: 0.5rem !important;
}

.hero-banner-wrapper.hero-compact-mode .hero-banner {
  padding: 8px 65px 8px 18px !important;
  min-height: unset !important;
  border-radius: var(--radius-sm);
}

.hero-banner-wrapper.hero-compact-mode .hero-title-group,
.hero-banner-wrapper.hero-compact-mode .hero-subtitle {
  display: none !important;
}

.hero-banner-wrapper.hero-compact-mode .hero-metrics-grid {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  grid-template-columns: none !important;
  margin-top: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hero-banner-wrapper.hero-compact-mode .hero-metrics-grid::-webkit-scrollbar {
  display: none;
}

/* Minimize Toggle Button in Compact/Collapsed Modes to reduce visual aspect */
.hero-banner-wrapper.hero-compact-mode .btn-hero-toggle span,
.hero-banner-wrapper.hero-collapsed .btn-hero-toggle span {
  display: none !important;
}

.hero-banner-wrapper.hero-compact-mode .btn-hero-toggle,
.hero-banner-wrapper.hero-collapsed .btn-hero-toggle {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  justify-content: center !important;
}

.hero-banner-wrapper.hero-compact-mode .metric-card {
  padding: 4px 12px !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: none !important;
  border-radius: 20px !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  color: #ffffff !important;
}

.hero-banner-wrapper.hero-compact-mode .metric-icon {
  font-size: 0.85rem !important;
  color: #ffffff !important;
  margin-bottom: 0 !important;
  opacity: 0.9;
}

.hero-banner-wrapper.hero-compact-mode .metric-details {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
}

.hero-banner-wrapper.hero-compact-mode .metric-value {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.hero-banner-wrapper.hero-compact-mode .metric-label {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.85) !important;
  white-space: nowrap !important;
}




