/* Global Neon Refresh - sporty neon dark foundation + strong readability */

:root {
  --sp-accent-primary: #00f5d4;
  --sp-accent-secondary: #7a5cff;
  --sp-accent-energy: #ff3d5a;
  --sp-accent-gold: #c9980b;

  --sp-bg-page: #090b14;
  --sp-bg-subtle: #11162a;
  --sp-bg-surface: #171e36;

  --sp-text-primary: #f5f7ff;
  --sp-text-secondary: #d4def4;
  --sp-text-muted: #b8c6e4;
  --sp-text-heading: #e6eeff;
  --sp-heading-shadow: none;

  --sp-border: rgba(184, 194, 224, 0.18);
  --sp-shadow: 0 14px 36px rgba(2, 6, 16, 0.45);

  /* Override legacy token usage in page-level inline CSS */
  --neon-cyan: #00f5d4;
  --neon-green: #00d98b;
  --neon-purple: #7a5cff;
  --neon-blue: #00a3ff;

  --color-text-primary: #f5f7ff;
  --color-text-secondary: #d4def4;
  --color-text-muted: #b8c6e4;
  --color-text-dark: #041018;
  --color-border: rgba(184, 194, 224, 0.2);
  --color-primary: #00f5d4;
  --color-secondary: #7a5cff;
  --color-bg-primary: #090b14;
  --color-background: #090b14;
  --color-background-alt: #11162a;
  --color-surface: rgba(23, 30, 54, 0.9);

  --color-success: #00d98b;
  --color-warning: #f6b73c;
  --color-error: #ff5c7a;
  --color-info: #00a3ff;

  /* Shell-level tokens for standardized bars */
  --shell-bar-bg: linear-gradient(90deg, #131a33 0%, #11162a 45%, #090b14 100%);
  --shell-bar-border: rgba(122, 92, 255, 0.3);
  --shell-bar-text: #eef3ff;
  --shell-search-bg: rgba(9, 11, 20, 0.82);
  --shell-search-border: rgba(184, 194, 224, 0.28);
  --shell-search-placeholder: rgba(184, 194, 224, 0.85);
}

body {
  background: var(--sp-bg-page) !important;
  color: var(--sp-text-primary) !important;
}

main,
.main-content,
.content-area,
.page-container,
.container,
.container-fluid {
  background: var(--sp-bg-page) !important;
  color: var(--sp-text-primary) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.section-title,
.card-title,
.modal-title,
.empty-state-title {
  color: var(--sp-text-heading) !important;
  text-shadow: none !important;
}

p,
span,
small,
label,
.form-text,
.text-muted,
.table,
.table td,
.table th {
  color: var(--sp-text-secondary) !important;
}

/* White-on-white prevention and card readability */
.card,
.surface-panel,
.glass-card,
.feature-card,
.hero-section,
.match-card,
.stat-badge,
.court-btn,
.shortcut-item,
.help-section,
.modal-content,
.dropdown-menu,
.table,
.alert {
  background: var(--sp-bg-surface) !important;
  border: 1px solid var(--sp-border) !important;
  -webkit-backdrop-filter: blur(12px) saturate(115%) !important;
  backdrop-filter: blur(12px) saturate(115%) !important;
  box-shadow: var(--sp-shadow) !important;
  color: var(--sp-text-primary) !important;
}

.match-card,
.stat-badge,
.court-btn {
  outline: 1px solid rgba(0, 245, 212, 0.24);
  outline-offset: 0;
}

.card *,
.surface-panel *,
.glass-card *,
.match-card *,
.stat-badge *,
.modal-content *,
.dropdown-menu * {
  color: var(--sp-text-secondary) !important;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card .card-title,
.match-card .player-name,
.match-card .match-event,
.match-card .match-time,
.match-card .sets,
.match-card .points,
.modal-content .modal-title,
.dropdown-header {
  color: var(--sp-text-primary) !important;
}

.match-card .live-indicator {
  color: var(--sp-accent-energy) !important;
}

.score-display,
.match-court {
  background: rgba(17, 22, 42, 0.72) !important;
  border: 1px solid rgba(184, 194, 224, 0.2) !important;
}

/* Buttons - vivid accents without blue-heavy mood */
.btn-primary,
.btn.btn-primary {
  background: linear-gradient(135deg, var(--sp-accent-primary) 0%, var(--sp-accent-secondary) 100%) !important;
  border: 1px solid rgba(0, 245, 212, 0.4) !important;
  color: #05101a !important;
  font-weight: 700 !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 245, 212, 0.24) !important;
}

.btn-secondary,
.btn-outline-primary,
.btn-outline-light,
.btn.btn-secondary,
.btn.btn-light {
  background: rgba(17, 22, 42, 0.9) !important;
  border: 1px solid rgba(0, 245, 212, 0.34) !important;
  color: var(--sp-text-secondary) !important;
}

/* Forms */
input,
select,
textarea,
.form-control,
.form-select {
  background: rgba(17, 22, 42, 0.86) !important;
  border: 1px solid rgba(184, 194, 224, 0.24) !important;
  color: var(--sp-text-primary) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--sp-text-muted) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--sp-accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.14) !important;
}

