body,
html {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #000000;
  color: #fff;
  height: 100%;
  scroll-snap-type: y mandatory;
  overflow-x: clip;
}

.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.content-section {
  padding: 60px 20px;
  margin: 0 auto;
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
}

.vis-wrapper {
  background: #000000;
  margin: 40px 0;
  width: 100%;
  flex-wrap: wrap;
}
#timeline-section {
  position: relative;
  width: 100%;
  height: 90vh;
  overflow: hidden;
}

.controls {
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  z-index: 4;
}
.center-controls {
  justify-content: center;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 15px;
  z-index: 4;
}
.title-controls {
  justify-content: center;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  padding-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  z-index: 4;
}
.mode-btn,
.filter-btn {
  background: #242424;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.mode-btn.active {
  background: #e0e0e0;
  color: #000000;
}
.mode-btn + .mode-btn {
  margin-left: -12px;
}
.mode-btn {
  border-radius: 0;
}

.mode-btn[data-mode="highlights"] {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.mode-btn[data-mode="details"] {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
.filter-btn {
  opacity: 0.6;
}

.filter-btn.active {
  opacity: 1;
}

.filter-btn[data-tag="technical_change"] {
  background: rgb(91, 91, 245);
}

.filter-btn[data-tag="safety_change"] {
  background: rgb(255, 166, 0);
}

.filter-btn[data-tag="fatal_crash"] {
  background: rgb(250, 0, 50);
}

.filter-btn[data-tag="injury_crash"] {
  background: rgb(96, 0, 96);
}

.timeline-container {
  position: absolute;
  top: 50px;
  bottom: 80px;
  overflow-x: hidden;
  width: 100%;
  white-space: nowrap;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.year-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  height: 100%;
  scroll-snap-align: center;
  box-sizing: border-box;
  padding: 20px 20px 20px;
  overflow-y: auto;
  text-wrap: auto;
}

.events {
  width: 100%;
  max-width: 1000px;
  overflow-y: auto;
  max-height: calc(100% - 60px);
}

.year-group h2 {
  font-size: 1.2em;
  margin: 0 0 16px;
  color: #fff;
}

.event {
  margin: 12px 0;
  padding: 12px;
  border-radius: 6px;
  background: #242424;
}

.event-description {
  margin-top: 8px;
  font-size: 0.9em;
  color: #aaa;
  line-height: 1.4;
  white-space: normal;
}

.event.technical_change {
  border-left: 4px solid rgb(91, 91, 245);
}

.event.safety_change {
  border-left: 4px solid rgb(255, 166, 0);
}

.event.fatal_crash {
  border-left: 4px solid rgb(250, 0, 50);
}

.event.injury_crash {
  border-left: 4px solid rgb(96, 0, 96);
}

.images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.images img {
  width: 300px;
  object-fit: cover;
  border-radius: 4px;
}

.timeline-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100px;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 3;
  overflow: visible;
}

#timeline-svg {
  height: 100%;
  overflow: visible;
}

.timeline-line {
  stroke: #fff;
  stroke-width: 2;
}

.year-point {
  fill: #fff;
  r: 8;
  cursor: pointer;
  transition: all 0.3s;
}

.year-point.focus {
  fill: #f74141;
  stroke: #fff;
  stroke-width: 2;
  r: 10;
}

.year-text {
  font-size: 12px;
  fill: #fff;
  text-anchor: middle;
  transition: all 0.3s;
}

.year-text.focus {
  fill: #fff;
  font-weight: bold;
  font-size: 14px;
}

svg#accident-fatality-svg {
  display: block;
  margin: 20px auto;
}

.axis path,
.axis line {
  stroke: #fff;
}

.axis text {
  fill: #fff;
  font-size: 0.85em;
}

.line {
  fill: none;
  stroke-width: 2;
}

.combi-legend text {
  fill: #fff;
  font-size: 0.85em;
}

#combinatorial-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(72, 72, 72, 0.75);
  color: #fff;
  padding: 8px;
  border-radius: 5px;
  font-size: 0.85em;
  display: none;
}

#filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.constructor-filter {
  display: flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 5px;
}

.constructor-filter label {
  margin-left: 5px;
  font-size: 12px;
}

label,
span {
  color: white;
}

.tooltip {
  position: absolute;
  background-color: white;
  padding: 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  fill: black;
}

h2 {
  margin-top: 20px;
}
.title-section {
  text-align: center;
  background-color: rgb(224, 4, 0);
}

