/**
 * search-bar-bs-shared.css — Shared search button styling (slot + livecasino + casino)
 *
 * ITER 687 (2026-05-23): User talimati "canlı casino sayfasındaki arama
 * butonunu çok güzel, davranışı animasyonu kapanışı her şeyi çok güzel.
 * onu slot sayfasındaki arama butonuna geçirebilir miyiz?"
 *
 * Kaynak: livecasino-page-fixes.css line 285-374 (section 4.2 SEARCH ICON BUTTON)
 * Bu kurallar daha önce livecasino'ya scope'luydu (`:has(a[href="/livecasino?sort=blackjack"])`).
 * Şimdi shared file'a taşındı, /slot + /livecasino + /casino üçünde de aynı.
 *
 * Scope: .slot-page-root (her iki sayfada da bu class var: slot.astro + livecasino.astro)
 *
 * Davranış (sayfalar arası birebir aynı):
 *   - Rest state: icon-only 42×40 box (transparent bg, 1px border, br 8)
 *   - Click → JS (slot-overlay-icons-fix.js bindSearchToggle):
 *     bar.classList.add('search-active') + expand.classList.add('is-expanded')
 *     + inline flex calc(100% - 48px) zorla
 *     + bar/input/border inline styles
 *   - Tekrar click → revert (search-active kaldırılır, inline styles temizlenir)
 *
 * NOT: Bu shared CSS rule'larında :not(.always-expanded) guard YOK.
 *       Çünkü livecasino-page-fixes.css'in original rule'lari always-expanded
 *       set olunca devre dışı kalıyordu — sonuçta rule hiç apply olmuyor.
 *       Burada always-expanded gözardı, rule HER zaman apply (BS-paralel kurgu).
 */

/* ─── SEARCH WRAPPER (collapsed state — rest) ─────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 41.6px !important;
  min-width: 41.6px !important;
  max-width: 41.6px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0.8px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
  order: 99 !important;
}

/* ─── SEARCH BAR (inner container, collapsed) ─────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-bar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  gap: 0 !important;
}

/* ─── SEARCH INPUT (hidden at rest) ───────────────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-input {
  display: none !important;
}

/* ─── SEARCH BUTTON (icon at rest) ─────────────────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-btn,
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  cursor: pointer !important;
  color: rgb(255, 255, 255) !important;
  box-shadow: none !important;
}

/* ─── SEARCH ICON (i element) ─────────────────────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-btn i,
html.mobile-root body.mobile-site .slot-page-root .games-search-expand:not(.is-expanded) .games-search-icon-btn i {
  font-size: 18px !important;
  line-height: 1 !important;
  color: rgb(255, 255, 255) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ─── EXPANDED STATE (after click — input visible) ─────────────────── */
/* JS (slot-overlay-icons-fix.js bindSearchToggle) inline style ekler:
 *   expand.style.flex = '0 0 calc(100% - 48px)'  (livecasino — sort yok)
 *   expand.style.flex = '0 0 calc(100% - 56px)'  (slot — sort var)
 * Bu CSS rule sadece DOM class değişimlerinde fallback styling.
 * Input görünür, bar full width.
 */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand.is-expanded {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0.8px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background-color: transparent !important;
  height: 40px !important;
}

html.mobile-root body.mobile-site .slot-page-root .games-search-expand.is-expanded .games-search-bar {
  display: flex !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 40px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
}

html.mobile-root body.mobile-site .slot-page-root .games-search-expand.is-expanded .games-search-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  height: 40px !important;
  min-width: 0 !important;
  padding: 9px 10px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: rgb(255, 255, 255) !important;
  font-size: 14px !important;
  outline: none !important;
}

html.mobile-root body.mobile-site .slot-page-root .games-search-expand.is-expanded .games-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* ─── ACTIVE STATE (bar.search-active set by JS) ──────────────────── */
html.mobile-root body.mobile-site .slot-page-root .slots-game-search-bar.search-active .games-search-expand {
  border: 0.8px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
}

/* ─── TRANSITION (smooth expand/collapse) ─────────────────────────── */
html.mobile-root body.mobile-site .slot-page-root .games-search-expand {
  transition:
    flex 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    min-width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

html.mobile-root body.mobile-site .slot-page-root .games-search-expand .games-search-bar {
  transition:
    flex 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ─── ITER 687 v4 (2026-05-23): BS-paralel sticky removal ──────────
 * User raporu: slot sayfasında ilk girince mobilde 1ms anında aşağıya
 * çekiliyor. Livecasino'da yok.
 *
 * Fix 1: .slots-filter-and-games sticky → static. */
html.mobile-root body.mobile-site .slot-page-root .slots-filter-and-games {
  position: static !important;
  top: auto !important;
}
html.mobile-root body.mobile-site .slot-page-root .slots-filter-and-games.casinoGenericPageTemplate {
  position: static !important;
  top: auto !important;
}

/* ITER 687 v5 (CLS fix) REVERTED — user video analizinden sonra
 * gerçek sebep search click sonrası scroll olduğu anlaşıldı, CLS değil.
 * v6 fix slot-overlay-icons-fix.js içinde (smooth scrollIntoView). */
