/**
 * Dark mode – plošně na celém webu Parní Kaktus
 * Aktivuje se třídou .pk-dark-mode na <html>
 * Preference se ukládá v localStorage (pk_theme: light | dark)
 */

html.pk-dark-mode {
  color-scheme: dark;
}

/* Základní pozadí a text */
html.pk-dark-mode body {
  color: #e2e8f0 !important;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 35%, #0f172a 100%) !important;
  background-size: auto !important;
  animation: none !important;
}

html.pk-dark-mode body::before {
  background-image: radial-gradient(circle at 18% 82%, rgba(76, 175, 80, 0.08) 0%, transparent 54%),
    radial-gradient(circle at 82% 18%, rgba(102, 187, 106, 0.06) 0%, transparent 54%),
    radial-gradient(circle at 42% 40%, rgba(139, 195, 74, 0.04) 0%, transparent 52%),
    radial-gradient(circle at 50% 12%, rgba(15, 23, 42, 0.4) 0%, transparent 55%) !important;
}

/* Navigace */
html.pk-dark-mode .modern-nav,
html.pk-dark-mode .modern-header {
  background: rgba(15, 23, 42, 0.95) !important;
  border-bottom-color: rgba(76, 175, 80, 0.4) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.pk-dark-mode .nav-title,
html.pk-dark-mode .site-title {
  color: #e2e8f0 !important;
}

html.pk-dark-mode .nav-link,
html.pk-dark-mode .nav-link-mobile,
html.pk-dark-mode .nav-submenu-item {
  color: #cbd5e1 !important;
}

html.pk-dark-mode .nav-link:hover,
html.pk-dark-mode .nav-link-mobile:hover {
  color: #86efac !important;
  background: rgba(76, 175, 80, 0.15) !important;
}

/* Karty a sekce */
html.pk-dark-mode .card,
html.pk-dark-mode .modern-card,
html.pk-dark-mode .content-container,
html.pk-dark-mode .gallery-item,
html.pk-dark-mode .page-wrapper {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

html.pk-dark-mode .card h2,
html.pk-dark-mode .card h3,
html.pk-dark-mode .page-title,
html.pk-dark-mode .hero-title,
html.pk-dark-mode .hero-subtitle {
  color: #f1f5f9 !important;
}

html.pk-dark-mode .card p,
html.pk-dark-mode .page-subtitle {
  color: #cbd5e1 !important;
}

html.pk-dark-mode .card a {
  color: #86efac !important;
}

html.pk-dark-mode .card a:hover {
  color: #86efac !important;
  text-decoration: underline;
}

/* Tlačítka */
html.pk-dark-mode .nav-button.primary,
html.pk-dark-mode .btn-primary {
  background: rgba(76, 175, 80, 0.25) !important;
  color: #86efac !important;
  border-color: rgba(76, 175, 80, 0.4) !important;
}

html.pk-dark-mode .nav-button.primary:hover,
html.pk-dark-mode .btn-primary:hover {
  background: rgba(76, 175, 80, 0.35) !important;
  color: #bbf7d0 !important;
}

/* Formuláře */
html.pk-dark-mode input,
html.pk-dark-mode select,
html.pk-dark-mode textarea {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #e2e8f0 !important;
}

html.pk-dark-mode input::placeholder,
html.pk-dark-mode textarea::placeholder {
  color: #94a3b8 !important;
}

/* Tabulky */
html.pk-dark-mode table,
html.pk-dark-mode th,
html.pk-dark-mode td {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.pk-dark-mode th {
  background: rgba(30, 41, 59, 0.8) !important;
  color: #f1f5f9 !important;
}

html.pk-dark-mode tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.3) !important;
}

/* Galerie */
html.pk-dark-mode .gallery-controls,
html.pk-dark-mode .custom-select-button,
html.pk-dark-mode .filter-section {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

html.pk-dark-mode .custom-select-dropdown {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.pk-dark-mode .custom-select-option:hover {
  background: rgba(76, 175, 80, 0.2) !important;
}

html.pk-dark-mode .album-download-zip {
  background: rgba(76, 175, 80, 0.25) !important;
  color: #86efac !important;
  border-color: rgba(76, 175, 80, 0.4) !important;
}

html.pk-dark-mode .album-download-zip:hover {
  background: rgba(76, 175, 80, 0.35) !important;
  color: #bbf7d0 !important;
}

/* Správa dokumentů – file-info, info-item */
html.pk-dark-mode .file-info,
html.pk-dark-mode .info-item {
  color: #cbd5e1 !important;
}

html.pk-dark-mode input[type="file"] {
  color: #e2e8f0 !important;
}

html.pk-dark-mode input[type="file"]::file-selector-button {
  background: rgba(76, 175, 80, 0.3) !important;
  color: #86efac !important;
  border-color: rgba(76, 175, 80, 0.5) !important;
}

/* Rozbalovací menu (nastym, nav-submenu) */
html.pk-dark-mode .nav-submenu,
html.pk-dark-mode .nav-submenu-mobile,
html.pk-dark-mode .dropdown-menu,
html.pk-dark-mode .dropdown-menu-mobile {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.pk-dark-mode .nav-submenu-item,
html.pk-dark-mode .nav-submenu-item-mobile,
html.pk-dark-mode .dropdown-menu a,
html.pk-dark-mode .dropdown-item {
  color: #e2e8f0 !important;
}

html.pk-dark-mode .nav-submenu-item:hover,
html.pk-dark-mode .nav-submenu-item-mobile:hover,
html.pk-dark-mode .dropdown-menu a:hover,
html.pk-dark-mode .dropdown-item:hover {
  background: rgba(76, 175, 80, 0.2) !important;
  color: #bbf7d0 !important;
}

/* Historie zápasů – tabulka statistik */
html.pk-dark-mode #stats-table-container table td,
html.pk-dark-mode .table-container table td,
html.pk-dark-mode .modern-table td {
  color: #e2e8f0 !important;
}

html.pk-dark-mode #stats-table-container table tbody tr:nth-child(odd) td,
html.pk-dark-mode .table-container table tbody tr:nth-child(odd) td {
  background: rgba(30, 41, 59, 0.5) !important;
}

/* Kompletní statistiky – hodnoty v buňkách */
html.pk-dark-mode #stats-table td,
html.pk-dark-mode .modern-table td {
  color: #e2e8f0 !important;
}

html.pk-dark-mode .stat-value,
html.pk-dark-mode .stat-badge {
  color: #e2e8f0 !important;
}

/* E-shop – Filtrovat podle kategorie, Tabulka velikostí, Pro veřejnost */
html.pk-dark-mode .filter-title,
html.pk-dark-mode .filter-label,
html.pk-dark-mode .eshop-filter-label,
html.pk-dark-mode .size-chart-link,
html.pk-dark-mode .size-chart-link-wrap {
  color: #e2e8f0 !important;
}

html.pk-dark-mode .size-chart-link {
  background: rgba(76, 175, 80, 0.25) !important;
  color: #86efac !important;
  border-color: rgba(76, 175, 80, 0.4) !important;
}

html.pk-dark-mode .category-section-title,
html.pk-dark-mode .products-section-title {
  color: #e2e8f0 !important;
}

/* Galerie – placeholder v selectu */
html.pk-dark-mode .custom-select-button .album-name,
html.pk-dark-mode .selected-album-display .album-name {
  color: #e2e8f0 !important;
}

html.pk-dark-mode .custom-select-button {
  color: #e2e8f0 !important;
}

/* Back to top – tmavý styl */
html.pk-dark-mode .pk-back-to-top {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(76, 175, 80, 0.5) !important;
  color: #86efac !important;
}

/* Dark mode toggle */
.pk-dark-mode-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(47, 107, 31, 0.9);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 20px rgba(47, 107, 31, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.pk-dark-mode-toggle:hover {
  opacity: 1;
  transform: scale(1.08);
  background: rgba(47, 107, 31, 1);
}

.pk-dark-mode-toggle svg {
  width: 1.4rem;
  height: 1.4rem;
}

html.pk-dark-mode .pk-dark-mode-toggle {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(76, 175, 80, 0.5);
  color: #86efac;
}

html.pk-dark-mode .pk-dark-mode-toggle:hover {
  background: rgba(76, 175, 80, 0.3);
}

/* Portál hráče – další přepsání */
html.pk-dark-mode body.pk-portal-hrac,
html.pk-dark-mode .pk-portal-hrac {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
  color: #e2e8f0 !important;
}

html.pk-dark-mode .main-content,
html.pk-dark-mode .content-container,
html.pk-dark-mode .empty-state {
  background: transparent !important;
  color: #e2e8f0 !important;
}

html.pk-dark-mode .empty-state h3,
html.pk-dark-mode .empty-state p {
  color: #cbd5e1 !important;
}

/* Odkazy obecně */
html.pk-dark-mode a {
  color: #86efac;
}

html.pk-dark-mode a:hover {
  color: #bbf7d0;
}

@media (max-width: 768px) {
  .pk-dark-mode-toggle {
    bottom: 1.5rem;
    left: 1.5rem;
    width: 3rem;
    height: 3rem;
  }
  .pk-dark-mode-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
  }
}
