/* videoplayback/css/header.css
   Shared header styles for BOTH markups:
   - header.inc.php / index.php: .cs-header__row, .brand, .actions, .btn, .cs-searchbar__*
   - older/alt: .cs-header-shell, .cs-brand, .cs-actions, .cs-pill, .cs-themebtn, .cs-iconbtn

   Goal:
   - Make headers look the SAME on index.php and videoplayback/page.php
   - Token-friendly (light/dark) without importing index.css
*/

.cs-header,
.cs-header *{ box-sizing:border-box; }

/* -----------------------------
   Header container (sticky)
------------------------------ */
.cs-header{
  position: sticky;
  top: 0;
  z-index: 5000;
  width: 100%;

  background: var(--panel, var(--card, #121621));
  border-bottom: 1px solid var(--line, rgba(255,255,255,.10));
  padding: calc(8px + env(safe-area-inset-top)) 12px 10px 12px;
  backdrop-filter: blur(6px);
}

/* Shell/Row wrapper: support BOTH class names */
.cs-header .cs-header-shell,
.cs-header .cs-header__row{
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

/* ---------- Brand (both variants) ---------- */
.cs-header .cs-brand,
.cs-header .brand{
  display:inline-flex;
  align-items:center;
  gap:10px;

  font-weight: 800;
  font-size: 18px;
  letter-spacing: .2px;
  color: var(--ink, #eaeef5);
  text-decoration:none;
  white-space:nowrap;

  padding: 6px 8px;
  border-radius: 8px;
}

.cs-header .cs-brand:hover,
.cs-header .brand:hover{
  background: var(--hover, rgba(255,255,255,.06));
}

/* Badge/Logo (both variants) */
.cs-header .cs-brand-badge,
.cs-header .brand .logo{
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--brand, #4b9cff);
  flex: 0 0 auto;
}

/* ---------- Middle search ---------- */
.cs-header .cs-search{
  flex: 1 1 auto;
  min-width: 220px;
  display:flex;
  justify-content:center;
}

.cs-header .cs-searchbar{
  width: min(820px, 100%);
  display:flex;
  align-items:center;
  gap: 8px;

  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: var(--card, #121621);
}

/* Input (index-style + fallback inputs) */
.cs-header .cs-searchbar__input,
.cs-header .cs-searchbar input[type="search"],
.cs-header .cs-searchbar input[type="text"]{
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 16px system-ui, -apple-system, Segoe UI, Roboto, Arial;
  padding: 10px 6px 10px 10px;
}

.cs-header .cs-searchbar__input::placeholder,
.cs-header .cs-searchbar input::placeholder{ opacity: .65; }

/* Clear (×) inside the pill */
.cs-header .cs-searchbar__clear{
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--mut, #9aa4b2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display:grid;
  place-items:center;
}
.cs-header .cs-searchbar__clear:hover{
  background: var(--hover, rgba(255,255,255,.06));
  color: inherit;
}

/* Search icon button on the right */
.cs-header .cs-searchbar__btn,
.cs-header .cs-searchbar .btnIcon{
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: var(--chip, rgba(255,255,255,.06));
  color: inherit;
  cursor: pointer;
  display:grid;
  place-items:center;
}
.cs-header .cs-searchbar__btn:hover,
.cs-header .cs-searchbar .btnIcon:hover{
  filter: brightness(1.06);
}

.cs-header .cs-searchbar__icon{
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Focus ring */
.cs-header .cs-searchbar:focus-within{
  border-color: color-mix(in srgb, var(--brand, #4b9cff) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #4b9cff) 18%, transparent);
}

/* ---------- Right actions (both variants) ---------- */
.cs-header .cs-actions,
.cs-header .actions{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:flex-end;
  flex: 0 0 auto;
  white-space:nowrap;
}

/* Pills/buttons (supports both: .cs-pill/.cs-themebtn AND .btn) */
.cs-header .cs-pill,
.cs-header .btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  cursor:pointer;

  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: var(--chip, rgba(255,255,255,.06));
  color: inherit;
  font-weight: 600;
  text-decoration:none;
}

.cs-header .btn--icon{
  padding: 10px;
  width: auto;
}

.cs-header .cs-pill:hover,
.cs-header .btn:hover{
  background: var(--hover, rgba(255,255,255,.06));
}

/* Theme button (alt markup) */
.cs-header .cs-themebtn,
.cs-header .cs-iconbtn{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: var(--chip, rgba(255,255,255,.06));
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cs-header .cs-themebtn:hover,
.cs-header .cs-iconbtn:hover{ background: var(--hover, rgba(255,255,255,.06)); }

.cs-header .icon{
  width: 18px;
  height: 18px;
  fill: currentColor;
  display:inline-block;
}

/* ---------- Mobile stacking ---------- */
@media (max-width: 820px){
  .cs-header .cs-header-shell,
  .cs-header .cs-header__row{
    flex-wrap: wrap;
    gap: 12px;
  }

  .cs-header .cs-search{
    order: 3;
    flex: 1 1 100%;
    justify-content: stretch;
    min-width: 0;
  }

  .cs-header .cs-searchbar{ width: 100%; }
}
