/* =============================================================================
   teams.css — Public Teams index page styles
   ============================================================================= */

/* ── Page layout ──────────────────────────────────────────────────────────── */
.teamsIndexPage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.teamsIndexHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.teamsIndexTitle {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}

.teamsIndexMeta {
  font-size: 13px;
  color: var(--muted);
}

/* ── Format tabs ──────────────────────────────────────────────────────────── */
.teamsFormatTabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.formatTab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.formatTab:hover { color: var(--text); text-decoration: none; }
.formatTab.is-active { color: var(--link); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Filter / sort bar ────────────────────────────────────────────────────── */
.teamsFilterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 28px;
}

.teamsFilterBar .filterFieldGroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Rich dropdown ────────────────────────────────────────────────────────── */
.richDropdown {
  position: relative;
  min-width: 200px;
}

.richDropdownTrigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  list-style: none;
  user-select: none;
  transition: border-color 0.12s;
}
.richDropdownTrigger::-webkit-details-marker { display: none; }
.richDropdownTrigger::marker { display: none; }
.richDropdown[open] .richDropdownTrigger { border-color: var(--accent); }
.richDropdownTrigger:hover { border-color: rgba(107, 63, 160, 0.5); }

.richDropdownTriggerInner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.richDropdownTriggerText {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.richDropdownChevron {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.15s;
}
.richDropdown[open] .richDropdownChevron { transform: rotate(180deg); }

.richDropdownMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 200;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.richDropdownItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.richDropdownItem:hover { background: var(--surface-2); text-decoration: none; }
.richDropdownItem.is-active {
  background: rgba(107, 63, 160, 0.15);
  color: var(--link);
  font-weight: 600;
}

.richDropdownItem--all {
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.richDropdownDivider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ── Pokémon search bar ───────────────────────────────────────────────────── */
.teamsSearchForm { flex: 1; min-width: 180px; max-width: 280px; }

.teamsSearchWrap {
  position: relative;
  display: flex;
  align-items: center;
}

.teamsSearchIcon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

.teamsSearchInput {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 6px 32px 6px 30px;
  transition: border-color 0.12s;
  appearance: none;
}
.teamsSearchInput:focus { outline: none; border-color: var(--accent); }
.teamsSearchInput::placeholder { color: var(--muted); }
.teamsSearchInput::-webkit-search-cancel-button { display: none; }

.teamsSearchClear {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  padding: 2px;
  border-radius: 3px;
  transition: color 0.12s;
}
.teamsSearchClear:hover { color: var(--text); }

/* ── Team grid ────────────────────────────────────────────────────────────── */
.teamsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.teamsPagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pageBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
}
.pageBtn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.pageBtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pageBtn:disabled, .pageBtn[disabled] { opacity: 0.35; pointer-events: none; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .teamsGrid {
    grid-template-columns: 1fr;
  }
  .teamsIndexHeader {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .teamsIndexPage { padding: 24px 16px 60px; }
  .teamsFilterBar { gap: 8px; }
}
