/* ============================================================
   Helios — Page-specific styles
   Organizer Dashboard, Player Dashboard, Public pages
   ============================================================ */

/* ── Hero Banner ─────────────────────────────────────────────── */
.hero-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}
.hero-banner::after {
  content: '🏆';
  position: absolute;
  right: 32px; top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  opacity: .15;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}
.hero-subtitle { font-size: 14px; opacity: .85; margin-bottom: 20px; }

/* ── Analytics Chart ─────────────────────────────────────────── */
.chart-bar-track {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 4px 0;
}
.chart-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.chart-bar-label {
  width: 90px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.chart-bar-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 8px;
}

/* ── Live Control Panel ──────────────────────────────────────── */
.live-control-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
.score-entry-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.score-set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.score-set-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  width: 50px;
  flex-shrink: 0;
}
.score-input {
  width: 70px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}
.score-input:focus { border-color: var(--brand-primary); }
.score-vs-col { font-size: 12px; color: var(--text-muted); width: 20px; text-align: center; flex-shrink: 0; }
.score-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.score-stepper-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}
.score-stepper-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* ── Quick Actions ───────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
}
.quick-action-btn:hover {
  border-color: var(--brand-primary);
  background: rgba(99,102,241,.04);
  color: var(--brand-primary);
  text-decoration: none;
  transform: translateY(-2px);
}
.quick-action-icon { font-size: 28px; }
.quick-action-label { font-size: 12px; font-weight: 600; text-align: center; }

/* ── Profile Card ────────────────────────────────────────────── */
.profile-hero {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-full);
  border: 4px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  font-weight: 800;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 24px; font-weight: 800; font-family: var(--font-display); }
.profile-role {
  font-size: 12px;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.profile-stats { display: flex; gap: 24px; margin-top: 16px; }
.profile-stat-val { font-size: 22px; font-weight: 800; font-family: var(--font-display); }
.profile-stat-lbl { font-size: 11px; opacity: .75; }

/* ── Win Rate Ring ───────────────────────────────────────────── */
.win-ring {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.win-ring svg { transform: rotate(-90deg); }
.win-ring-track { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 8; }
.win-ring-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: calc(220 - (220 * var(--pct, 0) / 100));
  transition: stroke-dashoffset 1s ease;
}
.win-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}
.win-ring-sub { font-size: 9px; opacity: .7; }

/* ── Match Detail Page ────────────────────────────────────────── */
.match-detail-header {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  border-radius: var(--radius-xl);
  color: #fff;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.match-round-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: .6;
  margin-bottom: 8px;
}
.match-players-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 20px 0;
}
.match-player-col { text-align: center; flex: 1; }
.match-player-bigname { font-size: 22px; font-weight: 800; font-family: var(--font-display); }
.match-player-detail { font-size: 12px; opacity: .6; margin-top: 4px; }
.match-center-score {
  text-align: center;
  flex-shrink: 0;
}
.match-big-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}
.match-score-sep { color: rgba(255,255,255,.3); font-size: 40px; }

/* ── Registration Progress ───────────────────────────────────── */
.reg-progress-bar {
  height: 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0;
}
.reg-progress-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  transition: width .8s ease;
}

/* ── Tab Navigation ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 0;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fade-in .3s ease; }

/* ── Search Bar ──────────────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 360px;
}
.search-bar-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar .form-control {
  padding-left: 40px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.page-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.page-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Floating Action Button (mobile) ─────────────────────────── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(99,102,241,.45);
  cursor: pointer;
  font-size: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  transition: all var(--transition-fast);
}
.fab:hover { transform: scale(1.1); }
@media (max-width: 768px) { .fab { display: flex; } }

/* ── Pull to Refresh ─────────────────────────────────────────── */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .2s;
}

/* ── Dark mode system preference ─────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-base: #0f0f1a;
    --bg-surface: #1a1a2e;
    --bg-elevated: #16213e;
    --bg-overlay: rgba(26,26,46,0.95);
    --bg-sidebar: #0d0d1a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --border: #2d2d4e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.40);
    --shadow-md: 0 4px 16px rgba(0,0,0,.50);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.60);
  }
}

/* Highlight the current player row */
.highlight-player {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}
