/* Dashboard: full-width override for vf-body constraints */
.vf-body--full-width {
  max-width: none;
}

/* Global header with inline navigation */
.vf-global-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  max-width: 80em;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1em;
  padding-right: 1em;
}

.vf-global-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
}

.vf-global-header .vf-logo__text {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
}

.vf-global-header .vf-badge {
  font-size: 0.7rem;
}

.vf-global-header .vf-navigation--global {
  margin-left: auto;
}

.vf-global-header .vf-navigation__list {
  margin: 0;
  gap: 0.5rem;
}

.vf-global-header .vf-navigation__link {
  font-size: 1rem;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.vf-global-header .vf-navigation__link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.vf-global-header .vf-navigation__link[aria-current="page"] {
  font-weight: 600;
  background-color: rgba(0, 124, 130, 0.08);
}

/* Footer */
.vf-footer {
  color: white;
}

.vf-footer a {
  color: white;
  text-decoration: none;
}

.vf-footer a:hover {
  text-decoration: underline;
}

/* Tooltip */
.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip-container .tooltip-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  background-color: #007cbb;
  color: #fff;
  font-weight: bold;
  font-size: 10px;
  cursor: pointer;
  vertical-align: super;
  margin-left: 5px;
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip-container .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Layout */
.page-container {
  display: flex;
  gap: 20px;
}

.search-sidebar {
  flex: 0 0 30%;
  max-width: 300px;
  background-color: #fff;
  padding: 20px;
  box-sizing: border-box;
}

.content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vf-summary-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #f7f7f7;
  padding: 20px;
}

.vf-section-header {
  margin-bottom: 20px;
}

.results-container {
  flex: 1;
  background-color: #fff;
  padding: 20px;
  overflow-y: auto;
}

/* Explore table */
#explore-table .vf-table {
  width: 100%;
  table-layout: fixed;
}

#explore-table .vf-table__header th,
#explore-table .vf-table__cell {
  padding: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  border: 1px solid #ddd;
  font-size: 14px;
}

#explore-table .vf-table__header th {
  background-color: #f7f7f7;
  font-weight: bold;
}

#explore-table .vf-table__cell a {
  text-decoration: none;
}

#explore-table .vf-table__cell a:hover {
  text-decoration: underline;
}

#explore-table .vf-table__row:nth-child(even) {
  background-color: #f9f9f9;
}

#explore-table .vf-table__header th:nth-child(1),
#explore-table .vf-table__cell:nth-child(1) { width: 20%; }

#explore-table .vf-table__header th:nth-child(2),
#explore-table .vf-table__cell:nth-child(2) { width: 12.5%; }

#explore-table .vf-table__header th:nth-child(3),
#explore-table .vf-table__cell:nth-child(3) { width: 20%; }

#explore-table .vf-table__header th:nth-child(4),
#explore-table .vf-table__cell:nth-child(4) { width: 9%; }

#explore-table .vf-table__header th:nth-child(5),
#explore-table .vf-table__cell:nth-child(5) { width: 9%; }

#explore-table .vf-table__header th:nth-child(6),
#explore-table .vf-table__cell:nth-child(6) { width: 15%; }

#explore-table .vf-table__header th:nth-child(7),
#explore-table .vf-table__cell:nth-child(7) { width: 15%; }

#explore-table .vf-table__header th:nth-child(8),
#explore-table .vf-table__cell:nth-child(8) { width: 10%; }

/* Pagination buttons */
#pag_button_as {
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1.8;
}

#pag_button_p {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

#pag_button_s {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1.4;
}

/* VF summary overrides */
.vf-summary {
  font-size: 0.875rem;
  padding: 0.1rem;
  margin: 0.1rem 0;
}

.vf-summary__title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.vf-summary__text {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* Spinner */
@keyframes spinnerOne {
  0%, 35% { opacity: 1; transform: scale(1); }
  20%, 50% { opacity: 0.5; transform: scale(1.3); }
}

.bgcs-portal-spinner {
  animation: spinnerOne 1s linear infinite;
  background: #18974c;
  border-radius: 100%;
  width: 3em;
  height: 3em;
  opacity: 1;
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* Aggregated region */
#aggregated-region .predictor-class-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.predictor-class-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* Protein sequence */
.protein-sequence-container {
  word-wrap: break-word;
  overflow-y: scroll;
  height: 10em;
  padding: 10px;
  background-color: #e1fae8;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 2px;
}

.sequenceViewerDiv {
  overflow: auto !important;
}

/* Download form */
.download-form {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  max-width: 33%;
  margin-left: auto;
}

#aggregated-region .vf-form__item--inline.stacked-item {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
  flex: 1;
}

#aggregated-region .vf-form__label {
  margin-bottom: 5px;
  font-size: 0.875rem;
}

#aggregated-region .wider-select {
  width: 100%;
  min-width: 150px;
  padding: 5px 10px;
  height: 42px;
  line-height: 1.5;
}

#aggregated-region .vf-button--compact {
  padding: 5px 15px;
  font-size: 0.875rem;
  height: 38px;
  line-height: 1;
}

/* CDS info fade */
#cds-info {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#cds-info.show {
  opacity: 1;
}

/* Material icons alignment */
.material-icons {
  vertical-align: middle;
  font-size: 20px;
  line-height: 1;
}

/* Compound results */
#vf-tabs__section--compounds .compound-results-grid {
  grid-template-columns: 1fr !important;
}

/* Results table */
.results-article {
  width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;
}

.compound-results-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  grid-gap: 1rem;
}

.compound-flex {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.card-image {
  flex: 1;
  max-width: 33%;
}

.card-content-flex {
  flex: 2;
}

.pagination-center {
  text-align: center;
  margin-top: 1rem;
}

#bgc-scatter {
  width: 100%;
  height: 600px;
}

/* Search page */
#results_summary {
  background-color: #ffffff;
}

.results-card {
  width: 100%;
  box-sizing: border-box;
}

.vf-tabs-content.padded {
  padding: 16px;
}

.vf-form.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid-gap-20 {
  gap: 20px;
}

.field-error {
  margin-top: 4px;
}

.fixed-120 {
  width: 120px;
}

.align-right {
  text-align: right;
}

.mt-auto {
  margin-top: auto;
}

.grid-col-span-2 {
  grid-column: 1 / span 2;
}

#jsme_container {
  border: 1px solid #ddd;
  width: 420px;
  height: 300px;
}

.search-sidebar .vf-card {
  margin-bottom: 30px;
}

/* Analyze sequence */
.analyze-form {
  margin-bottom: 1.5em;
}

.error-box {
  padding: 1em;
  border: 1px solid #F44336;
  background: #ffebee;
}

/* BGC page */
.context-margin-3rem {
  --context-margin--inline: 3rem;
}

/* Results page */
.results-sidebar-card {
  margin-bottom: 30px;
}

.spinner-wrapper {
  text-align: center;
  padding: 40px;
}

.status-message {
  margin: 0 auto;
  display: inline-block;
}

.spinner-box {
  margin: 20px auto;
  width: 50px;
  height: 50px;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.spinner-box::after {
  content: "";
  display: block;
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top-color: #1f70c1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-size-50 {
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top-color: #1f70c1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.centered-loader {
  margin: 0 auto;
}
