/* ============================================================
   widget-themes.css — globalne motywy dla widgetów (v1.7+)
   Każdy motyw definiuje zmienne CSS na elemencie [data-widget-theme]
   Widget używa zmiennych --th-*  (poprzednio --lks-*)
   Backward-compat: --lks-* są aliasami do --th-*
   ============================================================ */

/* Domyślne (Classic — jak było) */
.widget-body[data-widget-theme="classic"],
.widget-body:not([data-widget-theme]){
  --th-bg:        #ffffff;
  --th-bg2:       #fafafa;
  --th-fg:        #0a0a0a;
  --th-muted:     #64748b;
  --th-line:      #e5e7eb;
  --th-accent:    #d92121;
  --th-accent-2:  #f59e0b;
  --th-radius:    0px;
  --th-shadow:    0 1px 0 rgba(0,0,0,.04);
  --th-font:      'IBM Plex Sans', system-ui, sans-serif;
  --th-display:   'Bebas Neue','Oswald',sans-serif;
  --th-card-pad:  16px;
}

/* MODERN — gradient + glassmorphism */
.widget-body[data-widget-theme="modern"]{
  --th-bg:        rgba(255,255,255,.08);
  --th-bg2:       rgba(255,255,255,.14);
  --th-fg:        #ffffff;
  --th-muted:     rgba(255,255,255,.7);
  --th-line:      rgba(255,255,255,.18);
  --th-accent:    #ffd700;
  --th-accent-2:  #fb7185;
  --th-radius:    16px;
  --th-shadow:    0 8px 32px rgba(31,38,135,.25);
  --th-font:      'Inter', system-ui, sans-serif;
  --th-display:   'Bebas Neue','Inter',sans-serif;
  --th-card-pad:  20px;
  background: linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  min-height: 100vh;
}
.widget-body[data-widget-theme="modern"] .widget{
  background: var(--th-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  color: var(--th-fg);
  padding: 0;
  overflow: hidden;
}

/* MINIMAL — biały, czyste */
.widget-body[data-widget-theme="minimal"]{
  --th-bg:        #ffffff;
  --th-bg2:       #f9fafb;
  --th-fg:        #111827;
  --th-muted:     #9ca3af;
  --th-line:      #f3f4f6;
  --th-accent:    #2563eb;
  --th-accent-2:  #6b7280;
  --th-radius:    8px;
  --th-shadow:    none;
  --th-font:      'Inter', system-ui, sans-serif;
  --th-display:   'Inter', system-ui, sans-serif;
  --th-card-pad:  20px;
  background: #fafafa;
}
.widget-body[data-widget-theme="minimal"] .widget{
  background: var(--th-bg);
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius);
  color: var(--th-fg);
  font-family: var(--th-font);
}
.widget-body[data-widget-theme="minimal"] .tbl-title,
.widget-body[data-widget-theme="minimal"] .nm-overline,
.widget-body[data-widget-theme="minimal"] .lr-overline,
.widget-body[data-widget-theme="minimal"] .live-overline,
.widget-body[data-widget-theme="minimal"] .fx-title,
.widget-body[data-widget-theme="minimal"] .countdown-title{
  font-family: var(--th-display) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 18px !important;
  color: var(--th-fg) !important;
}
.widget-body[data-widget-theme="minimal"] .pos,
.widget-body[data-widget-theme="minimal"] .pts,
.widget-body[data-widget-theme="minimal"] .nm-team-name,
.widget-body[data-widget-theme="minimal"] .lr-team-name{
  font-family: var(--th-display) !important;
  font-weight: 600 !important;
}
.widget-body[data-widget-theme="minimal"] .pos,
.widget-body[data-widget-theme="minimal"] .pts{
  color: var(--th-accent) !important;
  font-size: 18px !important;
}
.widget-body[data-widget-theme="minimal"] .tbl-head{
  background: transparent !important;
  border-bottom-color: var(--th-line) !important;
  border-bottom-width: 1px !important;
}
.widget-body[data-widget-theme="minimal"] .nm-vs,
.widget-body[data-widget-theme="minimal"] .lr-score{
  color: var(--th-accent) !important;
}

