
/* Consistent styles for input and select elements */
input, select {
  font-size: 0.8rem;
  padding: 0.25em 0.75em;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #f8f8fa;
  color: #222;
  margin: 0.25em 0.5em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: #352779;
  box-shadow: 0 0 0 2px #e0d7ff;
}

input::placeholder {
  color: #888;
  opacity: 1;
}

.centered-div {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px;
}

h1.page-title {
  text-align: center;
  margin-top: 5px;
  margin-bottom: 5px;
}

.shadow-box {
  box-shadow: 5px 5px 0px #888888;
  border: 3px solid #292929;
  padding: 12px;
  border-radius: 8px;
  background-color: #f9f9f9;
  max-width: 800px;
  margin: 0 auto;
  margin-top: 20px
}

.chart-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0px;
  margin-bottom: 10px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23352779" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75em center;
  background-size: 1em;
  padding-right: 2em;
}
.rd-bar {
  display: block;
  height: 22px;
  background: #e4d03d;
  color: #333;
  border-radius: 4px;
  margin-bottom: 4px;
  transition: width 0.3s;
}
.rd-bar.negative {
  background: #69b8f0;
  color: #333;
  margin-left: 0;
  margin-right: 0;
  align-self: flex-end;
}
 .rd-bar.negative {
   float: right;
   direction: rtl;
 }
.rank-divergence-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  /* ...existing code... */
}
 .rd-bar.negative {
   float: right;
   direction: rtl;
   text-align: right;
 }
:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  background-color: #ffffff;
  color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --uvm-green: #164734
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  padding: 20px;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 2.5em;
  line-height: 1.1;
}

/* style for input elements */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 1em;
  background-color: white;
  color: black;
}


#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
  filter: drop-shadow(0 0 2em #f7df1eaa);
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

button {
  color: white;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.3em 0.9em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--uvm-green);
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #000000;
}
button:focus,
button:focus-visible {
  outline: 4px auto #0b4c06;
}

.btn-secondary {
  background-color: transparent;
  background-color: #F7F7F7;
  color: #333;
  border: 1px solid #333;
}
.btn-secondary:hover {
  background-color: #333;
  color: #F7F7F7;
}

#wiki-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1em;
  margin-top: 2em;
  min-height: 400px;
}

.wiki-preview {
  border: 0.5px solid gray;
  padding: 6px;
}

.wiki-preview p {
  font-weight: 600;
  line-height: normal;
  margin-top: 2px;
  margin-bottom: 2px;
}

.img-placeholder {
  background-color: gray;
  height: 100px;
  width: 100%;
}

.hard-drop-shadow {
  box-shadow: 5px 5px 0px #888888;
  border: 3px solid #292929;
}
#wiki-previews .wiki-preview:hover {
  background-color: #f3f3f3;
}

#wiki-thumb-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 0.5fr));
  /* center the grid */
  justify-content: center;
  gap: 0.5em;
  margin-top: -1em;
  margin-bottom: -1em;
  padding: 20px
}

#wiki-thumb-previews img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

#wiki-thumb-previews .article-preview {
  cursor: pointer;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

#wiki-thumb-previews .article-preview.expanded {
  max-height: 200px; /* Adjust as needed for the content */
}

.color-circle {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 0.5em;
}

#ngram-search {
  margin-bottom: 2em;
  width: 100%;
  height: 30px;
  padding: 10px
}

.preview-highlight {
  background-color: #a7a7a7;
  border: #242424;
}

.y-axis-label {
  -webkit-text-fill-color: white; /* Or any desired color */
  -webkit-text-stroke-width: 1px; /* Adjust the width as needed */
  -webkit-text-stroke-color: white;
}

.outline-label {
    font-size:  14px;
    paint-order: stroke;
    stroke: #f3f3f3;
    stroke-width: 1px;
    stroke-linecap: butt;
    stroke-linejoin: miter;
    font-weight: 800;

}

.chart-tooltip {
  position: absolute;
  background-color: white;
  color: black;
  border: 2px solid #000;
  padding: 10px;
  font-size: 16px;
  font-family: 'Courier New', Courier, monospace; /* Retro font style */
  box-shadow: 5px 5px 0px #888888; /* Hard drop shadow for retro feel */
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

#rank-divergence-container {
  display: flex;
  gap: 20px; /* Optional: Add spacing between items */
  margin-top: 20px;
  font-size: 14px
}

@media (max-width: 800px) {
  #rank-divergence-container {
    font-size: 10px;
  }
}

#pos-rd-list {
  color: #474747;
  flex: 1 1 50%; /* Two columns */
}

#neg-rd-list {
  color: #352779;
  flex: 1 1 50%; /* Two columns */
}

.rank-divergence-line {
  flex: 1 1 calc(19% - 4px); /* Three items per row with spacing */
  box-sizing: border-box;
  padding: 4px;
  background-color: #f6f6f6;
  border-radius: 4px;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  margin-bottom: 8px
}

.read-on-wiki {
  display: inline-flex;
  align-items: center;
  margin-top: 0px;
  color: #646cff;
  text-decoration: none;
  font-size: 0.8em;
}

.read-on-wiki::after {
  content: "↗";
  font-size: 0.8em;
  margin-left: 0.2em;
  vertical-align: middle;
}

.custom-truncated-text-tooltip {
  position: absolute;
  background-color: "#333";
  color: "#fff";
  padding: "8px 12px";
  border-radius: "6px";
  font-size: "14px";
  white-space: "nowrap";
  z-index: "1000";
  bottom: "125%";
  left: "50%";
  transform: "translateX(-50%)";
  visibility: "hidden";
  opacity: "0";
  transition: "opacity 0.3s, visibility 0.3s";
  box-shadow: "0 2px 8px rgba(0,0,0,0.2)";
  pointer-events: "none";
}

/* Responsive chart containers */
#area-chart,
#bump-chart {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

#area-chart svg,
#bump-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

#controls {
  display: flex; align-items: center; gap: 10px;
}

#control-wrapper {
  display: flex; align-items: center; gap: 10px;
}

@media (max-width: 600px) {
  #controls {
    flex-direction: column;
    align-items: stretch;
  }

  #control-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}

/* driver.js tutorial theme overrides */
.allotax-tour-popover .driver-popover-footer button {
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

.allotax-tour-popover.driver-popover {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  max-width: 360px;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.allotax-tour-popover .driver-popover-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
}

.allotax-tour-popover .driver-popover-description {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
}

.allotax-tour-popover .performance-tip {
  margin-top: 0.5em;
  padding: 0.4em 0.6em;
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #6d5300;
  line-height: 1.4;
}

.allotax-tour-popover .driver-popover-progress-text {
  font-size: 0.75rem;
  color: #999;
}

.allotax-tour-popover .driver-popover-navigation-btns .driver-popover-next-btn {
  background-color: #373737;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.allotax-tour-popover .driver-popover-navigation-btns .driver-popover-next-btn:hover {
  background-color: #1d4ed8;
}

.allotax-tour-popover .driver-popover-navigation-btns .driver-popover-prev-btn {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.allotax-tour-popover .driver-popover-navigation-btns .driver-popover-prev-btn:hover {
  background-color: #e0e0e0;
}
