/*
 * Dialog "Neue Modell-Konfiguration anlegen": einzuschließende Attribute.
 *
 * - Pillen der angehakten Attribute im Bereich "Suche eingrenzen"
 * - Häkchen im Objektbaum (Spalte modelCheckCol), inkl. "halb"-Zustand
 * - eigene Maske mit Aussparung über dem Objektbaum (.nmPickMask)
 *
 * No SASS / theme rebuild required — siehe Controller
 * app/view/predModel/newModelWindowController.js (initTreePicker).
 */

/* ─── Pillen im Dialog ─────────────────────────────────────────── */

body .nmConfig2026 .nmIncLabel {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #2a3138;
    padding-bottom: 6px;
}

/* Zähler der einzuschließenden Attribute (roter Kreis neben dem Titel) */
body .nmConfig2026 .nmIncCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #d64545;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    vertical-align: 1px;
}

body .nmConfig2026 .nmIncEmpty {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12.5px;
    color: #97a2ad;
    padding: 8px 10px;
    border: 1px dashed #d8dbe8;
    border-radius: 8px;
}

body .nmConfig2026 .nmIncPills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 132px;
    overflow-y: auto;
}

body .nmConfig2026 .nmIncPill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e4f6f5;
    padding: 3px 4px 3px 9px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 11.5px;
    line-height: 1.3;
    color: #315a5a;
    white-space: nowrap;
}

body .nmConfig2026 .nmIncPillX {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: #3f7373;
    opacity: 0.7;
    cursor: pointer;
}

body .nmConfig2026 .nmIncPillX:hover {
    opacity: 1;
    background: #c0eae7;
}

body .nmConfig2026 .nmAdvBody .nmHint {
    margin-top: 10px;
}

/* Warnung unter der Suchtiefe (viele Attribute bei Suchtiefe "Standard") */
body .nmConfig2026 .nmIncWarn {
    padding: 10px 14px;
    border: 1px solid #f3c2ca;
    border-radius: 8px;
    background: #fdecef;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #8f2538;
}

/* Ext setzt bei sichtbaren Komponenten kein display — Flex hier, das
   versteckte Element behaelt sein display:none von x-hidden */
body .nmConfig2026 .nmIncWarn:not(.x-hidden-display):not(.x-hidden-offsets) {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body .nmConfig2026 .nmIncWarn .nmIncWarnIcon {
    flex: none;
    font-size: 18px;
    line-height: 18px;
    margin-top: 1px;
    color: #d0344d;
}

body .nmConfig2026 .nmIncWarn .nmIncWarnText {
    flex: 1 1 auto;
    min-width: 0;
}

body.oe-theme-dark .nmConfig2026 .nmIncWarn .nmIncWarnIcon {
    color: #f07a8e;
}

body.oe-theme-dark .nmConfig2026 .nmIncWarn {
    border-color: #6b2a36;
    background: #3a1c22;
    color: #f2b8c2;
}

/* ─── Häkchen im Objektbaum ────────────────────────────────────── */

/* "halb" gewählt: nur ein Teil der Attribute darunter ist angehakt */
body #xobjectTree-body input[type="checkbox"].nmTreeCbSemi {
    background-color: #d6e4f5;
    border-color: #d6e4f5;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23417dbf' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}

/* Knoten-Menüs (Zahnrad, Hover-Icons) sind im Auswahlmodus aus — sie
   lägen sonst über der Häkchen-Spalte */
body .nmTreePickMode .xplainIcon,
body .nmTreePickMode .xobjecttree_dimension_context_menu {
    display: none !important;
}

/* ─── Maske mit Aussparung über dem Objektbaum ─────────────────── */

body > .nmPickMask {
    position: fixed;
}

/* ─── Dark Theme ───────────────────────────────────────────────── */

body.oe-theme-dark .nmConfig2026 .nmIncLabel {
    color: var(--oe-text);
}

body.oe-theme-dark .nmConfig2026 .nmIncEmpty {
    color: var(--oe-text-muted);
    border-color: var(--oe-input-border);
}

body.oe-theme-dark .nmConfig2026 .nmIncPill {
    background: rgba(88, 153, 153, 0.22);
    color: #BEE6E3;
}

body.oe-theme-dark .nmConfig2026 .nmIncPillX {
    color: #BEE6E3;
}

body.oe-theme-dark .nmConfig2026 .nmIncPillX:hover {
    background: rgba(88, 153, 153, 0.38);
}

body.oe-theme-dark #xobjectTree-body input[type="checkbox"].nmTreeCbSemi {
    background-color: rgba(65, 125, 191, 0.35) !important;
    border-color: rgba(65, 125, 191, 0.35) !important;
}

/* ─── Schalter "Zeitabstände berücksichtigen" (timeSearch) ─────── */

body .nmConfig2026 .nmSwitch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

body .nmConfig2026 .nmSwitch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

body .nmConfig2026 .nmSwitchTrack {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 20px;
    margin-top: 1px;
    border-radius: 999px;
    background: #c9ced6;
    transition: background-color .18s ease;
}

body .nmConfig2026 .nmSwitchTrack::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform .18s ease;
}

body .nmConfig2026 .nmSwitch input:checked + .nmSwitchTrack {
    background: #589999;
}

body .nmConfig2026 .nmSwitch input:checked + .nmSwitchTrack::after {
    transform: translateX(14px);
}

body .nmConfig2026 .nmSwitch input:focus-visible + .nmSwitchTrack {
    outline: 2px solid #417dbf;
    outline-offset: 2px;
}

body .nmConfig2026 .nmSwitchText {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body .nmConfig2026 .nmSwitchLabel {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #2a3138;
    line-height: 22px;
}

body.oe-theme-dark .nmConfig2026 .nmSwitchTrack {
    background: var(--oe-input-border);
}

body.oe-theme-dark .nmConfig2026 .nmSwitch input:checked + .nmSwitchTrack {
    background: #589999;
}

body.oe-theme-dark .nmConfig2026 .nmSwitchLabel {
    color: var(--oe-text);
}
