/* ============================================================
   MOJO BLUES BAND — Design-Switcher Widget
   Schwebende Werkzeugleiste, mit der wir während des
   Abnahmetermins live Farbpaletten und Fonts durchschalten.

   Sichtbar wenn:
     • eingeloggter User mit Theme-Edit-Rechten ODER
     • URL-Parameter ?design=on (persistiert via localStorage)

   Schalten via ?design=off
   ============================================================ */

#mbb-design-switcher,
#mbb-design-fab {
    --ds-bg:        #18120a;
    --ds-bg-strong: #221810;
    --ds-bd:        #3a2d18;
    --ds-text:      #f4ecd6;
    --ds-text-soft: #c9bb95;
    --ds-text-dim:  #8a7d60;
    --ds-accent:    #e9d8a7;
    --ds-accent-hi: #f9e8b7;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ds-text);
    box-sizing: border-box;
}

#mbb-design-switcher *,
#mbb-design-switcher *::before,
#mbb-design-switcher *::after,
#mbb-design-fab *,
#mbb-design-fab *::before,
#mbb-design-fab *::after {
    box-sizing: border-box;
}

/* ---------- Floating Action Button ---------- */
#mbb-design-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999998;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--ds-bd);
    background: linear-gradient(145deg, #2a1f10, #15100a);
    color: var(--ds-accent);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .55), 0 0 0 2px rgba(233, 216, 167, .04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease;
}
#mbb-design-fab:hover {
    transform: translateY(-2px);
    color: var(--ds-accent-hi);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .65), 0 0 0 2px rgba(233, 216, 167, .12);
}
#mbb-design-fab svg {
    width: 26px;
    height: 26px;
    display: block;
}
#mbb-design-fab .mbb-fab-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 0 0 2px var(--ds-bg);
}

/* ---------- Panel ---------- */
#mbb-design-switcher {
    position: fixed;
    right: 18px;
    bottom: 84px;
    width: 360px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 110px);
    background: var(--ds-bg);
    border: 1px solid var(--ds-bd);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .65), 0 0 0 1px rgba(233, 216, 167, .03);
    z-index: 999999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(8px) scale(.98);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
}
#mbb-design-switcher.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Header ---------- */
.mbb-ds-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #1f1709, #18120a);
    border-bottom: 1px solid var(--ds-bd);
}
.mbb-ds-head h3 {
    font-family: inherit;
    font-size: 14px;
    margin: 0;
    color: var(--ds-accent);
    font-weight: 600;
    letter-spacing: .02em;
    flex: 1;
    text-shadow: none;
}
.mbb-ds-head .mbb-ds-sub {
    color: var(--ds-text-dim);
    font-size: 11px;
    font-weight: 400;
    margin-left: 6px;
}
.mbb-ds-head button {
    background: transparent;
    border: 1px solid var(--ds-bd);
    color: var(--ds-text-soft);
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-size: 16px;
    line-height: 1;
}
.mbb-ds-head button:hover { color: var(--ds-accent-hi); border-color: var(--ds-accent); }

/* ---------- Body / Scroll ---------- */
.mbb-ds-body {
    overflow-y: auto;
    padding: 14px 16px 16px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #3a2d18 transparent;
}
.mbb-ds-body::-webkit-scrollbar { width: 8px; }
.mbb-ds-body::-webkit-scrollbar-track { background: transparent; }
.mbb-ds-body::-webkit-scrollbar-thumb { background: #3a2d18; border-radius: 4px; }
.mbb-ds-body::-webkit-scrollbar-thumb:hover { background: #5a4624; }

/* ---------- Sections ---------- */
.mbb-ds-section { margin-bottom: 18px; }
.mbb-ds-section:last-child { margin-bottom: 0; }
.mbb-ds-section > label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ds-text-dim);
    margin-bottom: 8px;
    font-weight: 600;
}