.title-section h1 {
  font-size: 100px;
}
.text-section {
  padding: 20px;
  background-color: #740303;
  font-size: 30px;
  padding-left: 24vh;
  padding-right: 24vh;
  flex-wrap: wrap;
}
.text-section * {
  text-align: center;
}
.controls {
  margin: 20px;
  color: white;
}

svg {
  display: block;
  margin: auto;
}
#playButton {
  background-color: #2c2c2c;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 4px 15px;
  font-size: 15px;
  font-family: "Segoe UI", sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.25s ease, transform 0.2s ease;
}

#playButton:hover {
  background-color: #3d3d3d;
  transform: scale(1.04);
}

#playButton:active {
  background-color: #1a1a1a;
  transform: scale(0.98);
}

.tooltip {
  position: absolute;
  background: #333;
  padding: 6px 10px;
  border-radius: 4px;
  pointer-events: none;
  font-size: 12px;
  color: white;
  border: 1px solid #555;
  z-index: 10;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-content {
  background: #222;
  padding: 20px 30px;
  border-radius: 8px;
  width: 320px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 20px #000;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-content a {
  color: #00ff88;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.modal-content a:hover {
  text-decoration: underline;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #ccc;
}

.close:hover {
  color: #fff;
}

.visualization-container {
  margin-bottom: 80px;
  padding: 20px;
  border-radius: 10px;
  background: #111;
}

.tooltip {
  position: absolute;
  background: #111;
  color: #ddd;
  border: 1px solid #555;
  padding: 14px;
  border-radius: 12px;
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  max-width: 300px;
  transition: opacity 0.3s, transform 0.2s;
  line-height: 1.5;
  z-index: 1000;
}

.tooltip .driver-name {
  font-size: 18px;
  font-weight: bold;
  color: gold;
  margin-bottom: 8px;
}

.tooltip .label {
  color: #87cefa;
  font-weight: bold;
}

.tooltip .value {
  color: #fff;
}

.driver-text {
  text-anchor: middle;
  pointer-events: none;
  fill: white;
  font-weight: bold;
}

.axis text {
  font-size: 12px;
  fill: #ccc;
}

.axis line,
.axis path {
  stroke: #ccc;
}

.accident-tooltip {
  position: absolute;
  text-align: center;
  padding: 5px;
  font-size: 12px;
  background: lightcoral;
  color: white;
  border-radius: 5px;
  pointer-events: none;
}

select {
  padding: 8px 12px;
  font-size: 14px;
  background-color: #333;
  border: 1px solid rgb(87, 221, 183);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.x-label,
.y-label,
.axis-label {
  fill: #ccc;
  font-size: 16px;
  font-weight: bold;
}

.graph-description {
  text-align: center;
  color: #ccc;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.bar {
  stroke: none;
}

.legend {
  font-size: 14px;
  fill: #ccc;
}

.controls {
  margin-bottom: 30px;
}

.search-container {
  position: relative;
  max-width: 400px;
  padding-left: 50px;
}

#driver-search {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #404040;
  border-radius: 4px;
  font-size: 16px;
  background-color: #ffffff;
  color: #ffffff;
}

#driver-search:focus {
  outline: none;
  border-color: #505050;
  background-color: #333333;
}

#driver-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

#driver-dropdown.show {
  display: block;
}

.dropdown-item {
  padding: 10px 15px;
  cursor: pointer;
  color: #e0e0e0;
}

.dropdown-item:hover {
  background-color: #404040;
}

.chart-container {
  flex: 1;
  position: relative;
}

.legends-container {
  width: 200px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legend-container {
  background: #2d2d2d;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.line-style-legend {
  background: #2d2d2d;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.axis-label {
  fill: #fff;
  font-size: 12px;
}

.tick text {
  font-size: 12px;
  fill: #fff;
}

.grid line {
  stroke: #505050;
  stroke-width: 1;
}

.grid path {
  stroke-width: 0;
}

.line {
  fill: none;
  stroke-width: 2;
}

.point {
  stroke: #2d2d2d;
  stroke-width: 2;
}

#tooltip {
  position: absolute;
  opacity: 0;
  background: #404040;
  color: #ffffff;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

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

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

.legend-text {
  color: #e0e0e0;
}

.driver-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn {
  padding: 8px 16px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #0052a3;
}

.selected-drivers {
  display: flex;
  gap: 10px;
  position: absolute;
  top: 10px;
  left: 20px;
  z-index: 100;
}

.driver-tag {
  background: #404040;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.driver-tag .remove {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.driver-tag .remove:hover {
  opacity: 1;
}

.line-style-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.line-style-sample {
  width: 30px;
  height: 0;
  border-top: 2px solid #ffffff;
}

.line-style-text {
  color: #e0e0e0;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

#driver-select {
  width: 100%;
  padding: 8px;
  margin-top: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.x-axis path,
.x-axis line,
.y-axis path,
.y-axis line {
  stroke: #505050;
}

.x-axis text,
.y-axis text {
  fill: #e0e0e0;
}

h1 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 20px;
}

.controls {
  text-align: center;
  margin-bottom: 15px;
  width: 100%;
  max-width: 1300px;
}

.toggle-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-left: 20px;
}

