/* ==========================================================================
   1. Base & Global Styles
   ========================================================================== */
* {
  font-family: Montserrat, sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
p,
ul {
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   2. Main Page Layout (Mobile First)
   ========================================================================== */

/* This structure forces the page to fit the viewport height */
.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 8vh 1rem 2rem 1rem;
  /* Adjust top padding for navbar */
  overflow: hidden;
  /* Prevent any minor overflow from causing scroll */
}

.suggestions-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* Allows this container to fill available vertical space */
  min-height: 0;
  /* A flexbox fix for nested flex containers */
}

.suggestions-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: #002244;
  flex-shrink: 0;
  /* Prevents the title from being squished */
}

/* Restored Search Bar Styling */
.search-container {
  margin: 0 0 2rem 0;
  max-width: 500px;
  width: 100%;
  flex-shrink: 0;
  position: relative;
}

#searchBox {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #ccc;
  border-radius: 50px;
  font-size: 1rem;
}

.suggestions {
  flex: 15;
}

.suggestions-grid-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90%;
}

.suggestion-navigation {
  flex: 1;
  margin: 2rem;
}

.block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 2rem 0 2rem;
}

.grid-item {
  position: relative;
  border: 1px solid #ddd;
  border-radius: 20px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.grid-item img {
  width: 100%;
  flex-grow: 1;
  /* Allows image to fill the vertical space in a grid cell */
  object-fit: cover;
  min-height: 0;
  /* Flexbox fix for images */
}

.tag {
  background-color: white;
  padding: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================================================
   3. Modal Styles (Mobile First)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  /* background: white; */
  background-image: 
    /* Layer 1: The transparent gradient (on top) */
    url('../assets/community-partner-page/search/notebook-bindings.png'),
    linear-gradient(
      to left,
      transparent 0px,
      transparent 15px,
      rgb(255, 255, 255) 15%,
      rgb(255, 255, 255) 100%
    );
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 2rem;
  width: 95%;
  height: 95%;
  max-width: 1400px;
  position: relative;
  display: flex;
  flex-direction: column;
  /* padding: 20px; */
  gap: 1rem;
  /* overflow: hidden; */
  border: solid black 2px;
  border-right: none;
}

.modal-close-btn {
  position: absolute;
  top: -1rem;
  right: -1rem;
  background: white;
  border: solid #002244 2px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 600;
  cursor: pointer;
  color: #002244;
  z-index: 1001;
  height: 2.5rem;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notebook-content {
  display: flex;
  gap: 80pt;
  flex-direction: row;
  justify-content: space-between;
  height: 100%;
}

.notebook-page {
  width: 100%;
  height: 100%;
}

#left-page-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: white;
}

#notebook-left-page {
  /* background-color: pink; */
  padding: 1.5rem;
}

#left-page-title {
  margin-bottom: 1.5rem;
}

.left-page-box {
  margin: 1rem 0 1rem 0;
}

.genomics-links-container {
  padding: 1.5rem;
  box-shadow: 0 0 8px #33333349;
  border-radius: 20pt;
}

.genomics-links-container h2 {
  margin-bottom: 1rem;
}

.genomics-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}

.genomics-links a {
  text-decoration: none;
  display: flex;
  flex: 1;
}

.genomics-links-buttons {
  cursor: pointer;
  border: 2px #002244 solid;
  border-radius: 20pt;
  background-color: #aed6f1;
  color: #002244;
  padding: 1rem;
  flex: 1;
}

.relavent-resources {
  box-shadow: 0 0 8px #33333349;
  border-radius: 20pt;
  padding: 1.5rem;
  min-height: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.relavent-resources h2 {
  margin-bottom: 1.5rem;
}

.relavent-resources-grid {
  display: flex;
  height: 100%;
  gap: 0px;

  justify-content: center;
  align-items: center;
}

.resource-grid-arrow {
  flex: 1;
  text-align: center;
}

.relavent-resources-content {
  height: 100%;
  flex: 8;
  display: flex;
}

.resource-block .resource {
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: start;
  align-items: center;
  cursor: pointer;
}

.resource img {
  min-height: 0;
  height: 50%;
}

.resource-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.resource-display {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.resource-display img {
  width: 100%;
}

#img-overlay {
  display: flex;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.7);
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  z-index: 1000000;
  padding: 3rem;
}

#img-overlay img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 90vh;
}

#notebook-right-page {
  display: flex;
  flex-direction: row;
}

#right-page-sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 15%;
  height: 100%;
  justify-content: space-evenly;
  align-items: center;
  text-align: center;
  max-width: 15%;
}
.notebook-tab {
  flex-grow: 1;
  align-content: center;
  border-bottom-right-radius: 2rem;
  border-top-right-radius: 2rem;
  width: 100%;
  height: 16.66%;
  box-shadow: 0 4px 8px #33333349;
  border-top: solid black 2px;
  border-bottom: solid black 2px;
  border-right: solid black 2px;
  cursor: pointer;
}

.resource-info h4 {
  position: relative;
  border-radius: 2rem;
  background-color: #aed6f1e3;
  z-index: 6;
  padding: 1rem;
}

.resource-info {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: #002244;
  cursor: pointer;
}

