/* ========== CONTENEUR PRINCIPAL ========== */
.cf-container { max-width: 1200px; margin: 20px auto; padding: 18px; background: #0b0d10; border-radius: 14px; }

/* ========== FORMULAIRE ========== */
#cf-form { background: transparent; padding: 0; border-radius: 8px; margin-bottom: 22px; }

/* ========== LABELS DES COLONNES (DMX CHANNELS, ATTRIBUTES, MANUFACTURER, FIXTURE NAME, QUICK SEARCH) ========== */
.cf-label-chan,
.cf-label-func,
.cf-label-mfr,
.cf-label-fixture,
.cf-label-quick {
    font-size: 12px;
    font-weight: 700;
    color: #2271b1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
    display: block;
    text-align: left;
}

/* ========== LIGNES DE RECHERCHE ========== */
.cf-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-end; }
.cf-field-wrap { flex: 1; display: flex; flex-direction: column; }

.cf-chan,
.cf-func,
#cf-mfr-select,
#cf-fixture-select,
#cf-quick-search {
    width: 100%;
    flex: 1;
    box-sizing: border-box;
    padding: 8px 12px;
    background-color: #000000;
    color: #eee;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#cf-mfr-select,
#cf-fixture-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23888'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.cf-chan:hover,
.cf-func:hover,
#cf-mfr-select:hover,
#cf-fixture-select:hover {
    border-color: #777;
}

.cf-chan:focus,
.cf-func:focus,
#cf-mfr-select:focus,
#cf-fixture-select:focus {
    border-color: #4ea3ff;
    outline: none;
}

/* ========== SÉLECTEUR D'ATTRIBUTS ILLUSTRÉ ========== */
.cf-func-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cf-func-picker { position: relative; width: 100%; }

