/* PadelStream — light theme (html[data-theme="light"]). Dark remains default in app.css */

html[data-theme="light"] {
  color-scheme: light;
}

/* --- Page background & base text --- */
html[data-theme="light"] body.app-bg,
html[data-theme="light"] .app-bg {
  color: #0f172a;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(45, 212, 191, 0.18), transparent 58%),
    radial-gradient(780px 480px at 88% 0%, rgba(59, 130, 246, 0.2), transparent 58%),
    radial-gradient(700px 420px at 72% 92%, rgba(168, 85, 247, 0.12), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 55%, #f1f5f9 100%);
}

/* Bootstrap utilities used across app */
html[data-theme="light"] .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .text-white-50 {
  color: rgba(15, 23, 42, 0.55) !important;
}
html[data-theme="light"] .bg-dark {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .border-white {
  border-color: rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] .border-white.border-opacity-10 {
  border-color: rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] .border-white.border-opacity-25 {
  border-color: rgba(15, 23, 42, 0.18) !important;
}

/* Glass surfaces */
html[data-theme="light"] .app-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

/* Admin pie chart: glass wrapper (light theme) */
html[data-theme="light"] .app-admin-pie-canvas-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78));
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 14px 38px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .app-admin-pie-canvas-wrap::before {
  opacity: 0.55;
}

html[data-theme="light"] .app-glass--nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

/* Navbar links & brand */
html[data-theme="light"] .app-nav-link {
  color: rgba(15, 23, 42, 0.88) !important;
  text-shadow: none;
}
html[data-theme="light"] .app-nav-link:hover,
html[data-theme="light"] .app-nav-link:focus {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .app-nav-link.active {
  color: #0f172a !important;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}
html[data-theme="light"] .app-brand-name {
  color: #0f172a;
}
html[data-theme="light"] .navbar-toggler-icon {
  filter: invert(1);
}

/* Club switcher */
html[data-theme="light"] .app-club-switcher .dropdown-menu.app-club-switcher__menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] .app-club-switcher__btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.75);
  color: #0f172a;
}
html[data-theme="light"] .app-club-switcher__btn:hover,
html[data-theme="light"] .app-club-switcher__btn:focus-visible {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.22);
  color: #0f172a;
}
html[data-theme="light"] .app-club-switcher__item {
  color: #0f172a !important;
}
html[data-theme="light"] .app-club-switcher__item:hover,
html[data-theme="light"] .app-club-switcher__item:focus-visible {
  background: rgba(59, 130, 246, 0.1) !important;
}
html[data-theme="light"] .app-club-switcher__item.active {
  background: rgba(99, 102, 241, 0.14) !important;
}
html[data-theme="light"] .app-club-switcher__mark img {
  filter: none;
  opacity: 1;
}

/* Language & user dropdown panels */
html[data-theme="light"] .app-lang-menu,
html[data-theme="light"] .app-user-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.1) !important;
}
html[data-theme="light"] .app-lang-menu .dropdown-item,
html[data-theme="light"] .app-user-menu .dropdown-item {
  color: #0f172a !important;
}
html[data-theme="light"] .app-lang-menu .dropdown-item:hover,
html[data-theme="light"] .app-user-menu .dropdown-item:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .app-lang-btn,
html[data-theme="light"] .app-user-btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
}
html[data-theme="light"] .app-user-initials {
  color: #0f172a;
}