.resource-info-results {
  position: relative;
  background-color: #d2ecf4;
  margin-top: -2rem;
  padding: 3rem 1rem 1rem 1rem;
  z-index: 1;
  border-bottom-left-radius: 2rem;
  border-bottom-right-radius: 2rem;
  display: none;
  flex-wrap: wrap;
  justify-content: left;
  align-items: center;
  gap: 1rem;
}
.resource-info-results p {
  /* flex-grow: 1; */
  flex: 0 0 calc(20% - 1rem);
}

.resource-info-container {
  display: none;
  flex-direction: column;
  gap: 1rem;
  overflow-y: scroll;
}

.notebook-tab h3 {
  font-size: 1rem;
  margin: 0.5rem;
}

#photos-tab {
  background-color: #aed6f1;
  border-top: none;
}

#paradise-tab {
  background-color: #86c2ea;
}

#wildlife-tab {
  background-color: #5dade2;
}

#who-tab {
  background-color: #4b9ed5;
}

#how-tab {
  background-color: #2f5771;
  color: white;
}
#where-tab {
  background-color: #103050;
  color: white;
  border-bottom: none;
}

#right-page-content {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  background-color: white;
  z-index: 1;
  padding: 1.5rem;
  min-width: 0;
  overflow-x: hidden;
}

#notebook-right-page-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.photos-content {
  column-count: 3;
  column-gap: 10px;
  width: 90%;
  height: 100%;
  overflow-y: auto;
}

.notebook-right-page-content {
  height: 100%;
}

.notebook-right-page-content iframe {
  height: 100%;
  width: 100%;
}

.associate-display {
  border-radius: 2rem;
  box-shadow: 0 0 8px #33333349;
  position: relative;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  /* padding: 1.5rem; */
}

.associate-display-header {
  display: flex;
  height: 15%;
  /* border-bottom: solid 2px rgba(0, 0, 0); */
  justify-content: center;
  align-items: center;
  background-color: #aed6f1;
  color: black;
}

.associate-display-header-text {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  text-align: center;
}

.associate-display-header-img {
  width: auto;
  height: 100%;
}

.associate-display-header-img img {
  object-fit: contain;
  max-height: 100%;
}
.associate-display-header h2 {
  text-align: center;
  flex-grow: 1;
  color: black;
}

.associate-display-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  overflow-y: scroll;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4px minmax(0, 1fr);
  align-items: stretch;
}

.item-left {
  grid-column: 1;
  text-align: right;
  position: relative;
  direction: rtl;
}

.item-left::after {
  content: '';
  position: absolute;
  right: 0px; /* Reach over the gap to touch the spine */
  top: 50%;
  width: 10px;
  height: 3px;
  background: black; /* Your simple line art color */
}

.item-right {
  grid-column: 3; /* Sit in the right column */
  text-align: left; /* Align text towards the spine */
  position: relative;
}

.spine {
  grid-column: 2;
  background-color: black;
  width: 100%;
  min-height: 100%;
}

.item-right::after {
  content: '';
  position: absolute;
  left: 0px; /* Reach over the gap to touch the spine */
  top: 50%;
  width: 10px;
  height: 3px;
  background: black; /* Your simple line art color */
}

.associate-branch {
  padding: 1rem;
  cursor: pointer;
  overflow-wrap: normal;
}

.associate-branch span {
  font-size: 8pt;
}

.empty::after {
  display: none;
}

.organism-image {
  break-inside: avoid;
  margin-bottom: 10px;
  width: 100%;
}

.organism-image img {
  border-radius: 2rem;
  max-width: 100%;
  display: block;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   4. Common Component Styles (Badges, Documents, etc.)
   ========================================================================== */
.document-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  color: #333;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.document-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.document-item h5 {
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.documents-grid p {
  grid-column: 1 / -1;
  color: #6c757d;
}

.pdf-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.grid-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 22px;
  align-items: center;
  color: white;
  padding: 0 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: bold;
  z-index: 6;
}

.grid-badge img {
  height: 16px;
  width: auto;
  margin-right: 5px;
}

.grid-badge.badge-ebp {
  background-color: rgba(255, 215, 0, 0.4);
  border: 1.5px solid rgb(255, 215, 0);
  color: #fff;
}

.grid-badge.badge-ebp svg path {
  fill: rgb(255, 215, 0);
}

.grid-badge.badge-collected {
  background-color: rgba(0, 51, 255, 0.4);
  border: 1.5px solid rgb(0, 51, 255);
  color: #fff;
}

.grid-badge.badge-collected svg path {
  fill: rgb(0, 51, 255);
}

.modal-badge {
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7em;
  font-weight: bold;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 10px;
}

#ebp-badge {
  background-color: #3a8e3d;
}

#collected-badge {
  background-color: rgb(0, 51, 255);
}

/* ==========================================================================
   5. Desktop Overrides (min-width: 900px)
   ========================================================================== */
@media (min-width: 900px) {
  .suggestions-container h2 {
    font-size: 2.5rem;
  }

  /* Force grid to fit vertically without scrolling on desktop */
  .suggestions {
    display: flex;
    min-height: 0;
    max-height: 90%;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
  }

  .block {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .documents-grid {
    overflow-y: auto;
    /* The resource list can scroll if it's too long */
    flex-grow: 1;
  }

  .modal-header-row h2 {
    font-size: 2rem;
  }
}
