/**
 * Firetalk Members Stylesheet
 * 1-to-1 visual fidelity matching Paltalk's reference design:
 * - Arched hero banner with vibrant purple-to-peach gradient, star sparkles, and confetti ribbons
 * - Vertical stacked period tabs (WEEK >, MONTH, YEAR) and "VIEW ALL LEADERBOARDS >"
 * - 3D podium stage with 3 columns (center column MOST GIFTED elevated higher)
 * - Official SVG frame overlays (highest_xp.svg, most_gifted.svg, biggest_gifter.svg)
 * - 3D perspective trapezoidal pedestals (TOTAL XP, GIFTS RECEIVED, GIFTS SENT)
 * - 4-Column directory grid of member cards with top banners, overlapping avatars,
 *   green online dots, styled nicknames, and demographics
 */

/* ==========================================================================
   TOP MEMBERS HERO BANNER
   ========================================================================== */
.top-members-hero {
  background: linear-gradient(100deg, #6d28d9 0%, #8b5cf6 20%, #c026d3 42%, #ec4899 62%, #f97316 84%, #fbb778 100%);
  padding: 36px 0 54px;
  position: relative;
  overflow: hidden;
}

/* Central Stage Spotlight to highlight the podium */
.top-members-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 960px;
  height: 100%;
  background: radial-gradient(ellipse 70% 75% at 50% 35%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.4) 55%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Star Sparkles in background */
.hero-sparkle {
  position: absolute;
  color: rgba(255, 255, 255, 0.85);
  font-family: serif;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

.hero-sparkle-1 {
  top: 22px;
  left: 17%;
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.85));
  animation: sparkleTwinkle 3s ease-in-out infinite;
}

.hero-sparkle-2 {
  top: 75px;
  left: 23%;
  font-size: 15px;
  opacity: 0.7;
  animation: sparkleTwinkle 2.5s ease-in-out infinite 1s;
}

.hero-sparkle-3 {
  top: 14px;
  left: 44%;
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
  animation: sparkleTwinkle 3.2s ease-in-out infinite 0.5s;
}

.hero-sparkle-4 {
  top: 36px;
  left: 64%;
  font-size: 16px;
  opacity: 0.65;
  animation: sparkleTwinkle 2.8s ease-in-out infinite 1.5s;
}

.hero-sparkle-5 {
  top: 18px;
  right: 12%;
  font-size: 24px;
  opacity: 0.8;
  animation: sparkleTwinkle 3.5s ease-in-out infinite 2s;
}

/* Confetti Ribbons */
.hero-confetti {
  position: absolute;
  font-size: 24px;
  font-weight: 900;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.hero-confetti-1 {
  top: 40px;
  left: 29%;
  color: #ff7675;
  transform: rotate(-35deg);
}

.hero-confetti-2 {
  top: 28px;
  right: 32%;
  color: #fdcb6e;
  transform: rotate(45deg);
}

.hero-confetti-3 {
  bottom: 80px;
  right: 18%;
  color: #74b9ff;
  transform: rotate(-15deg);
}

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.top-members-hero .container {
  position: relative;
  z-index: 2;
}

.top-members-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* Left Title Group (TOP MEMBERS + Vertical Pills) */
.top-members-title-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  width: 160px;
}

.top-members-heading {
  font-size: 42px;
  font-weight: 900;
  line-height: 0.95;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
  margin: 0;
}

/* Vertical Stacked Period Pills */
.leaderboard-tabs-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 110px;
}

.tab-btn-pill {
  border: none;
  outline: none;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 7px 18px;
  transition: all 0.15s ease;
  width: 100%;
}