/* STADIUM — ciemny, neonowy zielony */
.widget-body[data-widget-theme="stadium"]{
  --th-bg:        #0a0e17;
  --th-bg2:       #131822;
  --th-fg:        #e2e8f0;
  --th-muted:     #64748b;
  --th-line:      #1e2530;
  --th-accent:    #10ff95;
  --th-accent-2:  #ffd700;
  --th-radius:    4px;
  --th-shadow:    0 0 24px rgba(16,255,149,.15);
  --th-font:      'IBM Plex Sans', system-ui, sans-serif;
  --th-display:   'Bebas Neue','Oswald',sans-serif;
  --th-card-pad:  16px;
  background: #0a0e17;
  color: var(--th-fg);
}
.widget-body[data-widget-theme="stadium"] .widget{
  background: var(--th-bg2);
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius);
  color: var(--th-fg);
  box-shadow: var(--th-shadow);
}
.widget-body[data-widget-theme="stadium"] .tbl-head,
.widget-body[data-widget-theme="stadium"] .nm-overline,
.widget-body[data-widget-theme="stadium"] .lr-overline,
.widget-body[data-widget-theme="stadium"] .live-overline,
.widget-body[data-widget-theme="stadium"] .fx-head,
.widget-body[data-widget-theme="stadium"] .countdown-head{
  background: var(--th-bg) !important;
  border-bottom: 2px solid var(--th-accent) !important;
  color: var(--th-fg) !important;
}
.widget-body[data-widget-theme="stadium"] .tbl-title,
.widget-body[data-widget-theme="stadium"] .nm-overline,
.widget-body[data-widget-theme="stadium"] .lr-overline,
.widget-body[data-widget-theme="stadium"] .live-overline,
.widget-body[data-widget-theme="stadium"] .fx-title,
.widget-body[data-widget-theme="stadium"] .countdown-title{
  color: var(--th-accent) !important;
  text-shadow: 0 0 12px rgba(16,255,149,.4);
}
.widget-body[data-widget-theme="stadium"] .pos,
.widget-body[data-widget-theme="stadium"] .pts,
.widget-body[data-widget-theme="stadium"] .nm-vs,
.widget-body[data-widget-theme="stadium"] .lr-score,
.widget-body[data-widget-theme="stadium"] .countdown-num,
.widget-body[data-widget-theme="stadium"] .live-score{
  color: var(--th-accent) !important;
  text-shadow: 0 0 8px rgba(16,255,149,.5);
}
.widget-body[data-widget-theme="stadium"] .tbl thead th,
.widget-body[data-widget-theme="stadium"] .tbl tbody td{
  color: var(--th-fg) !important;
  border-bottom-color: var(--th-line) !important;
  background: var(--th-bg2) !important;
}
.widget-body[data-widget-theme="stadium"] .tbl thead th{
  background: var(--th-bg) !important;
  color: var(--th-muted) !important;
}
.widget-body[data-widget-theme="stadium"] .tbl tbody tr:hover td{
  background: rgba(16,255,149,.04) !important;
}
.widget-body[data-widget-theme="stadium"] .tbl tbody tr.is-us td{
  background: rgba(16,255,149,.08) !important;
}
.widget-body[data-widget-theme="stadium"] .tbl tbody tr.is-us td:first-child{
  box-shadow: inset 4px 0 0 var(--th-accent) !important;
}
.widget-body[data-widget-theme="stadium"] .nm-team-name,
.widget-body[data-widget-theme="stadium"] .lr-team-name,
.widget-body[data-widget-theme="stadium"] .fx-team{
  color: var(--th-fg) !important;
}
.widget-body[data-widget-theme="stadium"] .goals{
  color: var(--th-muted) !important;
}

/* RETRO — sepia, scrapbook */
.widget-body[data-widget-theme="retro"]{
  --th-bg:        #f5e6c8;
  --th-bg2:       #ede0c0;
  --th-fg:        #3a2817;
  --th-muted:     #8b6f47;
  --th-line:      #c9b899;
  --th-accent:    #c0392b;
  --th-accent-2:  #d68910;
  --th-radius:    2px;
  --th-shadow:    inset 0 0 0 1px #c9b899, 2px 2px 0 rgba(58,40,23,.1);
  --th-font:      Georgia,'Times New Roman',serif;
  --th-display:   'Bebas Neue','Oswald',serif;
  --th-card-pad:  18px;
  background: #f5e6c8;
  color: var(--th-fg);
}
.widget-body[data-widget-theme="retro"] .widget{
  background: var(--th-bg);
  border: 2px double var(--th-line);
  border-radius: var(--th-radius);
  color: var(--th-fg);
  font-family: var(--th-font);
  box-shadow: var(--th-shadow);
}
.widget-body[data-widget-theme="retro"] .tbl-head,
.widget-body[data-widget-theme="retro"] .nm-overline,
.widget-body[data-widget-theme="retro"] .lr-overline,
.widget-body[data-widget-theme="retro"] .live-overline,
.widget-body[data-widget-theme="retro"] .fx-head,
.widget-body[data-widget-theme="retro"] .countdown-head{
  background: var(--th-bg2) !important;
  border-bottom: 4px double var(--th-accent) !important;
}
.widget-body[data-widget-theme="retro"] .tbl-title,
.widget-body[data-widget-theme="retro"] .nm-overline,
.widget-body[data-widget-theme="retro"] .lr-overline,
.widget-body[data-widget-theme="retro"] .live-overline,
.widget-body[data-widget-theme="retro"] .fx-title{
  color: var(--th-accent) !important;
  font-family: var(--th-display) !important;
  letter-spacing: 4px !important;
}
.widget-body[data-widget-theme="retro"] .pos,
.widget-body[data-widget-theme="retro"] .pts,
.widget-body[data-widget-theme="retro"] .nm-vs,
.widget-body[data-widget-theme="retro"] .lr-score{
  color: var(--th-accent) !important;
  font-family: var(--th-display) !important;
}
.widget-body[data-widget-theme="retro"] .tbl thead th{
  background: var(--th-bg2) !important;
  color: var(--th-muted) !important;
  border-bottom: 1px solid var(--th-line) !important;
  font-family: var(--th-display) !important;
}
.widget-body[data-widget-theme="retro"] .tbl tbody td{
  background: transparent !important;
  border-bottom: 1px dashed var(--th-line) !important;
  color: var(--th-fg) !important;
  font-family: var(--th-font) !important;
}
.widget-body[data-widget-theme="retro"] .tbl tbody tr.is-us td{
  background: rgba(192,57,43,.08) !important;
}
.widget-body[data-widget-theme="retro"] .tbl tbody tr.is-us td:first-child{
  box-shadow: inset 4px 0 0 var(--th-accent) !important;
}
.widget-body[data-widget-theme="retro"] .nm-team-name,
.widget-body[data-widget-theme="retro"] .lr-team-name{
  font-family: var(--th-display) !important;
  color: var(--th-fg) !important;
}