html[data-theme="light"] .app-user-menu__identity .app-user-menu__name {
  color: #0f172a !important;
}
html[data-theme="light"] .app-user-theme-opt {
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: rgba(248, 250, 252, 0.95) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .app-user-theme-opt:hover {
  background: rgba(59, 130, 246, 0.1) !important;
}
html[data-theme="light"] .app-user-theme-opt.is-active {
  border-color: rgba(59, 130, 246, 0.45) !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

html[data-theme="light"] .app-settings-club-list {
  color: #0f172a !important;
}

html[data-theme="light"] .app-drawer--settings .app-drawer__body--settings {
  color: #0f172a;
}

html[data-theme="light"] .app-drawer--settings .app-settings-field {
  color: #0f172a !important;
}
html[data-theme="light"] .app-drawer--settings .app-settings-field::placeholder {
  color: rgba(15, 23, 42, 0.45) !important;
}
html[data-theme="light"] .app-drawer--settings .app-settings-field--readonly {
  color: rgba(15, 23, 42, 0.72) !important;
}
html[data-theme="light"] .app-drawer--settings .app-settings-field--file {
  color: #0f172a !important;
}

html[data-theme="light"] .app-user-bg-on .app-tournament-item,
html[data-theme="light"] .app-user-bg-on .card.app-glass {
  background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), var(--app-user-card-bg);
  background-size: cover;
  background-position: center;
}

/* Footer */
html[data-theme="light"] .app-footer-links,
html[data-theme="light"] .app-footer-copy,
html[data-theme="light"] .app-footer-link {
  color: rgba(15, 23, 42, 0.55);
}
html[data-theme="light"] .app-footer-link:hover {
  color: #0f172a;
}

/* Cards & tournament UI */
html[data-theme="light"] .app-tournament-item {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .app-tournament-item:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(59, 130, 246, 0.22);
}
html[data-theme="light"] .app-tournament-item.is-selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.28);
}
html[data-theme="light"] .app-tournament-row__club {
  color: #334155 !important;
}

/* Live page (custom UI blocks in live.asp) */
html[data-theme="light"] body.app-live-page .app-live-name,
html[data-theme="light"] body.app-live-page .app-live-team {
  color: #0f172a !important;
}
html[data-theme="light"] body.app-live-page .app-live-num {
  color: rgba(15, 23, 42, 0.88) !important;
}
html[data-theme="light"] body.app-live-page .app-live-table th {
  color: rgba(15, 23, 42, 0.62) !important;
}
html[data-theme="light"] body.app-live-page .h5.text-white,
html[data-theme="light"] body.app-live-page .h6.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] body.app-live-page .app-live-vs {
  color: rgba(15, 23, 42, 0.55) !important;
}

html[data-theme="light"] body.app-live-page .app-live-row td {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] body.app-live-page .app-live-match,
html[data-theme="light"] body.app-live-page .app-live-results-item {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] body.app-live-page .app-live-results-scoreline {
  color: rgba(15, 23, 42, 0.72) !important;
}
html[data-theme="light"] body.app-live-page .app-live-results-scoreline code {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Live results round dropdown (custom glass dropdown) */
html[data-theme="light"] body.app-live-page .app-live-round-btn {
  background: rgba(255, 255, 255, 0.90) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] body.app-live-page .app-live-round-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12) !important;
}
html[data-theme="light"] body.app-live-page .app-live-round-opt {
  color: #0f172a !important;
}
html[data-theme="light"] body.app-live-page .app-live-round-opt:hover,
html[data-theme="light"] body.app-live-page .app-live-round-opt:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}
html[data-theme="light"] body.app-live-page .app-live-round-opt.is-active {
  background: rgba(59, 130, 246, 0.12) !important;
}