.toggle-buttons button {
  padding: 10px 20px;
  background-color: #2d2d2d;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.toggle-buttons button.active {
  background-color: #e10600;
  color: white;
}

.toggle-buttons button:hover {
  background-color: #c10500;
}

.slider-container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  max-width: 1000px;
}

#vigneshSlider {
  margin: 10px 0;
  width: 100%;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  width: 100%;
  max-width: 1300px;
}

#stacked-bar-chart {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 20px;
  padding: 10px;
}

#stacked-bar-chart svg {
  flex: 1 1 auto;
}

.stackedLegend {
  flex: 0 0 270px;
  max-width: 300px;
  min-width: 200px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 12px;
  gap: 8px;
  background: rgba(30, 30, 30, 0.9);
  overflow-y: auto;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  max-height: 60vh;
  overflow: auto;
}

.tooltip {
  position: absolute;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#tooltip {
  position: absolute;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#tooltip.visible {
  opacity: 1;
}

.bar {
  transition: opacity 0.3s;
}

.bar:hover {
  opacity: 0.8;
}

.driver-glyph {
  cursor: pointer;
  transition: transform 0.2s;
}

.driver-glyph:hover {
  transform: scale(1.1);
}

.handle-label {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #ffffff;
  white-space: nowrap;
  background: #2d2d2d;
  padding: 2px 5px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 1px solid #4d4d4d;
}
#yearRangeSlider {
  width: 25%;
  margin-left: 40px;
  margin-right: 40px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff !important;
}

.legend-item span {
  color: #ffffff !important;
}

.legend-item:hover {
  background-color: #3d3d3d;
  transform: translateY(-1px);
}

.legend-item-selected {
  background-color: #3d3d3d;
  box-shadow: inset 0 0 0 1px #4d4d4d;
  transform: translateY(-1px);
}

.legend rect {
  stroke: #ffffff;
  stroke-width: 1px;
  min-width: 15px;
  height: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

rect {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-highlight {
  opacity: 1;
  transform: scale(1.02);
  transform-origin: center;
  filter: brightness(0.85);
  position: relative;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-highlight-locked {
  opacity: 1;
  transform: scale(1.02);
  transform-origin: center;
  filter: brightness(0.85);
  position: relative;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-dimmed {
  display: none;
}

.axis text {
  fill: #ffffff;
  font-size: 12px;
}

.axis path,
.axis line {
  stroke: #4d4d4d;
}

.axis-label {
  fill: #ffffff;
  font-size: 14px;
  font-weight: bold;
}

.radarStroke {
  stroke-width: 2px;
}
.radarArea {
  fill-opacity: 0.3;
}
.activeDriver {
  stroke-width: 3px;
  stroke: #000;
}
.text-section,
.vis-wrapper,
.title-section {
  scroll-snap-align: start;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.text-section,
.vis-wrapper {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.in-view {
  opacity: 1 !important;
}
.padding-top-zero {
  padding-top: 0px;
}
#driver-performance-chart {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}
.header-image {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.header-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 80vh;
}

.white-slashes {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-image: repeating-linear-gradient(
    135deg,
    white 0,
    white 10px,
    transparent 10px,
    transparent 20px
  );
  pointer-events: none;
  opacity: 0.7;
}
.overlay-title {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 100px;
  color: white;
  z-index: 2;
  text-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.display-block {
  display: block;
}
.text-section {
  position: relative;
}
.text-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.616);
  pointer-events: none;
  z-index: 1;
}

.text-section p {
  position: relative;
  z-index: 2;
}
.insights-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: #e10600;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 5px;
  cursor: pointer;
}
.info-box {
  position: fixed;
  top: 60px;
  right: 20px;
  max-width: 300px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 999;
  border: 1px solid;
}
.overlay-footer-note {
  font-size: 50px !important;
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  z-index: 2;
  text-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
}
.background-image-class {
  background-image: url(assets/end-image.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  position: relative;
}
