/* Import fonts */
@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;500;600;700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

/* Define root variables for consistent styling */
:root {
  --heading-font: "Josefin Sans", sans-serif;
  --body-font: "Outfit", sans-serif;
  --theme-foreground: #e0d0c1;
  --theme-foreground-muted: #d4c5b5;
  --heading-color: #f0e0d0;
  --body-text-color: #e8d8c8;
  --card-title-color: #f0e0d0;
}

/* Apply body font as default */
body,
button,
input,
select,
textarea,
p,
label {
  font-family: var(--body-font);
}

/* Apply heading font to titles and important text */
h1,
h2,
h3,
h4,
h5,
h6,
.card-title {
  font-family: var(--heading-font);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 300px;
  height: calc(100% - 50px); /* Adjust height to account for heading */
  overflow: hidden; /* Hide overflow */
}

.checkbox-list div {
  height: 96%;
  padding: 0 1rem;

  overflow-y: auto; /* Enable vertical scrolling */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding-right: 5px; /* Add some padding for scrollbar */
}

.checkbox-list > form {
  height: 100%;
  overflow-y: auto; /* Enable scrolling within the form */
}

/* Add styling for individual checkboxes */
.checkbox-list label {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.checkbox-list label:hover {
  background-color: rgba(193, 154, 107, 0.2);
}

.checkbox-list input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.controls-horizontal {
  max-width: unset !important;
}

.controls {
  background: rgba(70, 48, 30, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(193, 154, 107, 0.3);
  min-width: 200px;
  max-width: 310px;
  height: calc(100% - 1rem);
  overflow: hidden;
  margin-bottom: 1rem;
}

.control-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
}

.controls h3 {
  margin-top: 0;
  border-bottom: 1px solid rgba(193, 154, 107, 0.3);
  font-weight: 700;
  padding: 1rem;
  padding-bottom: 0.5rem;
}

/* Add custom scrollbar styling */
.checkbox-list div::-webkit-scrollbar {
  width: 6px;
}

.checkbox-list div::-webkit-scrollbar-thumb {
  background-color: rgba(193, 154, 107, 0.5);
  border-radius: 6px;
}

.checkbox-list div::-webkit-scrollbar-track {
  background-color: rgba(70, 48, 30, 0.1);
  border-radius: 6px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--body-font);
  margin: 4rem 0 8rem;
  text-wrap: balance;
  text-align: center;
  padding: 3rem 1rem;
  position: relative;
  overflow: hidden;
  /* Remove the border-radius and box-shadow to better integrate with the page */
}

/* Add subtle pattern background - make it more subtle */
/* .hero:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(193, 154, 107, 0.03) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(193, 154, 107, 0.05) 0%, transparent 50%);
  z-index: -1;
} */

.coffee-bean {
  position: absolute;
  width: 30px;
  height: 18px;
  background-color: #603813;
  border-radius: 50%;
  transform: rotate(var(--rotate));
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
  animation: float-bean 15s linear infinite;
  opacity: 0.4;
}

.coffee-bean:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 2px;
  background-color: #46301e;
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

@keyframes float-bean {
  0% {
    transform: translate(0, 0) rotate(var(--rotate));
  }
  25% {
    transform: translate(10px, 10px) rotate(calc(var(--rotate) + 5deg));
  }
  50% {
    transform: translate(0, 20px) rotate(calc(var(--rotate) + 10deg));
  }
  75% {
    transform: translate(-10px, 10px) rotate(calc(var(--rotate) + 5deg));
  }
  100% {
    transform: translate(0, 0) rotate(var(--rotate));
  }
}

.coffee-svg-container {
  margin-bottom: 1rem;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
  transform: scale(1.2);
}

.coffee-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2s forwards ease-in-out;
}

.cup {
  animation-delay: 0s;
}

.handle {
  animation-delay: 0.5s;
}

.coffee {
  animation-delay: 1s;
}

