/* SG Champion Club Pickleball Standalone Intranet Stylesheet */
/* Zero External Dependencies - 100% Offline / Intranet Ready */

:root {
  --pb-lime: #a3e635;
  --pb-lime-dim: rgba(163, 230, 53, 0.15);
  --pb-lime-glow: rgba(163, 230, 53, 0.35);
  --pb-emerald: #10b981;
  --pb-teal: #14b8a6;
  --pb-amber: #f59e0b;
  --pb-rose: #f43f5e;
  --pb-navy: #080c14;
  --pb-card: #0f172a;
  --pb-card-border: #1e293b;
  --pb-card-hover: #334155;
  --pb-slate-text: #94a3b8;
  --pb-slate-muted: #64748b;
  --pb-white: #f8fafc;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--pb-navy);
  color: var(--pb-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(at 0% 0%, rgba(163, 230, 53, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Layout Containers */
.container {
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header & Nav */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(163, 230, 53, 0.2);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a3e635, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #080c14;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(163, 230, 53, 0.25);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #a3e635, #6ee7b7, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(163, 230, 53, 0.15);
  color: var(--pb-lime);
  border: 1px solid rgba(163, 230, 53, 0.3);
}

.brand-sub {
  font-size: 11px;
  color: var(--pb-slate-text);
  display: block;
  margin-top: -2px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pb-slate-text);
  transition: all 0.15s ease;
}

.nav-btn:hover {
  color: #fff;
  background: #1e293b;
}

.nav-btn.active {
  color: var(--pb-lime);
  background: rgba(163, 230, 53, 0.12);
  border: 1px solid rgba(163, 230, 53, 0.3);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  border-top: 1px solid #1e293b;
  background: rgba(8, 12, 20, 0.98);
  padding: 8px;
  justify-content: space-around;
  font-size: 11px;
  font-weight: 700;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--pb-slate-text);
}

.mobile-nav-btn.active {
  color: var(--pb-lime);
}

/* Language Switcher Pill */
.pill-toggle {
  display: inline-flex;
  border-radius: 8px;
  padding: 2px;
  background: #0b1120;
  border: 1px solid #1e293b;
  font-size: 11px;
  font-weight: 700;
}

.pill-btn {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--pb-slate-text);
  transition: all 0.15s ease;
}

.pill-btn:hover {
  color: #fff;
}

.pill-btn.active {
  color: var(--pb-lime);
  background: rgba(163, 230, 53, 0.2);
  font-weight: 800;
}

/* Card Style */
.court-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #1e293b;
  border-radius: 16px;
  transition: border-color 0.2s ease;
}

.court-card:hover {
  border-color: rgba(163, 230, 53, 0.3);
}

/* Hero Banner */
.hero-banner {
  padding: 24px;
  border: 1px solid rgba(163, 230, 53, 0.25);
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.25) 0%, rgba(15, 23, 42, 0.9) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(163, 230, 53, 0.12);
  color: var(--pb-lime);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(163, 230, 53, 0.3);
  margin-bottom: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pb-lime);
  display: inline-block;
  box-shadow: 0 0 8px var(--pb-lime);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-sub {
  font-size: 13px;
  color: var(--pb-slate-text);
  margin-top: 4px;
}

/* Search input */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.search-input {
  width: 100%;
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  color: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--pb-lime);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pb-slate-muted);
  font-size: 13px;
  pointer-events: none;
}

/* Podium 3 Cards */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.podium-card {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.podium-card.gold {
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.8));
}

.podium-card.silver {
  border: 1px solid rgba(203, 213, 225, 0.35);
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.1), rgba(15, 23, 42, 0.8));
}

.podium-card.bronze {
  border: 1px solid rgba(217, 119, 6, 0.4);
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.12), rgba(15, 23, 42, 0.8));
}

.podium-card:hover {
  transform: translateY(-2px);
  border-color: var(--pb-lime);
}

