:root {
  /* Colors */
  --button-color: rgba(105, 135, 196, 1);
  --button-hover: rgba(67, 82, 112, 1);
  --button-active: rgba(168, 192, 240, 1);
  --highlight: rgba(112, 39, 69, 0.4);
  --chat-user: rgba(53, 59, 70, 1);
  --chat-bot: rgba(229, 232, 237, 1);
  --background-base: rgba(240, 240, 240, 1);
  --title: rgba(18, 46, 111, 1);
  --text-color: rgba(35, 46, 51, 1);
  --chat-user-message: rgba(119, 118, 118, 0.6);
  --chat-bot-message: rgba(241, 241, 241, 0.6);

  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 0 15px rgba(70, 11, 38, 0.2);
  --shadow-inner: 0 0 15px inset rgba(70, 11, 38, 0.2);
  --shadow-inner-dark: 0 0 30px inset rgba(70, 11, 38, 0.4);

  --border-radius-small: 4px;
  --border-radius-medium: 8px;
  --border-radius-circle: 50%;

  --spacing-small: 10px;
  --spacing-medium: 15px;
  --spacing-large: 20px;
}

/* ===============================
   Base Styles
   =============================== */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--background-base);
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}

/* ===============================
   Overlay & Welcome Screen
   =============================== */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("../images/boston-map.png") center/cover no-repeat;
  background-color: rgba(255, 255, 255, 0.4);
  background-blend-mode: lighten;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  z-index: 1001;
  text-align: center;
  max-width: 60%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius-medium);
}

.overlay-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-large);
  flex-wrap: wrap;
}

.overlay-btn {
  padding: 15px 30px;
  font-size: 1.2rem;
  border: none;
  border-radius: var(--border-radius-medium);
  background-color: var(--button-color);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.overlay-btn:hover {
  background-color: var(--button-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.overlay-btn:active {
  background-color: var(--button-active);
  transform: translateY(0);
}

/* ===============================
 Header Style
 =============================== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background-color: rgba(235, 235, 235, 0.5);
  padding: 10px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-header-title {
  font-weight: 900;
}

/* ===============================
   Map Elements
   =============================== */
#background-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#before-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#after-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent !important;
}

#after-map .mapboxgl-viewport,
#after-map canvas.mapboxgl-canvas {
  background: transparent !important;
}

/* ===============================
   Layout & Responsive Containers
   =============================== */
#responsive-container {
  display: flex;
  margin: 90px auto;
  flex-direction: column;
  gap: var(--spacing-large);
  padding: 0 var(--spacing-large);
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  z-index: 2;
}

#chat-section-left {
  display: none;
}

#chat-section-right {
  min-height: 200px;
  max-height: 600px;
}

#map-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

@media screen and (min-width: 768px) {
  #responsive-container {
    margin: 0 auto;
    flex-direction: row;
    height: 100vh;
    justify-content: center;
  }

  #chat-section-right {
    width: 50%;
    height: 560px;
    flex-direction: column;
  }

  #chat-section-left {
    display: none;
  }

  #map-section {
    width: 45%;
  }

  #category-pie-chart {
    height: 300px !important;
  }

  .current-date {
    font-size: 1em !important;
  }
}

/* ===============================
   Chat Interface
   =============================== */
.chat-main-container {
  position: relative;
  z-index: 20;
  /* background: rgba(255, 255, 255, 0.6); */
  padding: 0 0 15px;
  height: 40vh;
  width: 100%;
}

.chat-messages-wrapper {
  height: calc(100% - 0px);
  overflow-y: scroll;
}

.chat-messages-wrapper .chat-messages {
  padding-bottom: 1rem;
}

.chat-messages .user-message {
  background-color: var(--chat-user-message);
  border-radius: var(--border-radius-small);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem;
  font-weight: 600;
}

.chat-messages .bot-message {
  background-color: var(--chat-bot-message);
  border-radius: var(--border-radius-small);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem;
  width: 94%;
}

.llm-response-header {
  display: none;
}

.llm-response-living-conditions,
.llm-response-trash,
.llm-response-streets,
.llm-response-parking {
  margin-top: 1em;
}

#chat-section-left .chat-input-container {
  display: none !important;
}

#chat-section-right .chat-input-container {
  display: flex;
  gap: var(--spacing-small);
}

.chat-input-container {
  width: 100%;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  background-color: rgba(250, 250, 250, .9);
  padding: var(--spacing-small);
}

.chat-input {
  flex-grow: 1;
  padding: var(--spacing-small);
  border: 1px solid var(--highlight);
  border-radius: var(--border-radius-small);
}

._dash-loading-callback {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 10px 0;
  text-align: center;
}

#loading-spinner-right,
#loading-spinner {
  position: static;
  background: transparent;
  pointer-events: none;
}

.chat-messages {
  scroll-behavior: smooth;
}

.chat-messages-wrapper {
  display: flex;
  flex-direction: column;
}

.chat-messages-wrapper {
  flex: 1;
  overflow: overflow;
}

#chat-section-right .chat-input-container {
  display: flex;
  gap: var(--spacing-small);
}

.chat-content-container {
  border-top: none;
  background-color: rgba(250, 250, 250, .9);
  border-bottom-left-radius: var(--border-radius-medium);
  border-bottom-right-radius: var(--border-radius-medium);
  border: 1px solid var(--highlight);
  border-top: none;
  box-shadow: var(--shadow-inner);
  height: calc(100% - 32px);
  overflow: hidden;

}