.smoke-1 {
  animation: draw 1s forwards ease-in-out 1s, shift 6s linear 1.5s infinite;
  opacity: 0;
}

.smoke-2 {
  animation: draw 1s forwards ease-in-out 1.2s, shift-2 5s linear 1.7s infinite;
  opacity: 0;
}

.smoke-3 {
  animation: draw 1s forwards ease-in-out 1.4s, shift-3 7s linear 1.9s infinite;
  opacity: 0;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes shift {
  0% {
    transform: translate(0, 45px) scale(0.8);
    opacity: 0.8;
  }
  80% {
    opacity: 0.1;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
}

@keyframes shift-2 {
  0% {
    transform: translate(0, 45px) scale(0.9);
    opacity: 0.8;
  }
  80% {
    opacity: 0.1;
  }
  100% {
    transform: translate(0, 0) scale(1.1);
    opacity: 0;
  }
}

@keyframes shift-3 {
  0% {
    transform: translate(0, 45px) scale(0.7);
    opacity: 0.8;
  }
  80% {
    opacity: 0.1;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
}

.coffee-fill {
  animation: fadeIn 1s forwards ease-in-out 1s,
    ripple 5s ease-in-out 2s infinite;
  opacity: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes ripple {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.02);
  }
}

.hero h1 {
  margin: 0.5rem 0;
  padding: 1rem 0;
  max-width: none;
  font-size: 14vw;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(30deg, #603813, #c19a6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  font-family: var(--heading-font);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: titleIn 1.5s ease-out;
  position: relative;
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1:after {
  content: "";
  position: absolute;
  width: 50%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #c19a6b, transparent);
  bottom: 0;
  left: 25%;
  border-radius: 2px;
}

.hero h2 {
  margin: 1rem auto;
  max-width: 40em;
  font-size: 16px;
  font-style: initial;
  font-weight: 500;
  line-height: 1.5;
  color: var(--theme-foreground-muted);
  font-family: var(--body-font);
  animation: fadeUp 1.5s ease-out 0.5s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cta-button {
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  background-color: #603813;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(96, 56, 19, 0.3);
  font-family: var(--heading-font);
  position: relative;
  animation: fadeUp 1.5s ease-out 1s both;
  z-index: 1;
}

/* Remove the problematic :before pseudo-element animation */
.cta-button:hover {
  background-color: #7e572b;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(96, 56, 19, 0.4);
}

.cta-button:hover:before {
  left: 100%;
}



/* Horizontal coffee bean divider */
.bean-divider {
  display: flex;
  align-items: center;
  width: 80%;
  max-width: 600px;
  margin: 1rem auto;
  opacity: 0.5;
  animation: fadeUp 1.5s ease-out 0.7s both;
}

.bean-wrapper {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  width: 100%;
}

.bean-divider hr {
  flex-grow: 1;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c19a6b, transparent);
}

.bean-divider .divider-bean {
  width: 20px;
  height: 12px;
  background-color: #c19a6b;
  border-radius: 50%;
  margin: 0 10px;
  position: relative;
  transform: rotate(45deg);
}

.bean-divider .divider-bean:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 1px;
  background-color: rgba(70, 48, 30, 0.7);
  transform: translate(-50%, -50%);
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 90px;
  }

  .coffee-svg {
    width: 150px;
    height: 150px;
  }
}



.map-view-toggle {
  display: flex;
  justify-content: center;
  background: rgba(70, 48, 30, 0.2);
  border-radius: 50px;
  padding: 0.5rem;
  margin: 2rem auto;
  width: fit-content;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(193, 154, 107, 0.3);
}

.map-toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: #e0d0c1;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: var(--heading-font);
}

.map-toggle-button:hover {
  color: #fff;
}

.map-toggle-button.active {
  background: #603813;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.map-toggle-button svg {
  transition: all 0.3s ease;
  pointer-events: none; /* Prevents the SVG from capturing the click event */
}

.map-toggle-button:hover svg {
  transform: scale(1.1);
}

/* Visualization description styles */
.visualization-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card-title {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
}

h3,
.card-title {
  color: #c19a6b !important;
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 700;
}

.card p {
  font-size: 1.1em;
}

.card p {
  font-size: 1.1em;
}

p {
  max-width: 95%;
}

p,
ul {
  color: var(--theme-foreground);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.visualization-description {
  height: 100%;
  margin: 0;
  width: 100%;
}

.visualization-description em {
  color: #d4c5b5;
  font-size: 0.9em;
  line-height: 1.4 !important;
  display: block;
  margin-top: 0.8rem;
}

#world-map {
  cursor: grab;
}

#world-map:active {
  cursor: grabbing;
}