.cf-func-trigger {
    width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px;
    box-sizing: border-box; padding: 7px 12px 7px 8px; cursor: pointer;
    color: #f4f7fb; background: #11151a; border: 1px solid #46515e;
    border-radius: 9px; font: inherit; text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cf-func-trigger:hover { background: #151b22; border-color: #647386; }
.cf-func-trigger:focus-visible,
.cf-func-trigger[aria-expanded="true"] {
    outline: none; border-color: #52a8ff;
    box-shadow: 0 0 0 3px rgba(82, 168, 255, .16);
}
.cf-func-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-picker-chevron { color: #8492a2; font-size: 18px; line-height: 1; transform: translateY(-1px); }
.cf-func-trigger[aria-expanded="true"] .cf-picker-chevron { transform: rotate(180deg) translateY(1px); }

.cf-func-menu {
    position: absolute; z-index: 1000; top: calc(100% + 7px); left: 0; right: 0;
    max-height: 330px; overflow-y: auto; padding: 7px;
    background: rgba(17, 21, 26, .98); border: 1px solid #46515e; border-radius: 11px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255,255,255,.025);
    scrollbar-width: thin; scrollbar-color: #526171 #171c22;
}
.cf-func-menu[hidden] { display: none !important; }
.cf-func-option {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 9px;
    color: #eaf0f7; background: transparent; border: 0; border-radius: 8px;
    cursor: pointer; font: inherit; text-align: left;
}
.cf-func-option:hover { background: #25303b; }
.cf-func-option[aria-selected="true"] { background: rgba(34, 113, 177, .3); color: #fff; }
.cf-func-option-empty { color: #9aa7b5; border-bottom: 1px solid #303945; margin-bottom: 5px; padding-bottom: 10px; }

.cf-attribute-icon {
    --icon-color: #86a0b9;
    width: 28px; height: 28px; flex: 0 0 28px; display: inline-flex;
    align-items: center; justify-content: center; color: var(--icon-color);
    background: rgba(134, 160, 185, .12);
    background: color-mix(in srgb, var(--icon-color) 14%, transparent);
    border: 1px solid rgba(134, 160, 185, .24);
    border: 1px solid color-mix(in srgb, var(--icon-color) 28%, transparent);
    border-radius: 8px;
}
.cf-attribute-icon svg {
    width: 17px; height: 17px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.cf-attribute-icon[data-family="dimmer"] { --icon-color: #ffd84d; }
.cf-attribute-icon[data-family="pan"], .cf-attribute-icon[data-family="tilt"] { --icon-color: #72d7ff; }
.cf-attribute-icon[data-family="gobo"] { --icon-color: #c6a7ff; }
.cf-attribute-icon[data-family="prism"] { --icon-color: #83ead7; }
.cf-attribute-icon[data-family="strobe"] { --icon-color: #ffcf70; }
.cf-attribute-icon[data-family="zoom"], .cf-attribute-icon[data-family="focus"], .cf-attribute-icon[data-family="iris"] { --icon-color: #7eb8ff; }
.cf-attribute-icon[data-family="frost"] { --icon-color: #bdeaff; }
.cf-attribute-icon[data-family="speed"], .cf-attribute-icon[data-family="rotate"] { --icon-color: #ff9a68; }
.cf-attribute-icon[data-family="effect"] { --icon-color: #f09dff; }
.cf-attribute-icon[data-family="control"] { --icon-color: #a6b5c5; }
.cf-attribute-icon[data-family="color"] { --icon-color: #ff74c8; }
.cf-attribute-icon[data-family="red"] { --icon-color: #ff575f; }
.cf-attribute-icon[data-family="green"] { --icon-color: #48d778; }
.cf-attribute-icon[data-family="blue"] { --icon-color: #5791ff; }
.cf-attribute-icon[data-family="white"] { --icon-color: #f5f7fa; }
.cf-attribute-icon[data-family="amber"] { --icon-color: #ffb343; }
.cf-attribute-icon[data-family="lime"] { --icon-color: #b9f34a; }
.cf-attribute-icon[data-family="mint"] { --icon-color: #7ce8bd; }
.cf-attribute-icon[data-family="uv"] { --icon-color: #b06cff; }
.cf-attribute-icon[data-family="cyan"] { --icon-color: #39dce2; }
.cf-attribute-icon[data-family="magenta"] { --icon-color: #f05ac8; }
.cf-attribute-icon[data-family="yellow"] { --icon-color: #ffe05b; }
.cf-attribute-icon[data-family="gobo-rotate"] { --icon-color: #d8b8ff; }
.cf-attribute-icon[data-family="prism-rotate"] { --icon-color: #91f3df; }

#cf-mfr-select option,
#cf-fixture-select option {
    background-color: #2b2b2b;
    color: #eee;
}

.cf-del { background: #e74c3c; color: #fff; border: none; border-radius: 6px;
          width: 30px; height: 30px; cursor: pointer; font-size: 18px; line-height: 1;
          flex-shrink: 0; }
.cf-del:hover { background: #c0392b; }

/* ========== BOUTON AJOUTER ========== */
#cf-add { margin: 10px 0; padding: 8px 16px; background: #2271b1; color: #fff;
          border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
#cf-add:hover { background: #135e96; }

/* ========== STATUT & RÉSULTATS ========== */
#cf-status { margin: 12px 0; font-size: 14px; color: #e74c3c; font-weight: 600; }
#cf-results { margin-top: 20px; }
.cf-none, .cf-more { color: #888; font-style: italic; margin-top: 10px; padding: 10px;
                     background: #202020; border-radius: 6px; }

/* ========== CARTES DE RÉSULTATS (style fixture.id) ========== */
.cf-card { background: #2b2b2b; color: #eee; border-radius: 8px;
           padding: 14px 18px; margin-bottom: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.cf-card-layout { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; align-items: start; }
.cf-card-body { min-width: 0; }
.cf-fixture-thumb {
    width: 100px; height: 100px; overflow: hidden; border-radius: 12px;
    background: linear-gradient(145deg, #181d23, #0d1014);
    border: 1px solid #414b57; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.cf-fixture-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cf-fixture-thumb-generic {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #718092; text-align: center;
}
.cf-fixture-thumb-generic svg {
    width: 58px; height: 58px; fill: none; stroke: currentColor;
    stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round;
}
.cf-fixture-thumb-generic span { margin-top: 2px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }

.cf-card-head { display: flex; flex-wrap: wrap; align-items: baseline;
                gap: 8px 16px; margin-bottom: 10px;
                border-bottom: 1px solid #444; padding-bottom: 8px; }

.cf-model { font-size: 18px; font-weight: 700; color: #fff; }
.cf-mfr   { color: #aaa; font-size: 14px; }
.cf-mode  { color: #aaa; font-size: 14px; margin-left: auto; }

.cf-dl    { color: #4ea3ff; text-decoration: none; font-weight: 600; font-size: 13px;
            padding: 4px 8px; border: 1px solid #4ea3ff; border-radius: 4px; }
.cf-dl:hover { background: rgba(78, 163, 255, 0.1); }

/* ========== GRILLE DES CANAUX ========== */
.cf-chan-list { list-style: none; padding: 0; margin: 0;
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 8px 20px; }

.cf-chan-list li { display: flex; gap: 8px; font-size: 13px; padding: 7px 8px;
                   align-items: center; border-radius: 9px; background: rgba(255,255,255,.025);
                   border: 1px solid rgba(255,255,255,.045); }
.cf-chan-list li:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.09); }

.cf-num  { color: #888; min-width: 22px; text-align: right; font-weight: 600; }
.cf-attr { color: #eee; }

/* ========== BLOCS DE RECHERCHE SÉPARÉS ========== */
.cf-block {
    background: #202020;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.cf-block:last-child { margin-bottom: 0; }

.cf-block-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: -18px -20px 14px -20px;
    padding: 12px 20px;
    background-color: #000000;
    border-bottom: 1px solid #3a3a3a;
    text-align: center;
    border-radius: 7px 7px 0 0;
}

/* le bouton +Add DMX Channel garde son espacement */
#cf-block-channel #cf-add { margin-top: 10px; margin-bottom: 0; }

/* le bloc Results n'a pas besoin de padding excessif */
#cf-block-results-status #cf-status { margin: 0; }

/* ========== ESPACEMENT ENTRE LES FILTRES ========== */
.cf-filter-spacing {
    margin-top: 16px;
}

/* ========== MASQUER LE LABEL QUICK SEARCH ========== */
#cf-block-quick .cf-label-quick {
    display: none;
}

/* ========== THÈME CLAIR DES CHAMPS + IDENTITÉ DES 4 ZONES ========== */
.cf-chan,
#cf-mfr-select,
#cf-fixture-select,
#cf-quick-search {
    background-color: #ffffff;
    color: #111827;
    border-color: #cbd5e1;
    min-height: 46px;
}

.cf-chan,
#cf-mfr-select,
#cf-fixture-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23111827'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.cf-chan:hover,
#cf-mfr-select:hover,
#cf-fixture-select:hover,
#cf-quick-search:hover { border-color: #94a3b8; }

.cf-chan:focus,
#cf-mfr-select:focus,
#cf-fixture-select:focus,
#cf-quick-search:focus {
    color: #111827;
    background-color: #ffffff;
    border-color: #2589d8;
    box-shadow: 0 0 0 3px rgba(37, 137, 216, .14);
    outline: none;
}

#cf-mfr-select option,
#cf-fixture-select option,
.cf-chan option { background: #ffffff; color: #111827; }
#cf-quick-search::placeholder { color: #64748b; opacity: 1; }

.cf-func-trigger {
    color: #111827;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23111827'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-left: 12px;
    padding-right: 32px;
    gap: 0;
    border-color: #cbd5e1;
}
.cf-func-trigger:hover { color: #111827; background-color: #f8fafc; border-color: #94a3b8; }
.cf-picker-chevron { color: #475569; }
.cf-func-menu {
    background: rgba(255,255,255,.99);
    border-color: #cbd5e1;
    scrollbar-color: #94a3b8 #f1f5f9;
}
.cf-func-option { color: #111827; }
.cf-func-option:hover { background: #eef4fa; }
.cf-func-option[aria-selected="true"] { color: #0f172a; background: #dbeafe; }
.cf-func-option-empty { color: #64748b; border-bottom-color: #e2e8f0; }

.cf-block {
    --section-accent: #2589d8;
    background: #202225;
    border: 1px solid #3b4650;
    border-left: 5px solid var(--section-accent);
    border-radius: 11px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
.cf-block-title {
    background: var(--section-title, #151719);
    border-bottom: 2px solid var(--section-accent);
    border-radius: 7px 7px 0 0;
}

#cf-block-channel { --section-accent: #2589d8; --section-title: #175b8e; }
#cf-block-type { --section-accent: #20ad83; --section-title: #126b51; }
#cf-block-quick { --section-accent: #8b6ee8; --section-title: #55418f; }
#cf-block-results-status { --section-accent: #f08a3c; --section-title: #9a4d1d; margin: 0; }

#cf-block-channel .cf-label-chan,
#cf-block-channel .cf-label-func { color: #4ba8eb; }
#cf-block-type .cf-label-mfr,
#cf-block-type .cf-label-fixture { color: #42caa2; }

.cf-results-zone {
    background: #151719;
    border: 1px solid #70482d;
    border-left: 5px solid #f08a3c;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.cf-results-zone #cf-block-results-status {
    border: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    background: #202225;
    padding-bottom: 14px;
}
.cf-results-zone #cf-results {
    margin: 0;
    padding: 18px;
    border-top: 1px solid #34383d;
}
.cf-results-zone #cf-results:empty { display: none; }
.cf-results-zone .cf-card:last-child { margin-bottom: 0; }

.cf-source {
    margin-top: 6px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
}
.cf-source a { color: #f3a66e; text-decoration: underline; }
.cf-source a:hover { color: #ffffff; }

/* ========== SÉPARATION VISUELLE DES 4 ZONES ========== */
#cf-form {
    display: grid;
    gap: 30px;
    margin-bottom: 38px;
}

#cf-form .cf-block {
    margin-bottom: 0;
    background: linear-gradient(180deg, #1c1f22 0%, #141619 100%);
}

#cf-block-channel {
    box-shadow: 0 14px 34px rgba(0,0,0,.25), 0 7px 20px rgba(37,137,216,.17);
}
#cf-block-type {
    box-shadow: 0 14px 34px rgba(0,0,0,.25), 0 7px 20px rgba(32,173,131,.16);
}
#cf-block-quick {
    box-shadow: 0 14px 34px rgba(0,0,0,.25), 0 7px 20px rgba(139,110,232,.17);
}
.cf-results-zone {
    background: #101214;
    box-shadow: 0 16px 38px rgba(0,0,0,.28), 0 8px 22px rgba(240,138,60,.18);
}

.cf-block-title {
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.16), 0 4px 12px rgba(0,0,0,.18);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .cf-container { padding: 9px; border-radius: 10px; }
    #cf-form { gap: 20px; margin-bottom: 26px; }
    .cf-row { flex-direction: column; align-items: stretch; }
    .cf-chan, .cf-func, #cf-mfr-select, #cf-fixture-select, #cf-quick-search { width: 100%; }
    .cf-card-head { flex-direction: column; gap: 4px; }
    .cf-mode, .cf-dl { margin-left: 0; }
    .cf-chan-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .cf-func-menu { max-height: 280px; }
    .cf-card-layout { grid-template-columns: 74px minmax(0, 1fr); gap: 11px; }
    .cf-fixture-thumb { width: 74px; height: 74px; border-radius: 10px; }
    .cf-fixture-thumb-generic svg { width: 42px; height: 42px; }
    .cf-fixture-thumb-generic span { display: none; }
}
