.side-navbar {
  position: sticky;
  top: 36vh;
  left: 2vw;
  margin-left: 1vw;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 5vw;
}

.nav-square {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}
.square1 { background-color: #ed2875; }
.square2 { background-color: #fd7b0f; }
.square3 { background-color: #ffbf00; }
.square4 { background-color: #86b54a; }
.square5 { background-color: #38dbe7; }
.square6 { background-color: #ca58c1; }

.nav-square:hover {
  transform: scale(1.5);
}

.nav-square::after {
  content: attr(data-label);
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #787878;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-size: 0.68rem;
  font-family: "American Typewriter";
}
.nav-square:hover::after {
  opacity: 1;
}

h1 {
  font-size: 5rem;
  cursor: pointer;
}

h2 {
  font-size: 2.8rem;
  margin-top: 8%;
  margin-bottom: 1.75rem;
}

h3 {
  font-size: 2rem;
  text-align: left;
  margin-top: 5%;
  margin-bottom: 1.75rem;
}

h4 {
  font-size: 1.75rem;
  text-align: left;
  margin-top: 5%;
  margin-bottom: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

li {
  font-family: "American Typewriter";
  padding-bottom: 1%;
}

a:link {
  color:#ed2875;
}

#title {
  margin-top: -5%;
  padding-bottom: 10%;
  padding-left: 15%;
  z-index: 1;
}

.title-line {
  opacity: 0;
  transform: translateX(-200px);
  animation: flyIn 0.8s ease-out forwards;
}

.title-line:nth-child(1) {
  animation-delay: 0s;
}

.title-line:nth-child(2) {
  animation-delay: 0.6s;
}

.title-line:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes flyIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.heart {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 10;
}

.heart path {
  fill: var(--heart-color, #df006a);
}

@keyframes floatFade {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(0) translateX(0) rotate(0deg);
  }

  20% {
    opacity: 1;
    transform: scale(1) translateY(var(--y-move)) translateX(var(--x-move)) rotate(var(--rotate));
  }

  80% {
    opacity: 1;
    transform: scale(1) translateY(calc(var(--y-move) * 0.8)) translateX(calc(var(--x-move) * 0.8)) rotate(calc(var(--rotate) * 0.8));
  }

  100% {
    opacity: 0;
    transform: scale(0.8) translateY(calc(var(--y-move) * 1.2)) translateX(calc(var(--x-move) * 1.2)) rotate(calc(var(--rotate) * 1.2));
  }
}

.heart.animate {
  animation: floatFade 1.8s ease forwards;
}

body {
  padding: 2rem 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg
{
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p, span {
  text-wrap: pretty;
  font-family: "American Typewriter", serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  font-family: "Bodoni 72 Smallcaps", serif;
}

#root,
#__next {
  isolation: isolate;
}

.content-container {
  width: 56vw;
  /* Column width (not max-width) */
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  text-align: left;
}

.tooltip {
  position: absolute;
  /* take out of normal flow for precise positioning */
  pointer-events: none;
  /* let mouse events pass through */
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  /* start hidden */
  transition: opacity 0.2s ease-in-out;
  max-width: 250px;
  z-index: 10;
  /* optionally add a subtle shadow */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Map + sidebar layout */
.map-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 2rem;
  max-width: 80vw;
  margin: 2rem auto;
  justify-content: center;
  max-height: 75vh;
}

#map {
  flex: 1;
  border: 2px solid #3f3217;
  border-radius: 3px;
  max-height: 75vh;
  overflow: hidden;
  pointer-events: auto;
  z-index: 5;
}

/* Sidebar info panel */

.info-panel {
  flex-shrink: 0;
  /* Prevent shrinking */
  width: 28vw;
  /* Or a fixed width that fits your content */
  max-width: 34vw;
  max-height: 75vh;
  /* Optional for responsiveness */
  overflow: visible;
  /* Allow content to be fully visible */
  padding: 1rem;
  box-sizing: border-box;
  /* Make padding part of width */
  white-space: normal;
  /* Let text wrap by default */
  background-color: #f8f8f8;
  color: #333;
  font-family: "American Typewriter";
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  overflow-x: visible;
  overflow-y: scroll;
  pointer-events: auto;
  
}

.info-panel img {
  width: 100%;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.info-panel .setting-line {
  overflow-x: auto;
}

/* Base Reset + Typography */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

#bar-chart text {
  font-family: "American Typewriter";
}
#love-bar text {
  font-family: "American Typewriter";
}

#top-words text {
  font-family: "American Typewriter";
}

html {
  scroll-behavior: smooth;
}

#sort-mode {
  font-family: "American Typewriter";
  padding: 0.5%;
}

#top-words {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 75vw;
  margin: 0 auto;
}

#top-words-bars {
  width: 100%;
}

#love-lines {
  max-width: 65vw;
  margin-top: 5%;
}

#footer {
  font-family: "Bodoni 72 Oldstyle", serif;
  font-size: 1.5rem;
}

#span {
  font-family: "American Typewriter";
  padding: 0.5%;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 26px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #ffbf00;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.tooltip_love {
  opacity: 0;
  position: absolute;
  padding: 6px 10px;
  background: white;
  border: 1px solid #ccc;
  pointer-events: all;
  font-size: 0.9rem;
  border-radius: 4px;
  z-index: 1000;
}