/* Noční režim LOGBOOKU (1. fáze – báze mobileBase + mobileBaseNew).
   Původní světlé CSS se neupravuje: když je na <html> atribut data-theme="dark",
   tenhle soubor ho jen překryje. Přepíná se tlačítkem vpravo dole
   (components/nocniRezim/tlacitko.html.twig), volba se drží v localStorage. */

/* ---- základ stránky ---- */
[data-theme="dark"] body {
    background: #15191d;
    color: #e4e6e8;
}

[data-theme="dark"] header,
[data-theme="dark"] .fixed-header {
    background: #22303d !important;
    color: #e4e6e8;
}

[data-theme="dark"] footer {
    background: #1a2026;
    color: #e4e6e8;
}

/* ---- nadpisy a odkazy, které mají natvrdo černou ---- */
[data-theme="dark"] .font-header,
[data-theme="dark"] .font-header:hover,
[data-theme="dark"] .font-header-simple,
[data-theme="dark"] .font-header-simple-2,
[data-theme="dark"] .font-locator {
    color: #e4e6e8;
}

[data-theme="dark"] a:focus,
[data-theme="dark"] a:hover {
    color: #cfd4d8;
}

/* Černé odkazy (přihlášení, registrace apod.) */
[data-theme="dark"] .link-black,
[data-theme="dark"] .link-black:hover {
    color: #e4e6e8;
}

[data-theme="dark"] .btn {
    color: #e4e6e8;
}

/* ---- tabulky (deníky, spojení) ---- */
[data-theme="dark"] .table {
    color: #e4e6e8;
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: #232a31;
}

[data-theme="dark"] .evenClassName {
    background-color: #232a31 !important;
}

[data-theme="dark"] .oddClassName {
    background-color: #1a2026 !important;
}

/* Doma sed = fialové řádky, mobil = zelené – v nočním režimu tmavší odstíny,
   aby barevné rozlišení typu deníku zůstalo čitelné. */
[data-theme="dark"] .oddStayHome {
    background: #3a3868 !important;
}

[data-theme="dark"] .evenStayHome {
    background: #2e2c55 !important;
}

[data-theme="dark"] .oddMobile {
    background: #2f5540 !important;
}

[data-theme="dark"] .evenMobile {
    background: #264534 !important;
}

/* ---- formuláře ---- */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-control-custom,
[data-theme="dark"] .form-control-custom-center {
    background-color: #20262c;
    color: #e4e6e8;
    border-color: #4a555f;
}

[data-theme="dark"] ::placeholder {
    color: #9aa4ad;
    opacity: 1;
}

/* Šipka v selectu je ve světlém režimu černý PNG obrázek – na tmavém pozadí
   by zmizela, proto světlé SVG. */
[data-theme="dark"] select:not([multiple]) {
    background-color: #20262c;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='12' viewBox='0 0 14 12'%3E%3Cpath fill='%23e4e6e8' d='M2 4l5 5 5-5z'/%3E%3C/svg%3E");
}

[data-theme="dark"] select:disabled {
    background-color: #2a3138;
    color: #9aa4ad;
}

[data-theme="dark"] .style-azimuth[type="text"][disabled] {
    color: #cfd4d8;
    background-color: #2a3138;
}

[data-theme="dark"] .style-azimuth::placeholder {
    color: #cfd4d8;
}

[data-theme="dark"] #diary_callName:focus,
[data-theme="dark"] #diary_gps:focus {
    border-color: #8bc3f2 !important;
}

/* Datum založení deníku má bílé pozadí inline v šabloně (_form.html.twig) –
   tady ho !important přetlačí na tmavé. */
[data-theme="dark"] #diary_startDate {
    background-color: #20262c !important;
    color: #e4e6e8;
}

/* Velké X checkboxy v logbooku */
[data-theme="dark"] .checkboxes {
    background: #20262c;
    border-color: #9aa4ad;
}

[data-theme="dark"] .checkboxes:checked:before {
    background: transparent;
}

[data-theme="dark"] .checkboxes:checked:after {
    color: #e4e6e8;
}

/* Rámečky u formulářů (mobileBase) */
[data-theme="dark"] .frame,
[data-theme="dark"] .frame-loc {
    background: #262d34;
    border-color: #3a444d;
}

/* ---- našeptávač (jquery.autocomplete i jQuery UI) ---- */
[data-theme="dark"] .autocomplete-suggestions {
    background: #20262c;
    border-color: #4a555f;
    color: #e4e6e8;
}

[data-theme="dark"] .autocomplete-selected {
    background: #2e3944;
}

[data-theme="dark"] .autocomplete-group {
    background: #39434c;
}

[data-theme="dark"] .autocomplete-suggestions strong {
    color: #6db3f2;
}

[data-theme="dark"] .ui-widget-content {
    background: #20262c;
    color: #e4e6e8;
    border-color: #4a555f;
}