/* ====== Wspólne dla WSZYSTKICH custom motywów (modern/minimal/stadium/retro) ====== */
.widget-body[data-widget-theme="modern"],
.widget-body[data-widget-theme="stadium"],
.widget-body[data-widget-theme="retro"]{
  /* override alias zmiennych --lks-* używanych w widgets.css */
}
.widget-body[data-widget-theme="modern"] .widget *,
.widget-body[data-widget-theme="stadium"] .widget *,
.widget-body[data-widget-theme="retro"] .widget *{
  border-color: var(--th-line);
}

/* Modern — szczegółowe overrides dla każdego widgetu */
.widget-body[data-widget-theme="modern"] .tbl-head,
.widget-body[data-widget-theme="modern"] .nm-overline,
.widget-body[data-widget-theme="modern"] .lr-overline,
.widget-body[data-widget-theme="modern"] .live-overline,
.widget-body[data-widget-theme="modern"] .fx-head,
.widget-body[data-widget-theme="modern"] .countdown-head{
  background: rgba(255,255,255,.05) !important;
  border-bottom: 2px solid var(--th-accent) !important;
  color: var(--th-fg) !important;
  padding: 18px var(--th-card-pad) !important;
}
.widget-body[data-widget-theme="modern"] .tbl-title,
.widget-body[data-widget-theme="modern"] .nm-overline,
.widget-body[data-widget-theme="modern"] .lr-overline,
.widget-body[data-widget-theme="modern"] .fx-title,
.widget-body[data-widget-theme="modern"] .countdown-title,
.widget-body[data-widget-theme="modern"] .live-overline{
  color: var(--th-accent) !important;
  letter-spacing: 3px !important;
}
.widget-body[data-widget-theme="modern"] .pos,
.widget-body[data-widget-theme="modern"] .pts,
.widget-body[data-widget-theme="modern"] .nm-vs,
.widget-body[data-widget-theme="modern"] .lr-score,
.widget-body[data-widget-theme="modern"] .countdown-num{
  color: var(--th-accent) !important;
}
.widget-body[data-widget-theme="modern"] .tbl thead th{
  background: transparent !important;
  color: var(--th-muted) !important;
  border-bottom-color: var(--th-line) !important;
}
.widget-body[data-widget-theme="modern"] .tbl tbody td{
  background: transparent !important;
  border-bottom-color: var(--th-line) !important;
  color: var(--th-fg) !important;
}
.widget-body[data-widget-theme="modern"] .tbl tbody tr:hover td{
  background: rgba(255,255,255,.05) !important;
}
.widget-body[data-widget-theme="modern"] .tbl tbody tr.is-us td{
  background: rgba(255,215,0,.10) !important;
}
.widget-body[data-widget-theme="modern"] .tbl tbody tr.is-us td:first-child{
  box-shadow: inset 4px 0 0 var(--th-accent) !important;
}
.widget-body[data-widget-theme="modern"] .nm-team-name,
.widget-body[data-widget-theme="modern"] .lr-team-name,
.widget-body[data-widget-theme="modern"] .fx-team,
.widget-body[data-widget-theme="modern"] .col-team{
  color: var(--th-fg) !important;
}
.widget-body[data-widget-theme="modern"] .goals{
  color: var(--th-muted) !important;
}

/* Mini-podgląd używany w admin/themes.php (kompaktowa karta z mini-tabelą) */
.theme-preview-card{
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.theme-preview-card:hover{ transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.theme-preview-card.active{ border-color: #d92121; box-shadow: 0 0 0 4px rgba(217,33,33,.15); }
