:root {
  --base-color: #510f0f;
  --line-color: #9f8f8f;
  --poketext-color: #ffcc01;
  --pokestroke-color: #3269b2ff;
  --hover-color-1: #853636a8;
  --accent-color: #ece2c4;
  --dropdown-color: rgb(242, 217, 142);
  --timeline-h: clamp(80px, 12vh, 120px);
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-family: Galindo, sans-serif;
}

body {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* sidebar main styles */
.logo {
  font-size: 26px;
}

.menu-text {
  font-size: 18px;
}

#sidebar {
  display: flex;
  flex-direction: column;

  box-sizing: border-box;
  height: 100vh;
  width: 250px;
  padding: 5px 1em;
  background-color: var(--base-color);
  border-right: 2px solid var(--line-color);

  position: sticky;
  top: 0;
  align-self: start;

  transition: 300ms ease-in-out;
  overflow: hidden;

  text-wrap: nowrap;
  line-height: 1.5rem;
}

#sidebar.close {
  padding: 5px;
  width: 65px;
}

#sidebar ul {
  list-style: none;
}

#sidebar > ul > li:first-child {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  .logo {
    font-weight: bold;
  }
}

#sidebar ul li.active a {
  span,
  img {
    scale: 1.15;
    opacity: 1;
  }
}

#sidebar a > img,
.dropdown-button > img {
  opacity: 0.65;
}

#sidebar a,
#sidebar .dropdown-button,
#sidebar .logo {
  border-radius: 0.5em;
  padding: 0.85em;
  text-decoration: none;

  color: var(--poketext-color);
  -webkit-text-stroke: 0.6px var(--pokestroke-color);

  display: flex;
  align-items: center;
  gap: 1em;
}

#sidebar a > span,
.dropdown-button span {
  opacity: 0.8;
}

#sidebar img,
#sidebar svg {
  flex-shrink: 0;
  fill: var(--dropdown-color);
  stroke: none;
}

#sidebar a span,
#sidebar .dropdown-button,
.dropdown-button > span {
  flex-grow: 1;

  padding-left: 1em;
}

#sidebar a:hover,
#sidebar .dropdown-button:hover {
  background-color: var(--hover-color-1);
}

/* dropdown menu styles */

.dropdown-button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.dropdown-button svg {
  transition: 200ms ease;
}

.rotate svg:last-child {
  rotate: 180deg;
}

#sidebar .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  > div {
    overflow: hidden;
  }
}

#sidebar .sub-menu a {
  padding-left: 2em;
  opacity: 0.8;
}

#sidebar .sub-menu.show {
  grid-template-rows: 1fr;
}

#toggle-button {
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: 0.5em;
  background: none;
  cursor: pointer;

  svg {
    transition: rotate 150ms ease;
  }
}

#toggle-button:hover {
  background-color: var(--hover-color-1);
}

#sidebar-info {
  position: relative;
  margin-top: auto;

  display: flex;
  align-items: center;

  padding-left: 10px;
  padding-bottom: 10px;
}

.info-button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1f1f1f58;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
  cursor: help;
}

.info-icon {
  color: white;
  font-family: serif;
  font-style: italic;
  font-weight: bold;
  font-size: 10px;
}

.attribution-tooltip {
  position: absolute;
  left: 60px;
  bottom: 15px;

  width: 150px;
  height: 210px;
  background: #1a1a1a7f;
  border: 1px solid #ffffff33;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

  opacity: 0;
  visibility: hidden;
  transform: translate(-65px, -35px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.info-button:hover {
  background-color: var(--hover-color-1s);

  background-color: #333;
  border-color: #ffcb05;

  + .attribution-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50px, -35px);
  }
}

.tooltip-title {
  margin: 0 0 8px 0;
  font-size: 10px;
  color: #ffcb05;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.attribution-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attribution-list li {
  font-size: 10px;
  color: #ccc;
  margin-bottom: 5px;
  line-height: 1.4;
}

#sidebar.close .info-button:hover + .attribution-tooltip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#sidebar.close .info-button {
  margin-left: 5px;
  border-color: rgba(255, 255, 255, 0.1);
  cursor: default;
}

#map-area {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1a1a1a; /* change to pokemon background red later*/
  overflow: hidden;
}

/* map area */
#attribution-box {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 30px;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  z-index: 1000;
}

#attr-icon {
  width: 60px;
  height: 60px;

  background: none;
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#attr-icon img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s ease;
}

#attr-icon:hover img {
  transform: rotate(20deg);
}

#attr-text {
  white-space: nowrap;
  padding: 0 15px;
  font-size: 14px;
  color: #333;
  opacity: 1;
  transition: opacity 0.3s ease;
  text-shadow: -0.5px 0.5px 0.7px rgba(0, 0, 0, 0.8);
  -webkit-text-stroke: 0.1px#fff;

  strong {
    -webkit-text-stroke: 0.05px#ffffff64;
  }

  a {
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
    color: var(--poketext-color);
    -webkit-text-stroke: var(--pokestroke-color);
  }
}

.attr-collapsed {
  max-width: 60px;
}

.attr-collapsed #attr-text {
  opacity: 0;
  pointer-events: none;
}

#attribution-box:not(.attr-collapsed) {
  max-width: 450px;
  border-radius: 25px;
}

#map-container {
  flex: 1;
  width: 100%;
  height: 100vh;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#map-container svg,
#timeline-container svg {
  width: 100%;
  height: 100%;
}

