/* ===================================================================
   FISHAO – Players Community & Backyard Styles (css/players.css)
   =================================================================== */

/* --- Community Sub-Header Toolbar --- */
.players-community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px 0;
  flex-wrap: wrap;
}

.players-community-toolbar .pill-btn.teal {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border-color: #2dd4bf;
  color: #ffffff;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.players-community-toolbar .pill-btn.teal:hover {
  background: linear-gradient(135deg, #0f766e, #115e59);
  border-color: #5eead4;
  transform: translateY(-1px);
}

/* --- Players Grid & Cards --- */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s ease;
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.player-card.is-me {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, var(--surface) 100%);
}

.player-card.is-friend {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, var(--surface) 100%);
}

.player-card.is-friend:hover {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.player-friend-star-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-friend-star-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.player-friend-star-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  font-weight: 700;
  box-shadow: none;
}

.player-friend-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 6px;
  border-radius: 6px;
}

.player-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.player-card-avatar-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.15);
  border: 2px solid rgba(20, 184, 166, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-card-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-card-meta {
  flex: 1;
  min-width: 0;
}

.player-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.player-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-me-tag {
  font-size: 11px;
  font-weight: 800;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.2);
  padding: 1px 6px;
  border-radius: 6px;
}

.player-card-club-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.player-card-club-badge {
  color: #fbbf24;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Stats progress block inside card */
.player-card-stats {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.player-card-stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 4px;
}

.player-card-stat-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.player-card-stat-val {
  font-weight: 700;
}

/* Backyard preview inside card - Rich Informative Cards */
.player-card-backyard {
  margin-bottom: 14px;
  flex: 1;
}

.player-card-backyard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #2dd4bf;
  margin-bottom: 8px;
}

.player-backyard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-backyard-fish-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-backyard-fish-card:hover {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.4);
  transform: translateX(2px);
}

