/* ==========================================================================
   Gallery Section, Search Box & Wave Filters
   ========================================================================== */

.gallery-section {
  width: 100%;
}

/* Sticky Sentinel for Dynamic Stuck Transition */
.gallery-sticky-sentinel {
  height: 1px;
  margin-bottom: -1px;
  pointer-events: none;
  visibility: hidden;
}

/* Sticky Gallery Command Center (Title + Search + Filter Controls) */
.gallery-sticky-header {
  position: sticky;
  top: var(--docked-header-height, 94px);
  z-index: 50;
  margin-bottom: 2rem;
  width: calc(100% + 56px);
  max-width: calc(100% + 56px);
  margin-left: -28px;
  margin-right: -28px;
  padding: 1.15rem 1.6rem 1.05rem;
  background: rgba(10, 13, 17, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  transition: 
    padding var(--transition-fast), 
    background var(--transition-fast), 
    border-color var(--transition-fast), 
    box-shadow var(--transition-fast);
}

.gallery-header-row {
  margin-bottom: 1.1rem;
  transition: margin var(--transition-fast);
}

.gallery-title-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.gallery-title-lockup .section-title {
  margin-top: 0;
  font-size: 1.65rem;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.2;
  transition: font-size var(--transition-fast);
}

.gallery-sticky-header .section-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 400;
  margin-top: 0.35rem;
  max-height: 50px;
  opacity: 1;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Filter & Search Bar inside Unified Sticky Container */
.gallery-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Active Sticky (Stuck) State while scrolling through video grid */
.gallery-sticky-header.is-stuck {
  padding: 0.75rem 1.5rem 0.65rem;
  background: rgba(7, 9, 12, 0.95);
  border-color: rgba(49, 134, 255, 0.32);
  box-shadow: 
    0 16px 42px -8px rgba(0, 0, 0, 0.95),
    0 0 24px -4px rgba(49, 134, 255, 0.16);
}

.gallery-sticky-header.is-stuck .gallery-header-row {
  margin-bottom: 0.55rem;
}

.gallery-sticky-header.is-stuck .gallery-title-lockup .section-title {
  font-size: 1.38rem;
}

.gallery-sticky-header.is-stuck .section-desc {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

/* Search Box (Inner Window: #292c34) */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.2rem;
  min-width: 260px;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 16px rgba(49, 134, 255, 0.3);
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-surface-inner);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-subtle);
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Active Selection: Full Continuous Perimeter Gradient Outline */
.filter-pill.active {
  background: 
    linear-gradient(#0c0f13, #0c0f13) padding-box, 
    linear-gradient(90deg, #3186ff 0%, #0ebc5f 33%, #ffcc00 66%, #ff4641 100%) border-box;
  border: 1.5px solid transparent;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 
    0 4px 20px -2px rgba(0, 0, 0, 0.8),
    -3px 0 16px -2px rgba(49, 134, 255, 0.4),
    3px 0 16px -2px rgba(255, 70, 65, 0.3);
}

/* Active Sentiment Filter Pill: Solid Blue Gradient #3387ff to #a9a8ff with White Text */
.filter-pill[data-category="Sentiment"].active,
.filter-pill[data-wave="Sentiment"].active,
.filter-pill[data-wave="Wave 1"].active {
  background: var(--grad-sentiment, linear-gradient(90deg, #3387ff 0%, #a9a8ff 100%)) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 14px rgba(51, 135, 255, 0.5) !important;
}

/* Active Teach-back Filter Pill: Solid Green to Light Blue Gradient #0ebc5f to #78c9ff with White Text */
.filter-pill[data-category="Teach-back"].active,
.filter-pill[data-wave="Teach-back"].active {
  background: var(--grad-teachback, linear-gradient(90deg, #0ebc5f 0%, #78c9ff 100%)) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 14px rgba(14, 188, 95, 0.5) !important;
}

.video-counter {
  display: none !important;
}