.tab-btn-pill.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.tab-btn-pill:not(.active) {
  background: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.tab-btn-pill:not(.active):hover {
  background: rgba(255, 255, 255, 0.5);
}

.view-all-link {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.4px;
  text-decoration: none;
  white-space: nowrap;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Arch Bottom Wave */
.top-members-hero-arch {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 65px;
  pointer-events: none;
  z-index: 1;
}

.hero-arch-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   PODIUM STAGE (TOP 3 MEMBERS)
   ========================================================================== */
.podium-stage-members {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  flex: 1;
  max-width: 820px;
  position: relative;
  z-index: 3;
}

.podium-member-col {
  display: flex;
  flex-direction: column;
  width: 240px;
  position: relative;
}

/* Center column (MOST GIFTED) elevated higher */
.podium-col-center {
  z-index: 5;
  width: 256px;
}

.podium-col-center .podium-frame-stage {
  transform: translateY(-12px);
}

.podium-col-side {
  z-index: 3;
}

.podium-member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.podium-member-card:hover {
  transform: translateY(-2px);
}

/* Top Pill Badges */
.podium-pill-badge {
  padding: 2.5px 13px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  margin-bottom: 4px;
  z-index: 4;
}

.podium-pill-xp {
  background: #00d2ff;
}

.podium-pill-gifts {
  background: #ec4899;
}

.podium-pill-followers {
  background: #f59e0b;
}

/* Avatar Frame Stage (using official SVG frames) */
.podium-frame-stage {
  position: relative;
  width: 154px;
  height: 183px;
  margin: 0 auto 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.podium-avatar-photo {
  position: absolute;
  top: 26px;
  left: 7px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
}

.podium-col-center .podium-avatar-photo {
  width: 140px;
  height: 140px;
  top: 26px;
  left: 7.5px;
}

.podium-frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 154px;
  height: 183px;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
}

/* User line (Crown level badge + Nickname) with crisp frosted pill */
.podium-user-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 1px auto 6px;
  padding: 3px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.level-crown-badge {
  height: 15px;
  width: auto;
  max-width: none !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

.podium-nickname {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* 3D Perspective Trapezoidal Pedestals below members */
.podium-pedestal-member {
  text-align: center;
  margin-top: 0;
  transition: all 0.2s ease;
  width: 100%;
}

.pedestal-xp {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 12px 8px 10px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0% 100%);
}

.pedestal-gifts {
  background: linear-gradient(180deg, #fce7f3 0%, #fbcfe8 100%);
  padding: 18px 10px 14px;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.22);
  clip-path: polygon(5% 0, 95% 0, 100% 100%, 0% 100%);
}

.pedestal-followers {
  background: linear-gradient(180deg, #e0f2fe 0%, #bfdbfe 100%);
  padding: 12px 8px 10px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
  clip-path: polygon(0 0, 92% 0, 100% 100%, 0% 100%);
}

.pedestal-score-member {
  font-size: 24px;
  font-weight: 900;
  color: #2563eb;
  line-height: 1;
}

.pedestal-gifts .pedestal-score-member {
  font-size: 26px;
  color: #c026d3;
}

.pedestal-label-member {
  font-size: 9px;
  font-weight: 800;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.pedestal-gifts .pedestal-label-member {
  color: #a21caf;
}

/* ==========================================================================
   MEMBERS DIRECTORY (FILTER SIDEBAR + 4-COLUMN GRID)
   ========================================================================== */
.directory-section {
  padding: 28px 0 80px;
  background-color: #ffffff;
}

.directory-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.online-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.online-dot-green {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.directory-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: flex-start;
}

/* Left Filter Sidebar Card */
.filter-sidebar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.filter-group {
  margin-bottom: 16px;
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 5px;
  text-transform: capitalize;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease;
}

.filter-input:focus,
.filter-select:focus {
  border-color: #38bdf8;
}

.age-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.age-box {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  outline: none;
}

.age-slider-track {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-sidebar-submit {
  width: 100%;
  background: #38bdf8;
  color: #ffffff;
  padding: 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  margin-top: 6px;
  margin-bottom: 8px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}

.btn-sidebar-submit:hover {
  background: #0284c7;
}

.btn-sidebar-clear {
  width: 100%;
  background: #e2e8f0;
  color: #64748b;
  padding: 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-sidebar-clear:hover {
  background: #cbd5e1;
  color: #1e293b;
}

/* ==========================================================================
   4-COLUMN MEMBERS GRID (MATCHING PALTALK)
   ========================================================================== */
.members-results-col {
  width: 100%;
}

.members-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* Member Card */
.member-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

/* Top Card Cover Banner Wrap & Floating Tier Badge */
.member-card-banner-wrap {
  position: relative;
  width: 100%;
  height: 72px;
  overflow: hidden;
}

.member-card-banner {
  width: 100%;
  height: 72px;
  object-fit: cover;
  object-position: right center;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: block;
}

.member-floating-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2.5px 7.5px;
  border-radius: 999px;
  color: #ffffff;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.1;
}

.member-floating-badge.badge-admin {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(185, 28, 28, 0.98));
  border: 1px solid rgba(254, 202, 202, 0.6);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45);
}

.member-floating-badge.badge-prime {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.98));
  border: 1px solid rgba(254, 240, 138, 0.6);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

.member-floating-badge.badge-vip {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.92), rgba(126, 34, 206, 0.98));
  border: 1px solid rgba(233, 213, 255, 0.6);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.45);
}

