/*
//
//   Gymnasium Schrobenhausen - Michael Schindler
//   --------------------------------------------
//
//   GymSOB Infoportal - Dunkle Darstellung
//
//   Alle Regeln wirken nur mit der Klasse "gsip_dunkel" am <html> (gesetzt in header.inc.php).
//   Die helle Darstellung bleibt dadurch unverändert.
//
//   Grundidee: Die Grundfarben aus gsip.ui.css und dem jQuery-UI-Theme bekommen dunkle Werte.
//   --g-weiss wird zur Fläche (Karten, Felder), --g-schwarz zur hellen Vordergrundfarbe
//   (Überschriften, aktive Segmente). Wo eine Farbe beides ist (z. B. weiße Schrift auf
//   grünen Knöpfen), steht unten eine eigene Regel.
*/

/* ---------- Umschalter im Menü (immer geladen) ---------- */
.gsip_menu_modus [data-modus] {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    color: #BDBDBD;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.gsip_menu_modus [data-modus]:hover {
    color: #FFF;
}

.gsip_menu_modus [data-modus][aria-pressed="true"] {
    background: #F9C11D;
    color: #000;
}

.gsip_menu_modus [data-modus]:focus-visible {
    outline: 2px solid #F9C11D;
    outline-offset: 1px;
}

@media only screen and (max-width: 900px) {
    .gsip_menu_schrift_item .gsip_menu_modus [data-modus] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 38px;
        height: 38px;
        font-size: 16px;
        color: #CFCFCF;
    }

    .gsip_menu_schrift_item .gsip_menu_modus [data-modus][aria-pressed="true"] {
        color: #000;
    }

    .gsip_menu_level1 > .gsip_menu_modus_item {
        margin-top: 0;
        border-top: none;
    }
}

/* =========================================================
   Farben
   ========================================================= */
html.gsip_dunkel {
    color-scheme: dark;

    /* gsip.ui.css */
    --g-schwarz: #F2F2EF;        /* helle Vordergrundfarbe */
    --g-weiss: #23262A;          /* Fläche von Karten und Feldern */
    --g-text: #E6E6E2;
    --g-text-2: #DADAD6;
    --g-text-3: #B8B9B4;
    --g-grau: #A0A19C;
    --g-grau-hell: #82837E;
    --g-grau-muted: #8C8D88;
    --g-hintergrund: #17191B;
    --g-flaeche: #2B2E33;
    --g-flaeche-hover: #34383D;
    --g-flaeche-zeile: #2A2D31;
    --g-silber: #4C5055;
    --g-linie: #3A3E43;
    --g-linie-hell: #31353A;
    --g-rot: #E5484D;
    --g-rot-dunkel: #C8363B;
    --g-blau: #6AA6DD;
    --g-ok-bg: #213A1C;      --g-ok-text: #A6DB90;
    --g-warn-bg: #3E3312;    --g-warn-text: #F2D477;
    --g-err-bg: #4A2020;     --g-err-text: #F5A9A6;
    --g-info-bg: #1C3048;    --g-info-text: #A3CBF0;
    --g-neutral-bg: #34383D; --g-neutral-text: #DADAD6;
    --g-hinweis-gelb: #302B1B;
    --g-hinweis-rot: #3A2323;
    --g-schatten: 0 1px 2px rgba(0,0,0,.55), 0 8px 22px -12px rgba(0,0,0,.9);
    --g-schatten-klein: 0 1px 2px rgba(0,0,0,.5);
    --g-spinner-spur: rgba(255,255,255,.14);

    /* jQuery-UI-Theme */
    --gsip-ui-black: #F2F2EF;
    --gsip-ui-stone: #A0A19C;
    --gsip-ui-silver: #4C5055;
    --gsip-ui-paper: #23262A;
    --gsip-ui-text: #E6E6E2;
    --gsip-ui-line: #3A3E43;
    --gsip-ui-tint: #2B2E33;
    --gsip-ui-tint-hover: #34383D;
    --gsip-ui-red: #E5484D;
    --gsip-ui-red-text: #F5A9A6;
    --gsip-ui-highlight-bg: #3A3218;
    --gsip-ui-highlight-line: #6E5B22;
    --gsip-ui-error-bg: #4A2020;
    --gsip-ui-error-line: #7C3636;
    --gsip-ui-shadow: 0 1px 2px rgba(0,0,0,.55), 0 8px 22px -12px rgba(0,0,0,.9);
    --gsip-ui-shadow-strong: 0 24px 60px -24px rgba(0,0,0,.95);
}