.podium-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Ranking Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.8);
  margin-top: 20px;
}

table.court-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

table.court-table thead {
  background: #0b1120;
  color: var(--pb-slate-text);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}

table.court-table th, table.court-table td {
  padding: 14px 18px;
}

table.court-table tbody tr {
  border-top: 1px solid #1e293b;
  transition: background 0.12s ease;
}

table.court-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

/* Rank Circle Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.rank-gold {
  background: #f59e0b;
  color: #080c14;
}

.rank-silver {
  background: #cbd5e1;
  color: #080c14;
}

.rank-bronze {
  background: #d97706;
  color: #fff;
}

.rank-plain {
  color: var(--pb-slate-text);
  font-weight: 700;
}

/* DUPR Badges */
.badge-dupr {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
}

.badge-dupr-pro {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-dupr-adv {
  background: rgba(163, 230, 53, 0.2);
  color: #bef264;
  border: 1px solid rgba(163, 230, 53, 0.4);
}

.badge-dupr-inter {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Action button */
.btn-action {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(163, 230, 53, 0.12);
  color: var(--pb-lime);
  border: 1px solid rgba(163, 230, 53, 0.3);
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: rgba(163, 230, 53, 0.25);
  color: #fff;
}

/* Sub tabs for tournaments */
.sub-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid #1e293b;
  font-size: 13px;
  font-weight: 800;
  margin-top: 14px;
}

.sub-tab-btn {
  padding-bottom: 12px;
  color: var(--pb-slate-text);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.sub-tab-btn:hover {
  color: #fff;
}

.sub-tab-btn.active {
  color: var(--pb-lime);
  border-bottom-color: var(--pb-lime);
}

/* Bracket Grid */
.bracket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.match-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.2s ease;
}

.match-card:hover {
  border-color: rgba(163, 230, 53, 0.4);
}

.match-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--pb-slate-text);
  border-bottom: 1px solid #1e293b;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.match-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--pb-slate-text);
}

.match-slot.winner {
  background: rgba(163, 230, 53, 0.12);
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(163, 230, 53, 0.3);
}

.match-slot-score {
  font-size: 15px;
  font-weight: 900;
  color: var(--pb-slate-muted);
}

.match-slot.winner .match-slot-score {
  color: var(--pb-lime);
}

/* Matrix Table */
.pb-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.pb-matrix-table th, .pb-matrix-table td {
  border: 1px solid #1e293b;
  text-align: center;
  padding: 10px 12px;
}

.pb-matrix-table th {
  background: #0b1120;
  color: var(--pb-slate-text);
  font-weight: 700;
}

.pb-matrix-table .diagonal {
  background: #0b1120;
}

/* Head-to-Head Clash Box */
.h2h-clash-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #0b1120;
  border: 1px solid rgba(163, 230, 53, 0.3);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--pb-slate-text);
  font-size: 18px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #1e293b;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fff;
}

/* Standalone SVG Sparkline Chart */
.sparkline-svg {
  width: 100%;
  height: 140px;
}

.sparkline-line {
  fill: none;
  stroke: var(--pb-lime);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sparkline-fill {
  fill: rgba(163, 230, 53, 0.12);
}

.sparkline-dot {
  fill: var(--pb-lime);
  stroke: #080c14;
  stroke-width: 2;
}

/* Utility Helpers */
.hidden { display: none !important; }
.flex { display: flex !important; }
.grid { display: grid !important; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.text-lime { color: var(--pb-lime); }
.text-amber { color: var(--pb-amber); }
.text-slate-muted { color: var(--pb-slate-muted); }
.text-slate-text { color: var(--pb-slate-text); }
.font-black { font-weight: 900; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-tabs { display: none; }
  .mobile-nav { display: flex; }
  .podium-grid { grid-template-columns: 1fr; }
  .h2h-clash-box { grid-template-columns: 1fr; }
}