[data-theme="dark"] .ui-menu .ui-menu-item-wrapper.ui-state-active {
    background: #2e3944;
    border-color: #2e3944;
    color: #e4e6e8;
}

/* Černé PNG ikonky by na tmavém pozadí zmizely – invertovat na bílé.
   Barevné ikonky (blue.png, red.png, dog_on.png…) se nechávají být. */
[data-theme="dark"] img[src*="Login.png"],
[data-theme="dark"] img[src*="Hiden.png"],
[data-theme="dark"] img[src*="sipka_zpet.png"],
[data-theme="dark"] img[src*="export_icon.png"],
[data-theme="dark"] img[src*="cluster-logo.png"],
[data-theme="dark"] img[src*="mapa2.png"],
[data-theme="dark"] img[src*="mapa_ikona.png"],
[data-theme="dark"] img[src*="edit_icon.png"],
[data-theme="dark"] img[src*="share2.png"],
[data-theme="dark"] img[src*="seznam.png"],
[data-theme="dark"] img[src*="cluster_seznam.png"],
[data-theme="dark"] img[src*="cluster_spojeni.png"] {
    filter: invert(1);
}

/* Zvýraznění nalezeného textu */
[data-theme="dark"] .finded {
    background: #7a6414;
}

/* ---- hlášky (alerty) ---- */
[data-theme="dark"] .alert-primary {
    background-color: #1b2f45;
    color: #bcd6f0;
    border-color: #28425e;
}

[data-theme="dark"] .alert-warning {
    background-color: #3e3423;
    color: #f0d9a8;
    border-color: #57482c;
}

[data-theme="dark"] .alert-danger {
    background-color: #442326;
    color: #f0b6bb;
    border-color: #5e3136;
}

[data-theme="dark"] .alert-success {
    background-color: #22392a;
    color: #b8e0c2;
    border-color: #2f4f39;
}

/* ---- modální okna (Bootstrap) ---- */
[data-theme="dark"] .modal-content {
    background-color: #1e242a;
    color: #e4e6e8;
    border-color: #3a444d;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #3a444d;
}

[data-theme="dark"] .close {
    color: #e4e6e8;
    text-shadow: none;
}

/* ---- DataTables ---- */
[data-theme="dark"] .dataTables_wrapper,
[data-theme="dark"] .dataTables_length,
[data-theme="dark"] .dataTables_filter,
[data-theme="dark"] .dataTables_info,
[data-theme="dark"] .dataTables_paginate {
    color: #e4e6e8 !important;
}

[data-theme="dark"] table.dataTable tbody tr {
    background-color: #1a2026;
}

[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
[data-theme="dark"] table.dataTable.display tbody tr.odd {
    background-color: #1a2026;
}

[data-theme="dark"] table.dataTable.stripe tbody tr.even,
[data-theme="dark"] table.dataTable.display tbody tr.even {
    background-color: #232a31;
}

[data-theme="dark"] .page-link {
    background-color: #20262c;
    border-color: #3a444d;
    color: #cfd4d8;
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: #457ead;
    border-color: #457ead;
    color: #fff;
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #1a2026;
    border-color: #3a444d;
    color: #6a747d;
}

/* ---- kalendáře (bootstrap-datepicker, daterangepicker) ---- */
[data-theme="dark"] .datepicker-dropdown,
[data-theme="dark"] .daterangepicker {
    background-color: #20262c;
    color: #e4e6e8;
    border-color: #4a555f;
}

[data-theme="dark"] .datepicker table tr td,
[data-theme="dark"] .datepicker table tr th {
    color: #e4e6e8;
    background: transparent;
}

[data-theme="dark"] .datepicker table tr td.day:hover,
[data-theme="dark"] .datepicker table tr td.focused {
    background: #2e3944;
}

[data-theme="dark"] .datepicker table tr td.old,
[data-theme="dark"] .datepicker table tr td.new {
    color: #6a747d;
}

[data-theme="dark"] .daterangepicker .calendar-table {
    background-color: #20262c;
    border-color: #4a555f;
}

[data-theme="dark"] .daterangepicker td.off {
    background-color: #20262c;
    color: #6a747d;
}

[data-theme="dark"] .daterangepicker td.available:hover,
[data-theme="dark"] .daterangepicker th.available:hover {
    background-color: #2e3944;
}

/* ---- záchrana natvrdo zapsaných inline stylů v šablonách ----
   Spousta stránek má style="color: black" nebo bílé pozadí přímo v HTML.
   Bez tohohle by byl černý text na tmavém pozadí nečitelný. */
[data-theme="dark"] [style*="color: black"],
[data-theme="dark"] [style*="color:black"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:#000"] {
    color: #e4e6e8 !important;
}

[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background-color:#fff"] {
    background-color: #1e242a !important;
}
