/* ================= */
/* === DARK MODE === */
/* ================= */
/* Globalny tmavy rezim pre ECM2 aj legacy ECM (src/navigator1.php).
   Invertuje cely dokument (vratane inline stylov), media sa invertuju spat do povodnych farieb. */
@media screen {
    /* invert(0.90): biela -> #1a1a1a (tmavosiva namiesto ciernej) */
    html[data-theme="dark"] {
        filter: invert(0.90) hue-rotate(180deg);
        background-color: #fff;
        color-scheme: light;
    }

    /* presna inverzia k invert(0.90): contrast = 1 / (2 * 0.90 - 1) */
    html[data-theme="dark"] img,
    html[data-theme="dark"] video,
    html[data-theme="dark"] picture,
    html[data-theme="dark"] canvas,
    html[data-theme="dark"] embed,
    html[data-theme="dark"] object,
    html[data-theme="dark"] iframe[src*="recaptcha"],
    html[data-theme="dark"] #CalendarHolidaysBodyInner,
    html[data-theme="dark"] .no-dark-invert {
        filter: invert(1) hue-rotate(180deg) contrast(1.25);
    }

    /* vylucene bloky su priehladne - bez vlastneho pozadia by povodny tmavy text lezal na tmavej stranke */
    html[data-theme="dark"] #CalendarHolidaysBodyInner {
        background-color: #fff;
    }

    /* vnutri vylucenych blokov uz su media v povodnych farbach - nevratit ich znova */
    html[data-theme="dark"] #CalendarHolidaysBodyInner img,
    html[data-theme="dark"] #CalendarHolidaysBodyInner video,
    html[data-theme="dark"] #CalendarHolidaysBodyInner picture,
    html[data-theme="dark"] #CalendarHolidaysBodyInner canvas,
    html[data-theme="dark"] #CalendarHolidaysBodyInner embed,
    html[data-theme="dark"] #CalendarHolidaysBodyInner object {
        filter: none;
    }

    /* cierne ikony v hornom menu - nechat invertovane (svetle), inak splyvaju s pozadim */
    /* BeautyTips (jquery.bt) kresli bublinu tooltipu na canvas - nechat invertovanu spolu s textom */
    html[data-theme="dark"] #mainMenuTabs img[src*="/icon/"],
    html[data-theme="dark"] .bt-wrapper canvas {
        filter: none;
    }

    /* tiene po inverzii svietia - stlmime ich */
    html[data-theme="dark"] .modal-content,
    html[data-theme="dark"] .ui-dialog,
    html[data-theme="dark"] .dropdown-menu,
    html[data-theme="dark"] .button-default-mini {
        box-shadow: none;
    }

    html[data-theme="dark"] .modal-backdrop.in {
        opacity: 0.2;
    }
}

.theme-toggle {
    cursor: pointer;
    margin-right: 10px;
}

.theme-toggle-fixed {
    position: fixed;
    top: 15px;
    right: 15px;
    margin: 0;
    color: #444;
    z-index: 100;
}