.pbfc-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pbfc-img {
  width: 36px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

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

.pbfc-name {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pbfc-stars {
  font-size: 11px;
  color: #fbbf24;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.pbfc-active-pill {
  font-size: 10px;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.pbfc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 3px;
}

.pbfc-time {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.pbfc-baits {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-backyard-expand-btn {
  background: none;
  border: none;
  color: #2dd4bf;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
  margin-top: 3px;
  text-align: left;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.player-backyard-expand-btn:hover {
  color: #5eead4;
  text-decoration: underline;
}

/* --- Floating Popover Menu for Backyard Fishes (prevents card grid stretching) --- */
.player-backyard-popover-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 50px;
  background: #0b1322;
  border: 1px solid rgba(20, 184, 166, 0.6);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.88), 0 0 16px rgba(20, 184, 166, 0.3);
  z-index: 60;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: popoverFadeIn 0.16s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pbm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pbm-title {
  font-size: 12px;
  font-weight: 700;
  color: #2dd4bf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pbm-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.pbm-close:hover {
  color: #ef4444;
}

.pbm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.player-card-empty-backyard {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 0;
}

.player-card-btn {
  width: 100%;
  height: 34px;
  background: rgba(20, 184, 166, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s;
}

.player-card-btn:hover {
  background: rgba(20, 184, 166, 0.25);
  color: #5eead4;
  border-color: #14b8a6;
}

/* --- Fish Detail Modal Backyard Toggle Pill --- */
.btn-backyard-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-backyard-pill:hover {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border-color: rgba(20, 184, 166, 0.4);
}

.btn-backyard-pill.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.35), rgba(16, 185, 129, 0.2));
  color: #2dd4bf;
  border-color: #14b8a6;
  box-shadow: none;
}

/* Backyard Owners Box in Fish Detail */
.modal-backyard-owners-box {
  background: rgba(20, 184, 166, 0.05);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

.modal-backyard-owners-title {
  font-size: 12px;
  font-weight: 700;
  color: #2dd4bf;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-backyard-owners-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-backyard-owner-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.35);
  font-size: 11.5px;
  font-weight: 600;
  color: #f0fdfa;
  cursor: pointer;
  transition: all 0.18s;
}

.modal-backyard-owner-pill:hover {
  background: rgba(20, 184, 166, 0.3);
  border-color: #14b8a6;
  transform: translateY(-1px);
}

.modal-backyard-owner-pill.is-friend {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef08a;
}

.modal-backyard-owner-pill.is-friend:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #fbbf24;
}

/* Enlarged search bar with clear button */
.search-input-wrap.lg {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
  flex: 1;
  max-width: 440px;
}

.search-input-wrap.lg .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input-lg {
  width: 100%;
  height: 38px;
  padding: 8px 34px 8px 36px;
  font-size: 13.5px;
  border-radius: 10px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.search-input-lg:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.3);
  outline: none;
}

.search-input-wrap.has-value .search-input-lg,
.search-input-wrap.has-value .dash-input {
  border-color: #14b8a6;
  background: rgba(20, 184, 166, 0.08);
}

.dash-input.select-clean.has-value {
  background: rgba(20, 184, 166, 0.15);
  border-color: #14b8a6;
  color: #2dd4bf;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.25);
  font-weight: 700;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.search-clear-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* --- Active Filters Summary Bar --- */
.active-filters-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(20, 184, 166, 0.09);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 10px;
  margin: 10px 0 16px 0;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.active-filters-title {
  color: #2dd4bf;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 184, 166, 0.22);
  border: 1px solid rgba(20, 184, 166, 0.5);
  color: #f0fdfa;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  animation: fadeIn 0.15s ease;
}

.active-filter-chip button {
  background: none;
  border: none;
  color: #99f6e4;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}

.active-filter-chip button:hover {
  color: #ef4444;
}

.active-filters-clear-all {
  margin-left: auto;
  color: #f87171;
  background: none;
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.active-filters-clear-all:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* --- Universal Player Modal Backyard Section --- */
.player-modal-backyard-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.player-modal-backyard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #2dd4bf;
  margin-bottom: 10px;
}

.player-modal-backyard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.player-modal-backyard-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-modal-backyard-card:hover {
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.5);
  transform: translateY(-1px);
}

/* --- High-Contrast Active States for Filter Card Buttons --- */
#bannerPlayers #filterPlayerFriendsOnlyBtn.active {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

#bannerPlayers #filterPlayerBackyardOnlyBtn.active {
  background: linear-gradient(135deg, #0d9488, #0f766e) !important;
  border-color: #2dd4bf !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

#bannerPlayers #filterPlayerActiveNowBtn.active {
  background: linear-gradient(135deg, #059669, #047857) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

/* --- Profile Modal Enlarged & Visual Catalog --- */
#profileModalOverlay .modal-box {
  max-width: 820px !important;
  width: 95%;
}

.profile-top-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .profile-top-grid {
    grid-template-columns: 1fr;
  }
}

.profile-backyard-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.profile-backyard-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 48px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 180px;
  overflow-y: auto;
}

.profile-backyard-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.2);
  border: 1px solid rgba(20, 184, 166, 0.45);
  font-size: 12px;
  color: #f0fdfa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.profile-backyard-chip img {
  width: 30px;
  height: 17px;
  object-fit: contain;
}

.profile-backyard-chip .chip-stars {
  font-size: 10px;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.profile-backyard-chip-remove {
  background: none;
  border: none;
  color: #f87171;
  font-size: 15px;
  cursor: pointer;
  padding: 0 3px;
  font-weight: bold;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.profile-backyard-chip-remove:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.5);
}

.profile-catalog-toggle-btn {
  width: 100%;
  padding: 9px 14px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px dashed rgba(20, 184, 166, 0.45);
  border-radius: 8px;
  color: #2dd4bf;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.profile-catalog-toggle-btn:hover {
  background: rgba(20, 184, 166, 0.22);
  border-color: #14b8a6;
  color: #5eead4;
}

.profile-all-backyard-catalog {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  max-height: 290px;
  overflow-y: auto;
}

.profile-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.catalog-fish-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  user-select: none;
}

.catalog-fish-card:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.5);
  transform: translateY(-2px);
}

.catalog-fish-card.selected {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(16, 185, 129, 0.18));
  border-color: #14b8a6;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
}

.catalog-fish-card img {
  width: 44px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 4px;
}

.catalog-fish-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.catalog-fish-stars {
  font-size: 10px;
  color: #fbbf24;
  margin-top: 2px;
}

.catalog-fish-check {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: #34d399;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-backyard-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #111a2e;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  margin-top: 4px;
}

.profile-backyard-sugg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  transition: background 0.15s;
}

.profile-backyard-sugg-item:hover {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
}

.profile-backyard-sugg-item img {
  width: 34px;
  height: 19px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .players-grid {
    grid-template-columns: 1fr;
  }
  .player-modal-backyard-grid {
    grid-template-columns: 1fr;
  }
}