/* Seite: auch ältere Seiten ohne g-page bekommen den dunklen Grund */
html.gsip_dunkel body {
    background: var(--g-hintergrund);
    color: var(--g-text);
}

/* Links ohne eigene Farbe (geringe Spezifität, damit Menü, jQuery UI usw. ihre Farben behalten) */
:where(html.gsip_dunkel) a:where(:link) {
    color: #9CC7EE;
}

:where(html.gsip_dunkel) a:where(:visited) {
    color: #C0A8E8;
}

html.gsip_dunkel ::selection {
    background: #8A6A00;
    color: #FFF;
}

/* ---------- Menü ---------- */
html.gsip_dunkel .gsip_menu_level2 {
    background: #1F2225;
    border-bottom-color: #33373B;
    box-shadow: 0 4px 10px -8px rgba(0,0,0,.9);
}

html.gsip_dunkel .gsip_menu_level2 > .gsip_menu_item > a,
html.gsip_dunkel .gsip_menu_level2 > .gsip_menu_item > span {
    color: #E6E6E2;
}

html.gsip_dunkel .gsip_menu_level2 > .gsip_menu_item > a:hover {
    background: #3A3218;
}

html.gsip_dunkel .gsip_menu_level2 > .active > a,
html.gsip_dunkel .gsip_menu_level2 > .active > a:hover {
    background: #F9C11D;
    color: #000;
}

html.gsip_dunkel .gsip_menu_more > ul {
    background: #23262A;
    border-color: #3A3E43;
}

html.gsip_dunkel .gsip_menu_more > ul a {
    color: #E6E6E2;
}

@media only screen and (max-width: 900px) {
    html.gsip_dunkel .gsip_menu_level2 > .gsip_menu_item > a,
    html.gsip_dunkel .gsip_menu_level2 > .gsip_menu_item > span {
        border-bottom-color: #31353A;
    }

    html.gsip_dunkel .gsip_menu_level2 > .active > a,
    html.gsip_dunkel .gsip_menu_level2 > .active > a:hover {
        background: #3A3218;
        color: #F2F2EF;
    }
}

/* ---------- Bausteine aus gsip.ui.css ---------- */

/* Schrift auf farbigen Knöpfen bleibt weiß */
html.gsip_dunkel .g-btn-ok.ui-button,
html.gsip_dunkel button.g-btn-ok:not(.ui-button),
html.gsip_dunkel .g-btn-ok.ui-button.ui-state-hover,
html.gsip_dunkel .g-btn-ok.ui-button.ui-state-focus,
html.gsip_dunkel button.g-btn-ok:not(.ui-button):hover,
html.gsip_dunkel .g-btn-err.ui-button,
html.gsip_dunkel button.g-btn-err:not(.ui-button),
html.gsip_dunkel .g-btn-err.ui-button.ui-state-hover,
html.gsip_dunkel .g-btn-err.ui-button.ui-state-focus,
html.gsip_dunkel button.g-btn-err:not(.ui-button):hover {
    color: #FFF;
}

/* Eingabefelder etwas dunkler als die Karte */
html.gsip_dunkel .g-input,
html.gsip_dunkel .g-form :is(input[type=text], input[type=search], input[type=email], input[type=number], input[type=password], input[type=date], input[type=time], input[type=datetime-local]),
html.gsip_dunkel .g-form textarea,
html.gsip_dunkel .g-form select:is([multiple], [size]) {
    background-color: #1B1D20;
}

