/* Basic styles for grid */
.grid-container {
  padding: 5rem;
  display: grid;
  grid-template-columns: repeat(12, 70px); /* 12 columns, each with a fixed width of 70px */
  gap: 0.5px; /* Slightly reduced gap for a more compact look */
  width: 90vw; /* Make the grid container take 90% of the viewport width */
  max-width: 1200px; /* Max width set to 1200px */
  margin: 20px auto;
  grid-template-rows: repeat(8, 70px); /* Fixed row height */
  justify-content: center; /* Center the grid in the container */
  box-sizing: border-box;
  background-color: sil;
}

body {
  background-color: #f9f9f9; /* Light neutral background for balance and focus on content */
  font-family: 'Montserrat', sans-serif; /* Clean, modern sans-serif font for body text */
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

h1 {
  text-align: center;
  font-family: 'Merriweather', serif; /* Elegant, professional serif font */
  font-size: 60px; /* Slightly larger font size for impact */
  font-weight: 700; /* Bold weight for emphasis */
  color: #000000; /* Dark, muted color for a serious and grounded tone */
  letter-spacing: 2px; /* Increased letter spacing for better legibility and elegance */
  margin: 60px 0; /* More spacious margin for breathing room around the heading */
  line-height: 1.3; /* Adjusted line height for better vertical spacing */
 /* border-bottom: 4px solid #2C3E50; /* Adds a bold underline for a more polished look */
  padding-bottom: 15px; /* Adds a bit more space between the text and the underline */
  position: relative; /* Set up for decorative effect */
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1); /* Soft text shadow for subtle emphasis */
  transition: all 0.3s ease; /* Smooth transition for hover effect */
}


/* Set modern font family */
.grid-item {
  font-family: 'Montserrat', sans-serif; /* Applying the Montserrat font */
}

/* Fixed size for grid items with no stretching or resizing */
.grid-item {
  width: 70px; /* Fixed width for each grid item */
  height: 70px; /* Fixed height for each grid item */
  background-color: lightgrey;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  font-size: 9px; /* Reduced font size for better compactness */
  
  font-weight: 500; /* Slightly bolder font weight for better readability */
  border-radius: 4px; /* Slightly round the corners */
  text-align: center; /* Ensure abbreviation is centered */
  box-sizing: border-box; /* Prevent padding from affecting size */
  flex-shrink: 0; /* Prevent the item from shrinking */
  flex-grow: 0; /* Prevent the item from growing */
}

/* Tooltip style */
.tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px; /* Slightly reduced padding for a smaller tooltip */
  border-radius: 4px;
  font-size: 11px; /* Slightly smaller tooltip font size */
  z-index: 10; /* Make sure the tooltip is above other content */
  white-space: nowrap; /* Prevent the text from wrapping */
  pointer-events: none; /* Prevent the tooltip from interfering with mouse events */
}

/* Optional: Add a slight animation for the tooltip */
.tooltip {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Modal Styles */
.state-info-modal {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure modal is on top */
  transition: opacity 0.3s ease; /* Smooth fade-in transition */
}

/* Modal Content */
.popup-content {
  display: flex;
  justify-content: left;
  background-color: white;
  padding: 20px; /* Reduced padding for smaller popup */
  border-radius: 8px; /* Softer rounded corners */
  width: 350px; /* Smaller width for compact popup */
  max-width: 90%; /* Ensure responsiveness */
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Deeper shadow for depth */
  transform: scale(0.9); /* Start slightly smaller for a zoom-in effect */
  transition: transform 0.3s ease-in-out; /* Smooth zoom-in animation */
}

.popup-content.show {
  transform: scale(1); /* When modal is shown, it zooms in */
}

/* Title */
#state-title {
  font-size: 18px; /* Smaller title */
  font-weight: 600; /* Bold title */
  color: #2C3E50; /* Darker title for better contrast */
  margin-bottom: 10px;
  text-transform: uppercase; /* Capitalized for emphasis */
  letter-spacing: 1px; /* Slight letter spacing for a more refined look */
}

/* State Details */
#state-details {
  font-size: 14px; /* Smaller font size */
  color: #666; /* Soft grey text for better readability */
  line-height: 1.4; /* Reduced line height */
  margin-top: 5px;
  justify-self: start;
  font-family: 'Helvetica Neue', sans-serif; /* Modern font */
}