/* List row action buttons: base styles use white icon on light cards — fix contrast */
html[data-theme="light"] .app-tournament-row__btn-edit {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
html[data-theme="light"] .app-tournament-row__btn-edit:hover {
  color: #0f172a !important;
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}
html[data-theme="light"] .app-tournament-row__btn-hide {
  color: #b91c1c !important;
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
}
html[data-theme="light"] .app-tournament-row__btn-hide:hover {
  color: #7f1d1d !important;
  background: rgba(248, 113, 113, 0.2) !important;
  border-color: rgba(185, 28, 28, 0.45) !important;
}

html[data-theme="light"] .app-badge {
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .app-badge--neutral {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(100, 116, 139, 0.28);
  color: #334155;
}
html[data-theme="light"] .app-badge--success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(22, 163, 74, 0.35);
  color: #14532d;
}
html[data-theme="light"] a.app-badge.app-badge--link.app-badge--neutral {
  color: #334155 !important;
}
html[data-theme="light"] a.app-badge.app-badge--link.app-badge--success {
  color: #14532d !important;
}

/* Drawers & modals */
html[data-theme="light"] .app-drawer-overlay {
  background: rgba(15, 23, 42, 0.25);
}
html[data-theme="light"] .app-drawer__head,
html[data-theme="light"] .app-drawer__foot {
  border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .app-drawer__head--rail {
  border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .app-wiz-step {
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .app-team-card {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.85);
}
html[data-theme="light"] .app-team-card__title {
  color: rgba(15, 23, 42, 0.65);
}
html[data-theme="light"] .app-team-card__name {
  color: #0f172a;
}
html[data-theme="light"] .app-team-card__name--muted {
  color: rgba(15, 23, 42, 0.45);
}
html[data-theme="light"] #playersTeamsDrawer .app-team-card[data-team-kind="unpaired"] .app-team-card__name--muted {
  color: #2563eb;
  font-weight: 600;
}
html[data-theme="light"] .app-drawer--teams.is-teams-pair-drag.is-pair-dnd-active .app-team-card[data-team-kind="unpaired"].is-pair-drop-pool {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.72));
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 4px 22px rgba(37, 99, 235, 0.12),
    0 0 18px rgba(59, 130, 246, 0.1);
}
html[data-theme="light"] .app-drawer--teams.is-teams-pair-drag.is-pair-dnd-active .app-team-card[data-team-kind="unpaired"].is-pair-drop-pool.is-drop-target {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.22), rgba(255, 255, 255, 0.88));
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 8px 32px rgba(37, 99, 235, 0.18),
    0 0 26px rgba(59, 130, 246, 0.16);
}
html[data-theme="light"] .app-team-card--pair-drag-ghost {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.38), rgba(255, 255, 255, 0.82)) !important;
  border-color: rgba(37, 99, 235, 0.45) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 16px 48px rgba(15, 23, 42, 0.18),
    0 0 28px rgba(59, 130, 246, 0.2);
}
html[data-theme="light"] .app-team-card--pair-drag-ghost .app-team-card__title {
  color: rgba(30, 58, 138, 0.85) !important;
}
html[data-theme="light"] .app-team-card--pair-drag-ghost .app-team-card__name {
  color: #0f172a !important;
}
html[data-theme="light"] .app-team-card--pair-drag-ghost .app-team-card__name--muted {
  color: rgba(30, 64, 175, 0.75) !important;
}
html[data-theme="light"] .app-drawer--teams.is-teams-pair-drag .app-team-card[data-team-kind="pair"] {
  opacity: 1;
  filter: none;
}
html[data-theme="light"] .app-drawer--teams.is-teams-pair-drag .app-team-card[data-team-kind="swap"] {
  opacity: 0.45;
  filter: grayscale(0.35) brightness(0.92);
}

html[data-theme="light"] .app-modal-overlay {
  background: rgba(15, 23, 42, 0.35);
}
html[data-theme="light"] .app-modal.app-glass {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.15);
}
html[data-theme="light"] .app-modal__head,
html[data-theme="light"] .app-modal__body,
html[data-theme="light"] .app-modal__foot {
  border-color: rgba(15, 23, 42, 0.1);
}

/* Form controls in drawers / pages */
html[data-theme="light"] .form-control.bg-dark {
  background-color: #fff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
html[data-theme="light"] .form-select.bg-dark {
  background-color: #fff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
html[data-theme="light"] .form-check-input.bg-dark {
  background-color: #e2e8f0 !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
}

html[data-theme="light"] .app-datetime-split input[type="date"],
html[data-theme="light"] .app-datetime-split input[type="time"] {
  color-scheme: light;
}
html[data-theme="light"] .app-drawer .app-datetime-split input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] .app-drawer .app-datetime-split input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.65;
}

/* Buttons */
html[data-theme="light"] .btn-outline-light {
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.22) !important;
  background: rgba(255, 255, 255, 0.7);
}
html[data-theme="light"] .btn-outline-light:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .btn-sm.btn-outline-light {
  border-color: rgba(15, 23, 42, 0.18) !important;
}

/* Scrollbars in teams rail */
html[data-theme="light"] .app-drawer__body--teams {
  scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
}
html[data-theme="light"] .app-drawer__body--teams::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
}

/* Result rows */
html[data-theme="light"] .app-result-row {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.75);
}

/* Alerts (inline tournament / players) */
html[data-theme="light"] .alert.border-0[style*="background:rgba(255"] {
  color: #334155 !important;
}

/* Home / stats placeholders */
html[data-theme="light"] a.text-white,
html[data-theme="light"] .h5.text-white,
html[data-theme="light"] .h6.text-white {
  color: #0f172a !important;
}

/* Glass tooltips — light theme */
html[data-theme="light"] .app-tooltip-glass__btn {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: rgba(15, 23, 42, 0.75);
}
html[data-theme="light"] .app-tooltip-glass__body,
html[data-theme="light"] .app-tooltip-glass--floating {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