/* Pfeil der Auswahllisten hell */
html.gsip_dunkel .g-form select:not([multiple]):not([size]):not(.g-select),
html.gsip_dunkel .g-select,
html.gsip_dunkel .g-dt .dataTables_length select {
    background-color: #1B1D20;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23D6D6D2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html.gsip_dunkel .g-dt .dataTables_filter input,
html.gsip_dunkel .studsel input[type=search].studsel_filter {
    background-color: #1B1D20;
}

html.gsip_dunkel .g-badge {
    color: var(--g-neutral-text);
}

html.gsip_dunkel .g-tag.g-tag-hl {
    border-color: #6E5B22;
    background: #3A3218;
}

html.gsip_dunkel .g-segment > input:checked + label .g-segment-num {
    background: rgba(0,0,0,.18);
}

/* Karten heben sich auch ohne sichtbaren Schatten ab */
html.gsip_dunkel .g-card {
    outline: 1px solid #2F3237;
}

/* ---------- jQuery UI ---------- */
html.gsip_dunkel .ui-widget-overlay {
    background: #000;
    opacity: .6;
}

/* aktive Elemente (gelb) behalten schwarze Schrift */
html.gsip_dunkel .ui-state-active,
html.gsip_dunkel .ui-widget-content .ui-state-active,
html.gsip_dunkel .ui-widget-header .ui-state-active,
html.gsip_dunkel .ui-state-active a,
html.gsip_dunkel .ui-state-active a:link,
html.gsip_dunkel .ui-state-active a:visited,
html.gsip_dunkel .ui-datepicker td .ui-state-active,
html.gsip_dunkel .ui-menu .ui-menu-item.ui-state-active {
    color: #000;
}

html.gsip_dunkel .ui-accordion .ui-accordion-header,
html.gsip_dunkel .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
    color: #DADAD6;
}

html.gsip_dunkel .ui-progressbar,
html.gsip_dunkel .ui-slider {
    background: #3A3E43;
}

/* Bilder in jQuery-UI-Symbolen sind dunkelgrau gezeichnet: hell umfärben */
html.gsip_dunkel .ui-state-default .ui-icon,
html.gsip_dunkel .ui-widget-content .ui-icon,
html.gsip_dunkel .ui-widget-header .ui-icon {
    filter: invert(.88);
}

html.gsip_dunkel .ui-state-active .ui-icon,
html.gsip_dunkel .g-btn-ok .ui-icon,
html.gsip_dunkel .g-btn-err .ui-icon {
    filter: none;
}

/* Datum/Uhrzeit-Auswahl */
html.gsip_dunkel .ui-timepicker-div .ui-widget-header {
    color: #E6E6E2;
}

/* ---------- Schrift auf Schulgelb bleibt schwarz ---------- */
html.gsip_dunkel .gsip_admin_cfgrow.gsip_admin_dirty > .gsip_admin_cfgsave,
html.gsip_dunkel .gsip_admin_cfglist.gsip_admin_dirty .gsip_saadmin_settingsave,
html.gsip_dunkel .gsip_admin_track.gsip_admin_dirty :is(.g-card-foot, .g-btnrow) > .g-btn-ok,
html.gsip_dunkel .gsip_isadmin_chip.gsip_isadmin_chip_on,
html.gsip_dunkel .gsip_isadmin_chip.gsip_isadmin_chip_on .fas,
html.gsip_dunkel .gsip_isadmin_mobileswitch > input:checked + label,
html.gsip_dunkel .wifi-step-aktiv .wifi-step-number,
html.gsip_dunkel .studsel_field > button.studsel_open,
html.gsip_dunkel #gsip_alex_caldiv .fc-head .fc-day-header.fc-today,
html.gsip_dunkel #gsip_alex_caldiv .fc-button-primary:not(:disabled).fc-button-active,
html.gsip_dunkel #gsip_alex_caldiv .fc-button-primary:not(:disabled):active {
    color: #000;
}

/* =========================================================
   Fremdbibliotheken
   ========================================================= */

/* ---------- FullCalendar 4 (Kalender) ---------- */
html.gsip_dunkel .fc-unthemed th,
html.gsip_dunkel .fc-unthemed td,
html.gsip_dunkel .fc-unthemed thead,
html.gsip_dunkel .fc-unthemed tbody,
html.gsip_dunkel .fc-unthemed .fc-divider,
html.gsip_dunkel .fc-unthemed .fc-row,
html.gsip_dunkel .fc-unthemed .fc-content,
html.gsip_dunkel .fc-unthemed .fc-popover,
html.gsip_dunkel .fc-unthemed .fc-list-view,
html.gsip_dunkel .fc-unthemed .fc-list-heading td {
    border-color: #3A3E43;
}

