/* ==========================================================================
   1. Global and Base Styles
   ========================================================================== */

button {
  cursor: pointer;
}


/* ==========================================================================
   3. Main Page Layout & Panels
   ========================================================================== */
.page-container {
  padding-top: 8vh;
}

.panel {
  min-height: 92vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.panel-inner {
  width: 90%;
  max-width: 1200px;
}

.top {
  background-image: url("../assets/scientist-page/search/imgs/geese.jpg");
  background-size: cover;
  background-position: center top;
}

.top h1 {
  font-size: 2.5rem;
  color: #002244;
  text-align: center;
  margin-bottom: 1rem;
}

.top h4 {
  font-weight: 400;
  font-size: 1.2rem;
  text-align: center;
}

.bottom {
  text-align: center;
  padding: 4vh 0;
}

/* ==========================================================================
   4. Query Form Styling (Bottom Panel)
   ========================================================================== */
.bottom h3 {
  text-align: left;
  margin-left: 10%;
  margin-bottom: 5px;
  color: #002244;
  font-size: 22px;
}

select {
  width: 80%;
  font-size: 18px;
  background-color: white;
  padding: 5px;
  border-radius: 50px;
  border: 1px solid #002244;
  margin: 10px 0;
}

.button-wrapper {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto 0 auto;
}

.button-wrapper button {
  padding: 10px 40px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 18px;
}

#reset {
  background-color: white;
  border: 1px solid #002244;
  color: #002244;
}

#submit {
  background-color: #002244;
  border: 1px solid #002244;
  color: white;
}

/* ==========================================================================
   5. Results Section
   ========================================================================== */
.associated-results {
  padding: 1rem;
}

.returns {
  width: 100%;
  height: calc(92vh - 2rem);
  position: relative;
}

.graph-container {
  width: 100%;
  height: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#graph-visualization {
  width: 100%;
  height: 100%;
}

.legend {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: #f7fbff00;
  padding: 10px;
  z-index: 5;
}

.legendColour {
  display: flex;
  height: 30px;
  border-radius: 10px;
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
  justify-content: center;
  align-items: center;
  padding: 0 15px;
  color: white;
}

.KGInstance {
  background-color: #aed6f1;
}

.Species {
  background-color: #4682aa;
}

.GCRC_Class {
  background-color: #AA336A;
}

.Resources {
  background-color: #FFC300;
}

.GenomicsMethod {
  background-color: #81bc93;
}

/* ==========================================================================
   6. D3 Graph & Info Panel (Unchanged, but robust)
   ========================================================================== */
.info-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  height: 90%;
  background-color: white;
  box-shadow: 3px 9px 10px rgba(0, 0, 0, 0.4);
  border-radius: 35px;
  transition: right 0.4s ease-in-out;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.info-panel.visible {
  right: 20px;
}

.info-panel-tabs {
  position: relative;
  display: flex;
  flex-shrink: 0;
}

.info-panel-tab {
  flex: 1;
  padding: 1rem;
  border: none;
  font-weight: 600;
  font-size: 12pt;
  cursor: pointer;
  border-top-left-radius: 35px;
  border-top-right-radius: 35px;
}

.close-btn {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #6c757d;
  background: none;
  border: none;
  z-index: 1003;
}

.close-btn:hover {
  color: #000;
}

.data-overview-tab.selected {
  background-color: #002244;
  color: white;
}

.data-overview-tab:not(.selected) {
  background-color: #aed6f1;
  color: #002244;
}

.linked-resources-tab.selected {
  background-color: #002244;
  color: white;
}

.linked-resources-tab:not(.selected) {
  background-color: #aed6f1;
  color: #002244;
}


.data-overview-tab {
  left: 0;
  background-color: #002244;
  color: white;
}

.linked-resources-tab {
  right: 0;
  background-color: #aed6f1;
  color: #002244;
}

.info-panel-tab.selected {
  z-index: 1002;
}

.info-panel-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0;
}

.info-panel-data {
  display: none;
}

.info-panel-data.selected {
  display: block;
}

.info-panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.overview-item {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.overview-item:nth-child(even) {
  background-color: #f8f9fa;
}

.overview-item h5 {
  margin: 0 8px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-item-header {
  margin: 0 0 8px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.overview-item-header h5 {
  margin: 0 10px 0 0;
  display: flex;
  align-items: baseline
}

.overview-item p {
  font-size: 12px;
  color: #6c757d;
  padding-left: 32px;
  word-wrap: break-word;
  word-break: break-word;
}

.species-badge {
  display: inline-flex;
  align-items: center;

  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
  vertical-align: middle;
}


.species-badge svg {
  height: 14px;
  width: auto;
  margin-right: 5px;
}

.badge-ebp {
  background-color: rgba(218, 165, 32, 0.4);
  border: 1.5px solid rgb(218, 165, 32);
  color: #fff;
}

.badge-ebp svg path {
  fill: rgb(218, 165, 32);
}

.badge-collected {
  background-color: rgba(46, 139, 87, 0.4);
  border: 1.5px solid rgb(46, 139, 87);
  color: #fff;
}

.badge-collected svg path {
  fill: rgb(46, 139, 87);
}

/* For the node click */

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.overview-item.highlighted {
  animation: pulse 1.5s;
}

.node-color-dot {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.info-panel-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  margin-left: 10%;
}

#info-content p {
  text-align: left;
  margin: 10px 0;
  font-size: 14px;
  color: black;
}

.resource-item {
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.resource-item h5 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.resource-item p {
  font-size: 12px;
  margin: 4px 0;
}

.resource-item a {
  color: #0056b3;
  text-decoration: none;
  word-break: break-all;
}

.resource-item a:hover {
  text-decoration: underline;
}

.goat-link-p {
  font-size: 12px;
  color: #333;
  padding-left: 34px;
  margin-top: 8px;
  font-style: italic;
}

.goat-link-p a {
  color: #0056b3;
  font-weight: 600;
  text-decoration: none;
  font-style: normal;
}

.goat-link-p a:hover {
  text-decoration: underline;
}

.graphical-translation-btn {
  display: inline-block;
  margin-top: 15px;
  margin-left: 34px;
  padding: 8px 16px;
  background-color: #002244;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.graphical-translation-btn:hover {
  background-color: #3473b2;
}


/* ==========================================================================
   7. State & Utility Classes
   ========================================================================== */
.is-hidden {
  display: none !important;
}

/* ==========================================================================
   8. Desktop Screen Overrides (min-width: 900px)
   ========================================================================== */
@media (min-width: 900px) {
  .top {
    padding: 30px 100px;
  }

  .top h1 {
    font-size: 4em;
  }

  .top h4 {
    font-size: 36px;
    padding-right: 100px;
  }
}