svg.focus-mode path {
  fill: #1a1a1a !important;
  opacity: 0.7;
  stroke: none !important;
  transition: none;
}

svg.focus-mode path.selected-path {
  fill: transparent !important;
  opacity: 1;
  stroke: #ae7700 !important;
  stroke-width: 3px !important;
  transition: stroke-width 0.3s ease;
}

#focus-label {
  font-family: "Galindo", sans-serif;
  font-size: 12px;
  fill: white;
  stroke: #000;
  stroke-width: 0.5px;
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#map-container path {
  pointer-events: all !important;
  cursor: pointer;
  fill: transparent;
  stroke: none;
  stroke-width: 0px;
}

#map-container path.highlighted {
  fill: rgba(255, 222, 222, 0.46) !important;
  stroke: #ae7700 !important;
  stroke-width: 3px;
  transition:
    fill 0.3s ease,
    stroke-width 0.3s ease;
}

.location-icon {
  pointer-events: none;
  filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.5));
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.hover-group {
  pointer-events: none;
}

.hover-label {
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: "Galindo", sans-serif;
  font-size: 28px;
  fill: #000000;
  stroke: #eeab19;
  stroke-width: 0.7px;
  pointer-events: none;
}

#reset-button {
  display: none;
  position: absolute;
  top: 1.5vh;
  right: 1%;

  padding: 10px;

  font-family: "Galindo", sans-serif;
  color: #000;
  background-color: #fff2f0ee;
  border-width: 6px;
  border-radius: 10px;
  transition:
    color 0.3s ease,
    background-color 0.3s ease;

  z-index: 100;
  cursor: pointer;
}

#reset-button:hover {
  color: #711212;
  background-color: #d0b9b4ee;
}

/* timeline */

#timeline-container {
  height: var(--timeline-h);
  width: 100%;
  flex-shrink: 0;
  z-index: 20;
  background: linear-gradient(
    180deg,
    #910707 0%,
    #910707 50%,
    #f1e7e7 50%,
    #f1e7e7 100%
  );
}

.bg-circle {
  fill: #f7e6e6;
  stroke: #000;
  stroke-width: 3px;
}

.mark-text {
  text-anchor: middle;
  dominant-baseline: middle;
  font-size: 20px;
  font-family: "Galindo", sans-serif;
}

.unselected {
  fill: #cfcdcd;
  stroke: #231a1aa7;
}

.pb-icon {
  x: -37.5;
  y: -37.5;
  width: 75px;
  height: 75px;
}

.gen-mark:hover .bg-circle {
  r: 32px;
  stroke: #fff;
  fill: rgb(198, 66, 66);
}

.gen-mark:hover .mark-text {
  font-size: 30px;
  fill: #fff;
}

.gen-mark:hover .pb-icon {
  x: -42.5;
  y: -42.5;
  width: 85px;
  height: 85px;
}

.bg-circle,
.mark-text,
.pb-icon {
  transition: all 0.2s;
}

/* selected region data display */
#data-container {
  position: absolute;
  top: 1%;
  left: 20px;

  width: 55%;
  height: calc(100% - var(--timeline-h) - 20px);
  filter: drop-shadow(5px 0px 15px rgba(0, 0, 0, 0.5));

  pointer-events: none;
  z-index: 10;
  overflow: hidden;

  /* setup for smooth enter transitioning */
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  pointer-events: none;
}

#data-container.visible {
  /* smooth enter transition */
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#data-container svg {
  pointer-events: auto;
}

.data-box {
  fill: #fff2f0ee;
  stroke: #000000;
  stroke-width: 10px;
  rx: 20px;
}

#data-gen-title {
  fill: #ffc011;
  stroke: #000000;
  stroke-width: 1.5px;
  font-size: 48px;
  font-family: "Galindo", sans-serif;
  text-shadow:
    0px 0px 4px #877138,
    0px 0px 2px #817373;
}

.data-section-h1 {
  fill: #000000;
  font-size: 36px;
  font-family: "Galindo", sans-serif;
}

.data-section-h2 {
  fill: #f1f1f1;
  font-size: 24px;
  font-family: "Galindo", sans-serif;
  text-shadow:
    0px 0px 4px #0e0d0d,
    0px 0px 2px #010101;
}

.data-section-stats {
  color: #5c5c5c;
  font-family: "Galindo", sans-serif;
}

.data-section-body {
  color: #7e7e7e;
  transition: color 0.3s ease;
  font-family: "Galindo", sans-serif;
  text-align: center;
}

.data-section-body a {
  color: #5d71f5;
  text-decoration: underline;
  transition: all 0.3s ease;
}

.data-section-body a:hover {
  color: #ff1616 !important;
}

.data-section-detail {
  color: #7f6969;
  fill: #7f6969;
  font-family: "Galindo", sans-serif;
}

.data-section-hyperlink {
  color: #5d71f5;
  text-decoration: underline;
  transition: all 0.3s ease;
}

.data-section-hyperlink:hover {
  color: #d84141;
}

.collapsed-placeholder {
  text-anchor: middle;
  font-size: 20px;
  font-style: italic;
  opacity: 0.5;
  pointer-events: none;
}

.toggle-text {
  fill: #fff;
  font-family: "Galindo", sans-serif;
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
  text-shadow:
    0px 0px 8px rgba(0, 0, 0, 1),
    0px 0px 4px rgba(0, 0, 0, 1);
  transition: opacity 0.2s ease;
}
