#dynamic-filters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-bottom: 1em;
    flex: 100%;
    gap: 15px;
}

#dynamic-filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#edit-add-filter {
    margin: 0;
}

#views-exposed-form-datasets-page-1 fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

#views-exposed-form-datasets-page-1 fieldset .fieldset__wrapper{
    border: none;
    margin: 0;
    padding: 0;
}



#views-exposed-form-datasets-page-1 .views-exposed-form__item.views-exposed-form__item {
    margin: 0;
    margin-right: 12px;
    margin-bottom: 12px;
}

.form-item--field-sampling-method-value select {
    max-width: fit-content !important;
}

#views-exposed-form-datasets-page-1 .views-exposed-form__item.views-exposed-form__item .fieldset__label {
    padding: 0;
}

.dynamic-filter {
    display: flex;
    gap: 15px;
}

.dynamic-field-hide, .form-item:has(> .dynamic-field-hide) {
    display: none;
}

.dataset-search-view .views-content {
    padding: 18px;
    padding-bottom: 240px;
}

/* Image slideshow styles */
.webform-image-file.image-style-medium {
    max-width: 220px;
    height: auto;
    display: block;
}

/* User logged-in header styles */
.user-logged-in-header .view-content {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.block-views-blockuser-logged-in-header-block-1 {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-logged-in-header .views-field-name {
	font-weight: bold;
	font-size: 24px;
}

.user-logged-in-header .header-user-fields {
	display: flex;
	gap: 10px;
  	font-weight: 300;
}

#dynamic-filters-webform {
    min-width: 100%;
}

/* Scoped button icons for dynamic filters (webform) */
.add-dynamic-filter-webform.form-submit.btn::before {
    display: inline-block;
    content: "";
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"/></svg>');
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    background-position: 0 0.1rem;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.35rem;
    pointer-events: none;
}

/* remove icon rendered via Material Symbols in markup */
#dynamic-filters-webform-container {
  min-width: 100%;
  padding: 10px;
  background: lightgray;
  border-radius: 12px;
  margin-bottom: 0 !important;
}

.dynamic-filter-webform {
    display: flex;
  gap: 10px;
  padding: 10px;
    padding-left: 10px;
  padding-left: 0;
  margin-bottom: 0px !important;
}

#dynamic-filters-webform-container.mb-3, #dynamic-filters-webform-container .mb-3 {
    margin-bottom: 0 !important;
}

.block-field-blockuseruserfield-publisher-name {
    display: none;
}

.search-view-webform .view-filters {
  padding: 14px;
  background: #eee;
  border-radius: 12px;
}

.search-view-webform .view-filters .mb-3 {
  margin-bottom: 0 !important;
}

.dataset-search-view .views-row-single-line {
  display: flex;
  gap: 10px;
  align-items: end;
}

.dataset-search-view .views-row-single-line {
  display: flex;
  gap: 10px;
  align-items: end;
}

.dataset-search-view .views-row-separators > .views-field:not(:last-child)::after {
  content: " | ";
  margin: 0 0.5em;
  color: #999;
}

.dataset-search-view .views-search-main-title {
  font-size: 1.5rem;
  font-weight: bold;
}

.dataset-search-view .views-search-small-link {
  font-size: 0.875rem;
  color: #007bff;
  text-decoration: none;
  margin-left: auto;
}

