/* ==========================================================================
   bakus.sk – tmavý režim
   Aktivuje se atributem <html data-theme="dark"> (nastavuje theme.js).
   Princip: přebíjíme barvy Tailwind tříd a vlastní CSS; světlý vzhled se nemění.
   Paleta: pozadí #0b1220 | plochy #111a2e / #16213a | okraje #26334d
           text #e5e7eb | tlumený text #9ca3af | akcent #93c5fd
   ========================================================================== */

/* --- Přepínač (ikona slunce/měsíce, jednobarevná bootstrap ikona) --- */
#theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: .5rem;
  background: transparent; border: 0; cursor: pointer;
  color: #4b5563; font-size: 1.15rem; line-height: 1;
  transition: color .2s, background-color .2s;
}
#theme-toggle:hover { color: #0C2C66; background-color: rgba(96,165,250,.12); }
#theme-toggle:focus-visible { outline: 2px solid #0C2C66; outline-offset: 2px; }
/* světlý režim ukazuje měsíc (= přepnout na tmavý), tmavý ukazuje slunce */
#theme-toggle .bi-sun-fill { display: none; }
html[data-theme="dark"] #theme-toggle .bi-sun-fill { display: inline-block; }
html[data-theme="dark"] #theme-toggle .bi-moon-fill { display: none; }
html[data-theme="dark"] #theme-toggle { color: #e5e7eb; }
html[data-theme="dark"] #theme-toggle:hover { color: #fde68a; background-color: rgba(255,255,255,.08); }

/* --- Základ --- */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0b1220; color: #e5e7eb; }