/* Responsive layout for larger screens */
@media (min-width: 768px) {
  .visualization-container {
    flex-direction: row;
    align-items: flex-start;
  }

  #world-map {
    flex: 2;
  }

  .visualization-description {
    flex: 1;
    max-width: 350px;
    position: sticky;
    top: 2rem;
  }
}

.dropdown-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  background: rgba(70, 48, 30, 0.1);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(193, 154, 107, 0.3);
}

.dropdown-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.dropdown-group label {
  color: var(--heading-color);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-family: var(--heading-font);
}

.coffee-dropdown {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #c19a6b;
  background-color: rgba(96, 56, 19, 0.1);
  color: var(--theme-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.coffee-dropdown:hover,
.coffee-dropdown:focus {
  border-color: #aa6122;
  background-color: rgba(96, 56, 19, 0.2);
  outline: none;
}

.coffee-dropdown option {
  background-color: #46301e;
  color: #e0d0c1;
}

/* Radar chart container styling */
.card {
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 2px; /* Add padding to prevent overflow at bottom */
  overflow: visible; /* Allow child elements to be visible */
}

/* Make radar chart responsive */
.card svg.radar-chart {
  max-width: 100%;
  height: auto;
}

/* Media queries for the radar chart layout */
@media (max-width: 900px) {
  .card > div {
    flex-direction: column;
    height: auto !important;
    padding-bottom: 2px; /* Add padding to bottom */
  }
}

.card-paragraph p {
  text-align: justify;

}


.card-paragraph p {
  text-align: justify;
}


.correlation_checkboxes {
  display: flex;
  flex-wrap: nowrap;        /* Prevent line breaks */
  gap: 0.5rem;
  overflow-x: auto;         /* Allow horizontal scrolling */
  padding-bottom: 0.5rem;
  width: 100%;
  scrollbar-width: thin;    /* Optional: thinner scrollbar in Firefox */
  padding: 1rem;
  padding-top: 0rem;
}



.correlation_checkboxes > form > div {
  display: flex;
  width: 100%;
  display: flex;
}


.correlation_checkboxes label {
  color: white !important;
  border-color: #666 !important;
  background-color: transparent !important;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: sans-serif;
  white-space: nowrap;      /* Prevent text wrapping inside labels */
  flex-shrink: 0;           /* Prevent label from shrinking */
}

.correlation_checkboxes input[type="checkbox"] {
  display: none; /* Hide the checkbox itself */
}

.correlation_checkboxes label:has(input:checked) {
  background-color: #c19a6b22 !important;
  border-color: #c19a6b !important;
}





.correlation_controls {
  padding: 1rem;
  background: rgba(70, 48, 30, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(193, 154, 107, 0.3);
  height: calc(100% - 3rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 2px;
  overflow-x: hidden;
  box-sizing: border-box;

  width: calc(100% - 1rem);       /* Make it expand to full width of its parent */
  max-width: none;   /* Remove previous max-width restriction */
  flex: 1;           /* Allow it to grow in a flex container */
}

.correlation_controls h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(193, 154, 107, 0.3);
}

/* Styling for axis labels with tooltips */
.plot .axis .tick text[title] {
  cursor: help;
  text-decoration: none;
  border-bottom: none;
}

.plot .axis .tick text[title]:hover {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