/* Close Button */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px; /* Smaller close button */
  font-weight: bold;
  color: #E74C3C; /* Red color for the close button */
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #C0392B; /* Darker red on hover */
}

/* Paragraph Styling */
p {
  background-color: #f7f7f7; /* Lighter background for contrast */
  color: #333;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; /* Smaller font size for compact text */
  line-height: 1.4; /* Reduced line height */
  font-weight: 400;
  padding: 15px; /* Reduced padding */
  margin: 15px 0; /* Reduced margin */
  border-radius: 8px;
  text-align: left; /* Left-align text for better readability */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover transition */
}

p:hover {
  transform: translateY(-3px); /* Lift effect */
  box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.2); /* More pronounced shadow on hover */
}

/* Media Query for Small Screens */
@media screen and (max-width: 768px) {
  .popup-content {
    width: 90%; /* Responsive width */
    padding: 15px; /* Less padding for small screens */
  }

  #state-title {
    font-size: 16px; /* Smaller title for small screens */
  }

  p {
    font-size: 12px; /* Smaller text for mobile */
    padding: 10px; /* Reduced padding for mobile */
  }
}

/* State details container styling */
.state-details-container {
  display: flex;
  flex-direction: column;
  align-items: left;
  padding: 20px; /* Smaller padding */
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-width: 280px; /* Smaller container */
  color: #333;
  transition: transform 0.3s ease-in-out;
  margin-right: 15px;
  margin-left: 5px;
}

.state-details-container.show {
  transform: scale(1); /* Zoom-in effect when shown */
}

.state-details-container h3 {
  margin-top: 0;
  font-size: 18px; /* Smaller title for details */
  color: #000000; /* Blue color for title */
  font-weight: 600;
}

.state-details-container p {
  margin: 5px 0; /* Reduced margin */
  font-size: 12px; /* Smaller font size for details */
  line-height: 1.4; /* Reduced line height */
}

/* Optional: Add spacing between elements */
.state-details-container p strong {
  font-weight: 600;
  color: #30363b; /* Darker color for labels */
}

/* Animation for Modal */
@keyframes modal-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Image Container Styling */
.image-container {
  margin-bottom: 30px;
  display: flex;
  justify-content: center; /* Centers the image horizontally */
  align-items: center;
  padding: 20px;
  background-color: #fff; /* White background for the image section */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
  border-radius: 8px;
  max-width: 80%; /* Restrict max width to 80% of the screen */
  margin-left: auto;
  margin-right: auto;
}

img {
  width: 100%; /* Make the image responsive */
  max-width: 700px; /* Maximum width limit for large images */
  height: auto;
  border-radius: 8px; /* Rounded corners for the image */
  transition: transform 0.3s ease; /* Smooth transition on hover */
}

img:hover {
  transform: scale(1.05); /* Slight zoom effect on hover */
}

/* Button Styles */
.buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

button {
  padding: 12px 25px;
  font-size: 18px;
  font-weight: 500;
  background-color: #646b73; /* A cool blue color */
  color: #fff;
  border: none;
  border-radius: 25px; /* Rounded button corners */
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
  margin-bottom: 5rem;
}

button:hover {
  background-color: #393d42; /* Darker blue on hover */
  transform: translateY(-2px); /* Button lift effect */
}

button:active {
  transform: translateY(2px); /* Button press effect */
  background-color: #1b1d1f; /* Even darker blue for pressed state */
}

button:focus {
  outline: none; /* Removes default focus outline */
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5); /* Adds a blue focus outline */
}

/* Legend Container */
.legend-container {
  margin: 20px auto;
  text-align: center;
  max-width: 400px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: #333;
}

.legend-container h3 {
  margin-bottom: 10px;
  font-weight: 600;
}

/* Legend Bar */
.legend-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 20px;
  background: linear-gradient(to right, #FEF5F0, #F9D4C2, #F8CCB7, #F6BCA3, #F5AC91, 
  #F3987A, #F17E5E, #F07657, #EE5D42, #EB3D33, #D7322D, #C02B27, #8F1E1A, #681310); /* Gradient */
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Legend Labels */
.legend-labels {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: 25px;
}

.legend-labels span {
  font-size: 12px;
  font-weight: 500;
}

.no-data {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.no-data .swatch {
  width: 20px;
  height: 20px;
  background-color: #D3D3D3; /* No Data color */
  border-radius: 4px;
  margin-right: 10px;
}

.no-data span {
  font-size: 12px;
  font-weight: 500;
}