/* Tables */
.table-dark,
.table.table-dark,
.bg-dark,
.alert-dark,
pre.bg-black {
  background: var(--sp-bg-surface) !important;
  color: var(--sp-text-primary) !important;
}

.table-dark th,
.table-dark td,
.table.table-dark th,
.table.table-dark td {
  border-color: var(--sp-border) !important;
  color: var(--sp-text-primary) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background: rgba(17, 22, 42, 0.74) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
  background: rgba(23, 30, 54, 0.86) !important;
}

/* Links and nav text in content zones */
a,
.nav-link,
.navbar-nav .nav-link {
  color: var(--sp-accent-primary) !important;
}

a:hover,
.nav-link:hover,
.navbar-nav .nav-link:hover {
  color: #6bfbe7 !important;
}

.badge,
.status-badge {
  background: rgba(17, 22, 42, 0.86) !important;
  border: 1px solid var(--sp-border) !important;
  color: var(--sp-text-primary) !important;
}

/* Ensure text-white utility doesn't disappear on white canvas */
.main-content .text-white,
main .text-white,
.content-area .text-white,
.page-container .text-white,
.container .text-white {
  color: var(--sp-text-primary) !important;
}

/* Keep dark sidebar/primary nav behaviors untouched */
.sidebar .text-white,
.sidebar .nav-link,
.sidebar .nav-text,
.sidebar .user-name,
.sidebar .user-role,
.page-header-top .text-white,
.content-header .text-white {
  color: inherit !important;
}

/* Standardized content headers across pages */
.main-content :is(.page-header, .content-header, .welcome-bar, .welcome-section, .events-header, .events-hero, .live-scoring-header, .stats-header),
.page-container :is(.page-header, .content-header, .welcome-bar, .welcome-section, .events-header, .events-hero, .live-scoring-header, .stats-header) {
  background: linear-gradient(120deg, rgba(23, 30, 54, 0.96) 0%, rgba(17, 22, 42, 0.94) 50%, rgba(9, 11, 20, 0.98) 100%) !important;
  border: 1px solid rgba(122, 92, 255, 0.32) !important;
  box-shadow: var(--sp-shadow) !important;
}

/* Readability hard-stop: avoid white+shadow text in content regions */
.main-content :is(.page-title, .section-title, .welcome-text, .hero-title, .content-header h1, .content-header h2, .content-header h3, .content-header p),
.page-container :is(.page-title, .section-title, .welcome-text, .hero-title, .content-header h1, .content-header h2, .content-header h3, .content-header p) {
  color: var(--sp-text-heading) !important;
  text-shadow: none !important;
}

.main-content :is(p, span, small, label, .text-muted, .text-secondary),
.page-container :is(p, span, small, label, .text-muted, .text-secondary) {
  text-shadow: none !important;
}

/* Card/strip readability: make text white inside metric and surface cards */
.main-content :is(.card, .stat-card, .metric-card, .surface-card, .fixture-card, .queue-item, .surface-panel, .match-card, .events-header, .stats-header, .welcome-bar, .welcome-section)
  :is(p, span, small, label, .text-muted, .text-secondary, .stat-label, .metric-label, .stat-value, .metric-value, .fixture-meta, .fixture-subline, .fixture-badge, .surface-meta, .card-text),
.page-container :is(.card, .stat-card, .metric-card, .surface-card, .fixture-card, .queue-item, .surface-panel, .match-card, .events-header, .stats-header, .welcome-bar, .welcome-section)
  :is(p, span, small, label, .text-muted, .text-secondary, .stat-label, .metric-label, .stat-value, .metric-value, .fixture-meta, .fixture-subline, .fixture-badge, .surface-meta, .card-text) {
  color: #eaf1ff !important;
  text-shadow: none !important;
}

/* Preserve heading accent inside cards while keeping readability */
.main-content :is(.card, .stat-card, .metric-card, .surface-card, .fixture-card, .queue-item, .surface-panel, .match-card)
  :is(h1, h2, h3, h4, h5, h6, .page-title, .section-title, .card-title, .event-title, .tournament-name),
.page-container :is(.card, .stat-card, .metric-card, .surface-card, .fixture-card, .queue-item, .surface-panel, .match-card)
  :is(h1, h2, h3, h4, h5, h6, .page-title, .section-title, .card-title, .event-title, .tournament-name) {
  color: #edf3ff !important;
  text-shadow: none !important;
}

/* Reduce blue cast in alerts/sections */
.alert-info,
.alert-primary,
.bg-primary-subtle {
  background: rgba(0, 245, 212, 0.1) !important;
  color: var(--sp-text-primary) !important;
  border-color: rgba(0, 245, 212, 0.26) !important;
}

:focus-visible {
  outline: 2px solid var(--sp-accent-primary) !important;
  outline-offset: 2px !important;
}