.chat-tabs-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border-bottom: 1px solid var(--highlight);
}

.chat-tab {
  padding: 10px;
  cursor: pointer;
  color: #999;
  background-color: rgba(235, 235, 235, 0.7);
  border-bottom: 1px solid var(--highlight);
  transition: all 0.2s ease;
}

#stats-tab {
  width: 50%;
  border-top-left-radius: var(--border-radius-small);
  border-top-right-radius: var(--border-radius-small);
  border: 1px solid var(--highlight);
  border-bottom: none;
  margin-right: 5px;
}

#community-tab {
  align-self: right;
  width: 50%;
  border-top-left-radius: var(--border-radius-small);
  border-top-right-radius: var(--border-radius-small);
  border: 1px solid var(--highlight);
  border-bottom: none;
}

.chat-tab.active {
  color: #000;
  background-color: rgba(250, 250, 250, .9);
  border-bottom: 3px solid white;
  font-weight: bold;
  margin-bottom: -1px;
}

.chat-tab:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.9);
}

._dash-loading>._dash-loading-callback {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.collapsible-response {
  margin-bottom: 10px;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f8f8f8;
  cursor: pointer;
  border-left: 4px solid #6aafdb;
}

.collapsible-header:hover {
  background-color: #f0f0f0;
}

.collapsible-header.expanded {
  border-left-color: #2c5f8e;
  background-color: #edf5fa;
}

.date-label {
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.toggle-icon {
  color: #6aafdb;
  font-size: 12px;
}

.collapsible-content {
  display: none;
  padding: 0;
}

.collapsible-header.expanded+.collapsible-content {
  display: block;
  padding: 15px;
}

.send-btn {
  padding: var(--spacing-small) var(--spacing-medium);
  background-color: var(--button-color);
  color: white;
  border: 1px solid var(--button-active);
  border-radius: var(--border-radius-small);
  cursor: pointer;
}

.send-btn:hover {
  border: 1px solid var(--button-active);
  background-color: var(--button-hover);
}

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

/* ===============================
   Map Controls
   =============================== */
.map-controls {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  max-width: 700px;
  margin: 0 auto;
  min-width: 300px;
  min-height: 300px;
  pointer-events: none;
  border-radius: 50% 50% 5% 50%;
  background: var(--background-base);
  box-shadow: 0 0 10px rgba(70, 11, 38, 0.4);
}

.map-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  min-width: 280px;
  min-height: 280px;
  max-width: 600px;
  max-height: 600px;
  border-radius: var(--border-radius-circle);
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

.slider-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 750px;
  max-height: 750px;
  z-index: 15;
  pointer-events: none;
}

.slider-container-shadow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88%;
  height: 88%;
  max-width: 750px;
  max-height: 750px;
  border-radius: var(--border-radius-circle);
  z-index: 14;
  pointer-events: none;
  box-shadow: var(--shadow-inner-dark);
}

.slider-container .handle,
.slider-container .active-arc {
  pointer-events: auto !important;
}

/* ===============================
   Slider Elements
   =============================== */

#slider {
  width: 100%;
  height: 100%;
  position: relative;
}

#slider-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  viewbox: 0 0 600 600;
  preserveaspectratio: xMidYMid meet;
}

#start-label,
#end-label {
  display: none;
}

.current-date {
  font-size: 0.7em;
  color: #777;
  position: absolute;
  bottom: var(--spacing-small);
  right: var(--spacing-small);
}

.inactive-circle {
  fill: none;
  stroke: #fff;
  stroke-width: 20;
}

.active-arc {
  fill: none;
  stroke: var(--button-active);
  stroke-width: 15;
  stroke-linecap: round;
}

.handle {
  fill: var(--button-color);
  stroke: var(--button-active);
  stroke-width: 3;
  cursor: pointer;
}

.center-point {
  fill: none;
}

.tick-mark {
  stroke: var(--chat-bot);
  stroke-width: 2;
}

.tick-mark-january {
  stroke: var(--chat-user);
  stroke-width: 3;
}

.year-label {
  font-size: calc(1vmin + 10px);
  font-weight: 500;
  text-anchor: middle;
  fill: #475569;
}

@keyframes pulsIn {
  0% {
    box-shadow: inset 0 0 0 1rem #fff;
    opacity: 1;
  }

  50%,
  100% {
    box-shadow: inset 0 0 0 0 #fff;
    opacity: 0;
  }
}

@keyframes pulsOut {

  0%,
  50% {
    box-shadow: 0 0 0 0 #fff;
    opacity: 0;
  }

  100% {
    box-shadow: 0 0 0 1rem #fff;
    opacity: 1;
  }
}

/* ===============================
 Chart Elements
 =============================== */

#category-pie-chart {
  width: 100%;
  height: 150px;
}

#shots-count-display {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  padding: 0.5rem;
  background-color: transparent;
  border-radius: 0;
  position: relative;
  z-index: 50;
  box-shadow: none;
  border: none;
}

.stats-visualization-container {
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  margin: 0.5rem auto 1rem auto;
  width: 90%;
}

.shots_count {
  color: #701238;
  font-size: 30px;
  margin-right: 5px;
}

#shots-count-display {
  margin: 0 auto;
}

.date-label {
  font-size: 1.1em;
  font-weight: 600;
}