html.gsip_dunkel .fc-unthemed .fc-popover {
    background-color: #2B2E33;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

html.gsip_dunkel .fc-unthemed .fc-divider,
html.gsip_dunkel .fc-unthemed .fc-popover .fc-header,
html.gsip_dunkel .fc-unthemed .fc-list-heading td {
    background: #2B2E33;
}

html.gsip_dunkel .fc-unthemed td.fc-today {
    background: #3A3320;
}

html.gsip_dunkel .fc-unthemed .fc-disabled-day {
    background: #303438;
}

html.gsip_dunkel .fc-time-grid .fc-slats .fc-minor td {
    border-top-color: #2F3338;
}

html.gsip_dunkel .fc-highlight {
    background: #1F4466;
}

html.gsip_dunkel .fc-bgevent {
    background: #2D4F25;
}

html.gsip_dunkel .fc-unthemed .fc-list-item:hover td {
    background-color: #303338;
}

html.gsip_dunkel .fc-dayGrid-view .fc-day-top .fc-week-number {
    background-color: #2B2E33;
    color: #A0A19C;
}

html.gsip_dunkel .fc-time-grid-event-inset {
    box-shadow: 0 0 0 1px #23262A;
}

html.gsip_dunkel .fc-time-grid-event.fc-selected .fc-resizer,
html.gsip_dunkel .fc-h-event.fc-selected .fc-resizer {
    background: #23262A;
}

/* Termine etwas weniger grell, Schrift bleibt weiß */
html.gsip_dunkel #gsip_alex_caldiv .fc-event:is(.genehmigt, .nicht-genehmigt, .organisatorisch, .dbf) {
    filter: brightness(0.86) saturate(0.9);
    box-shadow: none;
}

html.gsip_dunkel #gsip_alex_caldiv .fc-event:is(.genehmigt, .nicht-genehmigt, .organisatorisch, .dbf):hover {
    filter: brightness(0.96) saturate(0.9);
}

/* ---------- TinyMCE 4 (Skin "lightgray") ---------- */
/* Textbereich: siehe setup in tinymce.init (gsip.iscreen.admin.php) */
html.gsip_dunkel .mce-container,
html.gsip_dunkel .mce-container *,
html.gsip_dunkel .mce-widget,
html.gsip_dunkel .mce-widget *,
html.gsip_dunkel .mce-ico,
html.gsip_dunkel .mce-btn button,
html.gsip_dunkel .mce-menubtn span,
html.gsip_dunkel .mce-menu-item .mce-ico,
html.gsip_dunkel .mce-menu-item .mce-text,
html.gsip_dunkel .mce-checked i.mce-i-checkbox,
html.gsip_dunkel i.mce-i-resize {
    color: #E6E6E2;
}

html.gsip_dunkel .mce-panel {
    background-color: #2B2E33;
    border-color: #3A3E43;
}

html.gsip_dunkel .mce-tinymce,
html.gsip_dunkel .mce-iframe,
html.gsip_dunkel .mce-panel.mce-first,
html.gsip_dunkel .mce-statusbar {
    border-color: #3A3E43;
}

html.gsip_dunkel div.mce-edit-area {
    background: #1B1D20;
}

html.gsip_dunkel .mce-btn,
html.gsip_dunkel .mce-label,
html.gsip_dunkel .mce-tab {
    text-shadow: none;
}

html.gsip_dunkel .mce-btn {
    background-color: #2B2E33;
    border-color: transparent;
}

html.gsip_dunkel .mce-btn:hover,
html.gsip_dunkel .mce-btn:focus {
    color: #FFF;
    background-color: #383C42;
    border-color: #4A4E54;
}

html.gsip_dunkel .mce-btn.mce-active,
html.gsip_dunkel .mce-btn.mce-active:hover,
html.gsip_dunkel .mce-btn:active,
html.gsip_dunkel .mce-splitbtn .mce-open.mce-active {
    background-color: #43474D;
    border-color: #4A4E54;
}

html.gsip_dunkel .mce-btn-group:not(:first-child) {
    border-left-color: #3A3E43;
}