/* ---------- Palette grid ---------- */
.mbb-ds-palettes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.mbb-ds-palette {
    background: var(--ds-bg-strong);
    border: 1px solid var(--ds-bd);
    border-radius: 7px;
    padding: 9px 10px;
    cursor: pointer;
    text-align: left;
    transition: all .15s ease;
    color: var(--ds-text);
    font-family: inherit;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.mbb-ds-palette:hover {
    border-color: var(--ds-accent);
    transform: translateY(-1px);
}
.mbb-ds-palette.is-active {
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 1px var(--ds-accent), 0 6px 16px rgba(233, 216, 167, .12);
}
.mbb-ds-palette.is-active::after {
    content: '✓';
    position: absolute;
    top: 4px; right: 6px;
    color: var(--ds-accent);
    font-size: 11px;
    font-weight: 700;
}
.mbb-ds-palette-name {
    font-weight: 600;
    color: var(--ds-accent);
    font-size: 12px;
    margin-right: 14px;
}
.mbb-ds-palette-swatches {
    display: flex;
    gap: 3px;
    height: 12px;
}
.mbb-ds-palette-swatches span {
    flex: 1;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, .04);
}

/* ---------- Hero presets ---------- */
.mbb-ds-heroes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.mbb-ds-hero {
    background: var(--ds-bg-strong);
    border: 1px solid var(--ds-bd);
    border-radius: 7px;
    padding: 6px;
    cursor: pointer;
    color: var(--ds-text);
    font-family: inherit;
    text-align: left;
    transition: all .15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.mbb-ds-hero:hover {
    border-color: var(--ds-accent);
    transform: translateY(-1px);
}
.mbb-ds-hero.is-active {
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 1px var(--ds-accent), 0 6px 16px rgba(233, 216, 167, .12);
}
.mbb-ds-hero.is-active::after {
    content: '✓';
    position: absolute;
    top: 8px; right: 10px;
    color: var(--ds-bg);
    background: var(--ds-accent);
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.mbb-ds-hero-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    background-color: #000;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,.4);
}
.mbb-ds-hero-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-accent);
    padding: 0 2px 2px;
}

/* ---------- Font lists ---------- */
.mbb-ds-fonts {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}
.mbb-ds-fonts::-webkit-scrollbar { width: 6px; }
.mbb-ds-fonts::-webkit-scrollbar-thumb { background: #3a2d18; border-radius: 3px; }

.mbb-ds-font {
    background: var(--ds-bg-strong);
    border: 1px solid var(--ds-bd);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    color: var(--ds-text);
    text-align: left;
    font-size: 14px;
    transition: all .12s ease;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.mbb-ds-font:hover { border-color: var(--ds-accent); }
.mbb-ds-font.is-active {
    border-color: var(--ds-accent);
    background: rgba(233, 216, 167, .08);
}
.mbb-ds-font-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    color: var(--ds-text-dim);
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}

/* ---------- Color pickers (custom) ---------- */
.mbb-ds-custom-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}
.mbb-ds-custom-row span { color: var(--ds-text-soft); }
.mbb-ds-custom-row input[type="color"] {
    width: 36px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid var(--ds-bd);
    background: var(--ds-bg-strong);
    cursor: pointer;
    padding: 0;
}

/* ---------- Footer actions ---------- */
.mbb-ds-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--ds-bg), #120c06);
    border-top: 1px solid var(--ds-bd);
}
.mbb-ds-actions button {
    flex: 1;
    border: 1px solid var(--ds-bd);
    background: var(--ds-bg-strong);
    color: var(--ds-text-soft);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    transition: all .15s;
}
.mbb-ds-actions button:hover {
    border-color: var(--ds-accent);
    color: var(--ds-accent-hi);
}
.mbb-ds-actions .mbb-ds-primary {
    background: linear-gradient(180deg, #4a3719, #2c2010);
    color: var(--ds-accent);
}

/* ---------- Mobile ---------- */
@media (max-width: 540px) {
    #mbb-design-switcher {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 76px;
        max-height: calc(100vh - 96px);
    }
    #mbb-design-fab {
        right: 12px;
        bottom: 12px;
    }
}