/* --- Hlavička a menu --- */
html[data-theme="dark"] #site-header { background: rgba(11,18,32,.85); box-shadow: 0 1px 0 #26334d; }
html[data-theme="dark"] #mobile-menu { background: rgba(11,18,32,.97); border-color: #26334d; }
html[data-theme="dark"] .nav-link { color: #cbd5e1; }
html[data-theme="dark"] .nav-link:hover { color: #93c5fd; background-color: rgba(96,165,250,.12); }
html[data-theme="dark"] .nav-link--cta,
html[data-theme="dark"] .nav-link--cta:hover { color: #93c5fd; }
html[data-theme="dark"] .mob-link { color: #cbd5e1; border-bottom-color: #26334d; }
html[data-theme="dark"] .mob-link:hover,
html[data-theme="dark"] .mob-link--cta { color: #93c5fd; }
html[data-theme="dark"] #mobile-menu-button { color: #cbd5e1; }
html[data-theme="dark"] #mobile-menu-button:hover { background-color: rgba(96,165,250,.12); color: #93c5fd; }
/* logo je tmavé na průhledném pozadí → světlá "pilulka" */
html[data-theme="dark"] .logo-wrap { background: rgba(255,255,255,.92); }

/* --- Tailwind třídy: pozadí --- */
html[data-theme="dark"] .bg-white { background-color: #111a2e; }
html[data-theme="dark"] .bg-white\/80,
html[data-theme="dark"] .bg-white\/95 { background-color: rgba(17,26,46,.85); }
html[data-theme="dark"] .bg-\[\#f9f9f9\] { background-color: #0e1627; }
html[data-theme="dark"] .bg-slate-100 { background-color: #1b2740; }
html[data-theme="dark"] .bg-blue-50 { background-color: rgba(96,165,250,.14); }
html[data-theme="dark"] .from-slate-50,
html[data-theme="dark"] .from-slate-100 { --tw-gradient-from: #111a2e var(--tw-gradient-from-position); --tw-gradient-to: rgba(17,26,46,0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
html[data-theme="dark"] .via-white { --tw-gradient-stops: var(--tw-gradient-from), #0e1627 var(--tw-gradient-via-position), var(--tw-gradient-to); }
html[data-theme="dark"] .to-slate-50,
html[data-theme="dark"] .to-slate-100 { --tw-gradient-to: #16213a var(--tw-gradient-to-position); }
html[data-theme="dark"] .from-blue-50 { --tw-gradient-from: #14203a var(--tw-gradient-from-position); --tw-gradient-to: rgba(20,32,58,0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }

/* --- Tailwind třídy: okraje --- */
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200 { border-color: #26334d; }
html[data-theme="dark"] .border-blue-200 { border-color: #2c4a7c; }
html[data-theme="dark"] .border-white { border-color: #26334d; }

/* --- Tailwind třídy: text --- */
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-slate-800 { color: #f1f5f9; }
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-slate-700 { color: #dbe2ec; }
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-600 { color: #b6c0cf; }
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-gray-500 { color: #9ca3af; }
html[data-theme="dark"] .text-\[\#0C2C66\] { color: #93c5fd; }
html[data-theme="dark"] .text-blue-600 { color: #60a5fa; }
html[data-theme="dark"] .text-violet-700 { color: #c4b5fd; }
html[data-theme="dark"] .text-emerald-700 { color: #6ee7b7; }
html[data-theme="dark"] .text-cyan-700 { color: #67e8f9; }
html[data-theme="dark"] .text-amber-700 { color: #fcd34d; }
/* texty uvnitř barevných hlaviček a tlačítek zůstávají bílé */
html[data-theme="dark"] .bg-\[\#0C2C66\] .text-\[\#0C2C66\],
html[data-theme="dark"] .btn .text-\[\#0C2C66\] { color: #fff; }

/* --- Vlastní komponenty --- */
html[data-theme="dark"] .section-title { color: #f1f5f9; }
html[data-theme="dark"] .section-subtitle { color: #b6c0cf; }
html[data-theme="dark"] .btn-primary { background-color: #1d4ed8; }
html[data-theme="dark"] .btn-primary:hover { background-color: #2563eb; }

/* Reference (čísla) */
html[data-theme="dark"] .ref-section,
html[data-theme="dark"] .kontakt-section { background: linear-gradient(160deg, #0b1220 0%, #0e1830 50%, #0b1424 100%); }
html[data-theme="dark"] .ref-title,
html[data-theme="dark"] .ref-num,
html[data-theme="dark"] .kontakt-title { color: #93c5fd; }
html[data-theme="dark"] .ref-subtitle,
html[data-theme="dark"] .kontakt-sub,
html[data-theme="dark"] .ref-label { color: #9ca3af; }
html[data-theme="dark"] .ref-card,
html[data-theme="dark"] .kcard { background: #111a2e; border-color: #26334d; box-shadow: 0 4px 24px rgba(0,0,0,.35); }
html[data-theme="dark"] .ref-icon-wrap,
html[data-theme="dark"] .kinfo-icon { background: linear-gradient(135deg, #1b2a4a, #1e3a6e); color: #93c5fd; }

/* Aktuality + carousel */
html[data-theme="dark"] .news-carousel {
  --nc-bg: #0e1627; --nc-card-bg: #111a2e; --nc-border: #26334d;
  --nc-accent: #93c5fd; --nc-text: #e5e7eb; --nc-muted: #9ca3af;
}
html[data-theme="dark"] .nc-arrow { background: #111a2e; }
html[data-theme="dark"] .nc-arrow:hover { color: #0b1220; }
html[data-theme="dark"] .aktuality-wrapper { border-color: #26334d; box-shadow: 0 4px 24px rgba(0,0,0,.4); }
html[data-theme="dark"] .aktuality-content { background: #111a2e; }

/* Kontaktní formulář */
html[data-theme="dark"] .kinput { background: #0e1627; border-color: #2a3956; color: #e5e7eb; }
html[data-theme="dark"] .kinput:focus { background: #111a2e; border-color: #60A5FA; }
html[data-theme="dark"] .kinput::placeholder { color: #6b7280; }
html[data-theme="dark"] .kgdpr label { color: #b6c0cf; }
html[data-theme="dark"] .khint,
html[data-theme="dark"] .kinfo-section-label,
html[data-theme="dark"] .kinfo-label { color: #8b96a8; }
html[data-theme="dark"] .kinfo-row { border-bottom-color: #26334d; }
html[data-theme="dark"] .kinfo-val { color: #e5e7eb; }
html[data-theme="dark"] .kinfo-val a { color: #93c5fd; }
html[data-theme="dark"] .kmap { border-color: #26334d; }
html[data-theme="dark"] .kmap iframe { filter: invert(.9) hue-rotate(180deg) brightness(.95) contrast(.9); }
html[data-theme="dark"] #my-form-status.ok { color: #86efac; }
html[data-theme="dark"] #my-form-status.err { color: #fca5a5; }
html[data-theme="dark"] .kontakt-badge { background: rgba(96,165,250,.14); border-color: #2c4a7c; color: #93c5fd; }

/* Prvky s inline stylem ve formuláři / kontaktech (nutné !important) */
html[data-theme="dark"] #kontakt [style*="background: white"] { background: #16213a !important; border-color: #2a3956 !important; }
html[data-theme="dark"] #kontakt [style*="linear-gradient(135deg, #f8faff"] { background: #14203a !important; }
html[data-theme="dark"] #kontakt [style*="linear-gradient(135deg, #e8f0fe"],
html[data-theme="dark"] #kontakt [style*="linear-gradient(135deg, #e6f9f0"],
html[data-theme="dark"] #kontakt [style*="linear-gradient(135deg, #f0eeff"],
html[data-theme="dark"] #kontakt [style*="linear-gradient(135deg, #fff4e6"] { background: #1b2a4a !important; }
html[data-theme="dark"] #kontakt [style*="color: #0C2C66"],
html[data-theme="dark"] #kontakt [style*="color: #1e3a5f"] { color: #93c5fd !important; }
html[data-theme="dark"] #kontakt [style*="color: #4b5563"],
html[data-theme="dark"] #kontakt [style*="color: #6b7280"] { color: #b6c0cf !important; }
html[data-theme="dark"] #kontakt [style*="color: #9ca3af"] { color: #8b96a8 !important; }
html[data-theme="dark"] #kontakt [style*="border: 1px solid #e5e7eb"] { border-color: #2a3956 !important; }

/* Stránka ESG (esg.html používá stejné třídy; doplňky) */
html[data-theme="dark"] .prose { color: #dbe2ec; }
html[data-theme="dark"] .prose :where(h1,h2,h3,h4,strong) { color: #f1f5f9; }

/* Plynulý přechod (jen po kliknutí, aby se při načtení nebliklo) */
html.theme-anim, html.theme-anim body, html.theme-anim section, html.theme-anim header,
html.theme-anim article, html.theme-anim .ref-card, html.theme-anim .kcard {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* --- Doplněk: formulář "Máte záujem o nacenenie prepravy?" (zpravodaj) --- */
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: #0e1627; color: #e5e7eb; border-color: #2a3956;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6b7280; opacity: 1; }
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] textarea:focus { background-color: #111a2e; border-color: #60a5fa; --tw-ring-color: #60a5fa; }
/* Karta s formulářem (bg-[#f9f9f9] + border-gray-200 + shadow-md) */
html[data-theme="dark"] .bg-\[\#f9f9f9\].shadow-md { background-color: #111a2e; border-color: #26334d; box-shadow: 0 4px 24px rgba(0,0,0,.4); }
/* Tlačítko Odoslať – tlumenější, ať neoslňuje */
html[data-theme="dark"] .from-blue-500 { --tw-gradient-from: #1d4ed8 var(--tw-gradient-from-position); --tw-gradient-to: rgba(29,78,216,0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
html[data-theme="dark"] .to-blue-600 { --tw-gradient-to: #2563eb var(--tw-gradient-to-position); }
html[data-theme="dark"] .shadow-blue-500\/30 { --tw-shadow-color: rgba(37,99,235,.35); }

/* --- Doplněk: tabulka služeb – hover řádku a dělicí čáry --- */
html[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: #26334d; }
html[data-theme="dark"] .hover\:bg-slate-50\/80:hover { background-color: rgba(96,165,250,.10); }
html[data-theme="dark"] .hover\:bg-blue-50:hover { background-color: rgba(96,165,250,.14); }
html[data-theme="dark"] .hover\:shadow-xl:hover { --tw-shadow-color: rgba(0,0,0,.5); }

/* Barevné štítky ve sloupci "Výhoda" – tmavé průsvitné pozadí místo světlého */
html[data-theme="dark"] .bg-emerald-50 { background-color: rgba(52,211,153,.14); }
html[data-theme="dark"] .bg-cyan-50    { background-color: rgba(34,211,238,.14); }
html[data-theme="dark"] .bg-amber-50   { background-color: rgba(251,191,36,.14); }
html[data-theme="dark"] .bg-violet-50  { background-color: rgba(167,139,250,.16); }

/* --- reCAPTCHA ---
   Widget běží v cizím iframe, vnitřek nejde stylovat. Oficiální data-theme="dark" by vyžadoval
   znovu vykreslit widget při každém přepnutí, proto použijeme inverzi barev (přepíná se okamžitě). */
html[data-theme="dark"] .g-recaptcha { color-scheme: light; }
html[data-theme="dark"] .g-recaptcha iframe,
html[data-theme="dark"] iframe[title*="recaptcha challenge"],
html[data-theme="dark"] iframe[src*="recaptcha/api2/bframe"] {
  filter: invert(1) hue-rotate(180deg);
  border-radius: 3px;
}
/* Checkbox s GDPR souhlasem */
html[data-theme="dark"] .kgdpr input[type="checkbox"] { background-color: #0e1627; border-color: #3b4c6e; }
html[data-theme="dark"] .kgdpr input[type="checkbox"]:checked { background-color: #2563eb; border-color: #2563eb; }