html.gsip_dunkel .mce-btn.mce-disabled button,
html.gsip_dunkel .mce-btn.mce-disabled .mce-ico,
html.gsip_dunkel .mce-menu-item.mce-disabled .mce-text,
html.gsip_dunkel .mce-menu-item.mce-disabled .mce-ico,
html.gsip_dunkel .mce-label.mce-disabled,
html.gsip_dunkel .mce-textbox.mce-disabled {
    color: #6E706C;
}

html.gsip_dunkel .mce-caret,
html.gsip_dunkel .mce-menubar .mce-caret {
    border-top-color: #E6E6E2;
}

html.gsip_dunkel .mce-caret.mce-up {
    border-bottom-color: #E6E6E2;
}

html.gsip_dunkel .mce-menu-item .mce-caret {
    border-top-color: transparent;
    border-left-color: #E6E6E2;
}

html.gsip_dunkel .mce-path-item {
    color: #B8B9B4;
}

/* Ausklappmenüs, Tabellenauswahl, Popups */
html.gsip_dunkel .mce-menu,
html.gsip_dunkel .mce-floatpanel.mce-popover {
    background: #2B2E33;
    border-color: rgba(255, 255, 255, .14);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .6);
}

html.gsip_dunkel .mce-floatpanel.mce-popover.mce-bottom > .mce-arrow:after {
    border-bottom-color: #2B2E33;
}

html.gsip_dunkel div.mce-menu .mce-menu-item-sep,
html.gsip_dunkel .mce-menu-item-sep:hover {
    border-bottom-color: rgba(255, 255, 255, .1);
}

html.gsip_dunkel .mce-menu-shortcut {
    color: #8C8D88;
}

html.gsip_dunkel .mce-menu-item.mce-disabled:hover {
    background: #34383D;
}

html.gsip_dunkel .mce-grid td.mce-grid-cell div,
html.gsip_dunkel .mce-grid-border a {
    border-color: #4A4E54;
}

html.gsip_dunkel .mce-charmap td {
    border-color: rgba(255, 255, 255, .15);
}

html.gsip_dunkel .mce-charmap td:hover {
    background: #383C42;
}

/* Dialoge (z. B. Tabelleneigenschaften) */
html.gsip_dunkel .mce-window,
html.gsip_dunkel .mce-foot,
html.gsip_dunkel .mce-tabs,
html.gsip_dunkel .mce-tabs + .mce-container-body {
    background: #23262A;
}

html.gsip_dunkel .mce-window-head,
html.gsip_dunkel .mce-foot,
html.gsip_dunkel .mce-tabs {
    border-color: #3A3E43;
}

html.gsip_dunkel .mce-window-head .mce-close {
    color: #A0A19C;
}

html.gsip_dunkel .mce-tab {
    background: #2B2E33;
    border-color: #3A3E43;
}

html.gsip_dunkel .mce-tab:hover,
html.gsip_dunkel .mce-tab.mce-active {
    background: #23262A;
}

html.gsip_dunkel .mce-tab.mce-active {
    border-bottom-color: transparent;
}

html.gsip_dunkel .mce-textbox,
html.gsip_dunkel .mce-combobox input,
html.gsip_dunkel i.mce-i-checkbox {
    background-color: #1B1D20;
    border-color: #4A4E54;
    color: #E6E6E2;
}

html.gsip_dunkel .mce-combobox .mce-btn,
html.gsip_dunkel .mce-window-body .mce-listbox,
html.gsip_dunkel .mce-colorbox i,
html.gsip_dunkel .mce-fieldset {
    border-color: #4A4E54;
}

html.gsip_dunkel .mce-label.mce-error {
    color: #FF8A85;
}

html.gsip_dunkel .mce-primary,
html.gsip_dunkel .mce-primary button,
html.gsip_dunkel .mce-primary button i {
    color: #FFF;
}

html.gsip_dunkel .mce-btn.mce-primary {
    background-color: #2D8AC7;
}

html.gsip_dunkel .mce-btn.mce-primary:hover,
html.gsip_dunkel .mce-btn.mce-primary:focus {
    background-color: #257CB6;
    border-color: transparent;
}
