/* Explore page tweaks (cards + filters + HTMX loading) */

:root {
  --brand-blue: #2880c2;
  --brand-blue-dark: #1f6da6;
  --brand-green: #2f8f5b;
  --text-main: rgba(15, 23, 42, 0.92);
  --text-soft: rgba(15, 23, 42, 0.68);
  --panel-border: rgba(15, 23, 42, 0.10);
  --panel-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  --card-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

/* Filter panel */
.filter-panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--panel-shadow);
  font-size: 0.94rem;
}

@media (min-width: 992px) {
  .filter-panel {
    position: sticky !important;
    top: 92px;
    align-self: flex-start;
  }
}

.filter-panel h5 {
  font-size: 1.14rem;
  font-weight: 800;
  color: var(--text-main);
}

.filter-panel h5 i {
  color: var(--brand-blue);
}

.filter-panel .form-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.80);
}

.filter-panel .form-control,
.filter-panel .form-select {
  border-radius: 12px;
  font-size: 0.92rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.filter-panel .form-text {
  font-size: 0.80rem;
  color: var(--text-soft);
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.filter-actions .btn {
  border-radius: 12px;
  font-weight: 800;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  box-shadow: 0 12px 26px rgba(40, 128, 194, 0.22);
}

.filter-actions .btn:hover,
.filter-actions .btn:focus {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  color: #fff;
}

/* Results header */
.explore-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.explore-results-header__main h4 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
}

.explore-results-header__sep {
  color: rgba(15, 23, 42, 0.34);
  margin: 0 6px;
}

.explore-results-header__mode {
  color: var(--brand-green);
  font-weight: 800;
  font-size: 1.02rem;
}

.explore-results-header .muted {
  color: rgba(15, 23, 42, 0.60);
  font-weight: 600;
  font-size: 0.92rem;
}

.explore-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
}

.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(40, 128, 194, 0.14);
  background: rgba(40, 128, 194, 0.08);
  color: rgba(15, 23, 42, 0.76);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-chip i {
  color: var(--brand-blue);
}

.result-chip--soft {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 991.98px) {
  .explore-results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .explore-results-toolbar {
    justify-content: flex-start;
  }
}

/* Card layout */
.explore-card {
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.explore-card:hover {
  transform: translateY(-2px);
  border-color: rgba(40, 128, 194, 0.22);
  box-shadow: var(--card-shadow);
}

.explore-card__inner {
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: center;
}

.explore-card__media {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  align-self: center;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.explore-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: grayscale(100%);
  opacity: 0.88;
  transition: filter 180ms ease, opacity 180ms ease;
}

.explore-card:hover .explore-card__media img {
  filter: grayscale(0%);
  opacity: 1;
}

.explore-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.015));
}

.explore-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--brand-green);
  line-height: 1.24;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explore-card__inchikey {
  margin-top: 5px;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-metrics {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.035);
}

.metric-label {
  font-size: 0.79rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.66);
}

.metric-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

/* Pagination */
.explore-pagination {
  margin-top: 18px;
}

.pagination .page-link {
  border-radius: 12px;
}

/* Hide the old full-results indicator */
#exploreLoading {
  display: none !important;
}

/* Filter panel loading overlay */
.filter-panel-loading-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 18px;
  z-index: 20;
}

.filter-panel.is-explore-loading .filter-panel-loading-overlay {
  display: flex;
}

.filter-panel.is-explore-loading > h5,
.filter-panel.is-explore-loading > form {
  filter: blur(2.4px);
  pointer-events: none;
  user-select: none;
}

.filter-panel-loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(40, 128, 194, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}

.filter-panel-loading-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.filter-panel-loading-sub {
  margin-top: 2px;
  font-size: 0.80rem;
  color: rgba(15, 23, 42, 0.62);
}

/* Hexagon loading icon */
.filter-panel-loading-hex {
  position: relative;
  width: 28px;
  height: 30px;
  flex: 0 0 auto;
}

.filter-panel-loading-hex::before,
.filter-panel-loading-hex::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);
}

.filter-panel-loading-hex::before {
  background: rgba(40, 128, 194, 0.18);
  animation: hexPulseOuter 1.25s ease-in-out infinite;
}

.filter-panel-loading-hex::after {
  inset: 4px;
  background: var(--brand-blue);
  animation: hexPulseInner 1.25s ease-in-out infinite;
}

@keyframes hexPulseOuter {
  0%, 100% {
    transform: scale(0.92) rotate(0deg);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08) rotate(8deg);
    opacity: 1;
  }
}

@keyframes hexPulseInner {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* Search option chips / advanced checkbox */
.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(15, 23, 42, 0.78);
  transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.radio-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 128, 194, 0.45);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.90rem;
  color: rgba(15, 23, 42, 0.82);
  cursor: pointer;
  user-select: none;
}
















/* Update your :root variables for softer colors */
:root {
  --brand-blue: #2880c2;
  --brand-blue-dark: #1f6da6;
  --brand-green: #2f8f5b;
  --text-main: rgba(15, 23, 42, 0.92);
  --text-soft: rgba(15, 23, 42, 0.60); /* Lighter text for softer look */
  --panel-border: rgba(255, 255, 255, 0.6); /* Lighter border for glass effect */
  --panel-shadow: 0 12px 32px rgba(15, 23, 42, 0.04); /* Softer shadow */
  --card-shadow: 0 16px 36px rgba(40, 128, 194, 0.08); /* Smoother, tinted shadow */
}

/* Filter panel - Added glassmorphism and softer framing */
.filter-panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 24px; /* Better, rounder framing */
  background: rgba(255, 255, 255, 0.75); /* Lighter, semi-transparent background */
  backdrop-filter: blur(16px); /* Blur effect for the background */
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--panel-shadow);
  font-size: 0.94rem;
  padding: 1.5rem !important; /* Slightly more breathing room */
}

/* Card layout - Smoother transitions and lighter feel */
.explore-card {
  border-radius: 24px; /* Match filter panel framing */
  border: 1px solid rgba(255, 255, 255, 0.8); /* Soft white border */
  background: rgba(255, 255, 255, 0.75); /* Semi-transparent for glass effect */
  backdrop-filter: blur(12px); /* Blur effect behind cards */
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03); /* Extremely soft default shadow */
  
  /* Nicer and smoother transitions */
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.explore-card:hover {
  transform: translateY(-4px) scale(1.01); /* Smooth lift and slight scale */
  border-color: rgba(40, 128, 194, 0.3);
  box-shadow: var(--card-shadow);
  background: rgba(255, 255, 255, 0.95); /* Brighten up slightly on hover */
}

.explore-card__inner {
  display: flex;
  gap: 14px; /* Slightly more gap for cleaner look */
  padding: 16px; /* Better padding inside the card */
  align-items: center;
}

/* Make the image placeholder softer */
.explore-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(40, 128, 194, 0.05), rgba(40, 128, 194, 0.01));
}

/* Metric pills - softer background */
.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(40, 128, 194, 0.04); /* Hint of blue instead of dark gray */
  border: 1px solid rgba(40, 128, 194, 0.05);
}




/* --- Force 2x2 grid for search radio options on all screen sizes --- */
.search-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.search-options-grid .radio-chip {
  width: 100%;
  justify-content: center; /* Center the text inside each chip */
}


.explore-card__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  align-items: stretch; 
}

.explore-card__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.explore-card__info {
  flex: 1;
  min-width: 0;
}

.explore-metrics {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}


@media (max-width: 767.98px) {
  .explore-card__inchikey {
    display: none !important;
  }
}