/* Prevent image column from causing layout shifts */
.dataset-search-view .views-field-webform-submission-value-13 {
  float: left;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

/* Create a wrapper for all content fields to prevent wrapping around float */
.dataset-search-view .views-row > *:not(.views-field-webform-submission-value-13) {
  margin-left: calc(90px + 1rem);
}

/* Clear float after each row to prevent stacking issues */
.dataset-search-view .views-row {
  clear: both;
}

.animated-slidez {
  width: 90px;
  overflow: hidden;
  position: relative;
}

.animated-slidez .item-list {
  margin: 0;
}

.animated-slidez .list-group {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-direction: row;
}

/* Only animate if more than one image */
.animated-slidez .list-group:has(.list-group-item:nth-child(2)) {
  animation: slideshow 5s steps(1) infinite;
}

.animated-slidez .list-group-item {
  flex-shrink: 0;
  width: 90px;
  padding: 0;
  border: none;
  background: transparent;
}

.animated-slidez img {
  width: 90px;
  height: auto;
  max-width: 90px;
  display: block;
}

.animated-slidez .no-images-attached {
  width: 90px;
  height: 120px;
  background-color: #e0e0e0;
  border-radius: 8px;
}

@keyframes slideshow {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-90px);
  }
}

/* Adjust for 3+ images */
.animated-slidez .list-group:has(.list-group-item:nth-child(3)) {
  animation: slideshow3 15s steps(1) infinite;
}

@keyframes slideshow3 {
  0%, 33.33% {
    transform: translateX(0);
  }
  33.34%, 66.66% {
    transform: translateX(-90px);
  }
  66.67%, 100% {
    transform: translateX(-180px);
  }
}

/* Adjust for 4+ images */
.animated-slidez .list-group:has(.list-group-item:nth-child(4)) {
  animation: slideshow4 20s steps(1) infinite;
}

@keyframes slideshow4 {
  0%, 25% {
    transform: translateX(0);
  }
  25.01%, 50% {
    transform: translateX(-90px);
  }
  50.01%, 75% {
    transform: translateX(-180px);
  }
  75.01%, 100% {
    transform: translateX(-270px);
  }
}

/* Pause animation on hover */
.animated-slidez:hover .list-group {
  animation-play-state: paused;
}

.animated-slidez img {
  border-radius: 8px;
}

/* Tab styling for search results */
.views-search-tab-group {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 1rem;
}

.views-search-tab {
  flex: 0 0 auto;
}

.views-search-tab summary {
  padding: 0.75rem 1.5rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  cursor: pointer;
  font-weight: 500;
  color: #495057;
  border-radius: 0.25rem 0.25rem 0 0;
  margin-right: 0.25rem;
  transition: background-color 0.2s, color 0.2s;
}

.views-search-tab summary:hover {
  background-color: #e9ecef;
}

.views-search-tab details[open] summary {
  background-color: #fff;
  color: #007bff;
  border-bottom: 2px solid #fff;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.views-search-tab .details-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  padding: 1rem;
  margin-top: -1px;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 100vw;
  overflow-x: auto;
}

/* Last tab: align to the right edge to prevent overflow */
.views-search-tab:last-child .details-wrapper {
  left: auto;
  right: 0;
  max-width: calc(100vw - 2rem);
}

.details-wrapper label {
  font-weight: 400;
  font-size: 0.775rem;
  color: #6c757d;
  display: block;
  margin-bottom: 0.25rem;
}

.details-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.details-wrapper .webform-element {
  flex: 0 0 calc(25% - 0.75rem);
  font-size: 1.0rem;
}

/* Desktop: 4 columns */
@media (min-width: 768px) {
  .details-wrapper .webform-element {
    flex: 0 0 calc(25% - 0.75rem);
  }
  
  .details-wrapper .webform-section-wrapper .webform-element,
  .details-wrapper .fieldset-wrapper .webform-element {
    flex: 0 0 calc(25% - 0.75rem);
  }
}

/* Make fieldsets and sections full width to force new line */
.details-wrapper fieldset.webform-container,
.details-wrapper section.webform-section {
  flex: 0 0 100%;
}

/* Inner wrapper also uses flex layout */
.details-wrapper .webform-section-wrapper,
.details-wrapper .fieldset-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Elements inside sections also follow responsive layout */
.details-wrapper .webform-section-wrapper .webform-element,
.details-wrapper .fieldset-wrapper .webform-element {
  flex: 0 0 calc(25% - 0.75rem);
}