.member-floating-badge.badge-extreme {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.98));
  border: 1px solid rgba(167, 243, 208, 0.6);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45);
}

/* Overlapping Circular Avatar */
.member-card-avatar-wrap {
  position: relative;
  margin-top: -38px;
  margin-bottom: 8px;
  width: 76px;
  height: 76px;
}

.member-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  background: #f1f5f9;
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Avatar Halo Rings */
.member-card-avatar-wrap.ring-admin .member-card-avatar {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
.member-card-avatar-wrap.ring-prime .member-card-avatar {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}
.member-card-avatar-wrap.ring-vip .member-card-avatar {
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}
.member-card-avatar-wrap.ring-extreme .member-card-avatar {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.member-online-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  z-index: 2;
}

.member-online-dot.is-online {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.member-online-dot.is-offline {
  background: #94a3b8;
  opacity: 0.85;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Member Card Info */
.member-card-info {
  padding: 0 10px 14px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.member-card-nickname {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
  height: 20px;
  line-height: 1;
}

.member-card-nick-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  align-self: center;
}

.member-card-crown {
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  width: auto !important;
  max-width: none !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  object-fit: contain !important;
  align-self: center !important;
}

.member-card-bar {
  display: none !important;
}

.member-card-details {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.directory-loading, .directory-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
  font-size: 15px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .members-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .top-members-header-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .top-members-title-group {
    width: auto;
    align-items: center;
  }
  .leaderboard-tabs-vertical {
    flex-direction: row;
    width: auto;
  }
}

@media (max-width: 900px) {
  .directory-layout {
    grid-template-columns: 1fr;
  }
  .podium-stage-members {
    flex-direction: column;
    align-items: center;
  }
  .podium-member-col, .podium-col-center {
    width: 100%;
    max-width: 300px;
    transform: none;
  }
  .members-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .members-cards-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   Universal Avatar & Media Constraint Protections
   ========================================================================== */
.podium-avatar-photo {
  position: absolute !important;
  width: 138px !important;
  height: 138px !important;
  max-width: 138px !important;
  max-height: 138px !important;
  top: 27px !important;
  left: 8px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  z-index: 1 !important;
  display: block !important;
}

.podium-col-center .podium-avatar-photo {
  left: 8.5px !important;
  top: 27px !important;
  width: 138px !important;
  height: 138px !important;
  max-width: 138px !important;
  max-height: 138px !important;
}

.podium-card-gifts .podium-avatar-photo {
  width: 138px !important;
  height: 138px !important;
  max-width: 138px !important;
  max-height: 138px !important;
}

.hero-arch-svg path {
  fill: var(--bg-page, #ffffff) !important;
  transition: fill 0.3s ease;
}

.member-card-avatar-wrap {
  position: relative !important;
  margin-top: -38px !important;
  margin-bottom: 8px !important;
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
}

.member-card-avatar {
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.member-card-banner-wrap {
  position: relative !important;
  width: 100% !important;
  height: 72px !important;
  overflow: hidden !important;
}

.member-card-banner {
  width: 100% !important;
  height: 72px !important;
  object-fit: cover !important;
  display: block !important;
}

/* ==========================================================================
   Dark Mode & Theme Token Adaptations
   ========================================================================== */
[data-theme="dark"] body {
  background-color: var(--bg-page, #0b0f19);
  color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .filter-sidebar-card,
[data-theme="dark"] .member-card {
  background: var(--bg-surface, #111827);
  border-color: var(--border-subtle, #1e293b);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select,
[data-theme="dark"] .age-box {
  background-color: var(--bg-subtle, #1e293b);
  color: var(--text-primary, #f8fafc);
  border-color: var(--border-subtle, #334155);
}

[data-theme="dark"] .member-card-nick-text {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] .top-members-hero-arch svg path {
  fill: var(--bg-page, #0b0f19);
}
