/* Mirror Designer – kreator lustra (dopasowane do stylu motywu lustra.jensej.pl) */
.mirror-designer {
    --md-bg: transparent;
    --md-panel: rgba(255, 255, 255, .04);
    --md-border: rgba(255, 255, 255, .18);
    --md-text: #ffffff;
    --md-muted: #969696;
    --md-accent: #DF7538;
    --md-accent-hover: #634E42;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: stretch;
    max-width: 1100px;
    margin: 24px auto;
    color: var(--md-text);
    font-family: "Fustat", sans-serif;
}
.mirror-designer[data-loading] { opacity: .5; }

/* Scena / podgląd */
.md-stage { min-height: 420px; }
.md-preview-wrap {
    position: relative;
    height: 100%;
    min-height: 420px;
    border-radius: 12px;
    /* ciemne tło domyślnie – poświata LED (także ciepła/neutralna) jest dobrze widoczna */
    background: radial-gradient(135% 135% at 50% 25%, #3a4450 0%, #191e26 80%);
    border: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: background .35s ease;
    overflow: hidden;
}
.md-preview { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; touch-action: none; }
.md-preview svg { max-height: 60vh; }
.mirror-designer.md-dragging .md-preview { cursor: grabbing; }
.mirror-designer.md-dragging .md-preview svg { cursor: grabbing; }

.md-dark-toggle {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: #fff; border-radius: 999px;
    padding: 6px 14px; font-size: 13px; font-family: inherit; cursor: pointer;
    transition: all .2s ease;
}
.md-dark-toggle:hover { background: rgba(223,117,56,.25); border-color: var(--md-accent); }

/* Tryb ciemnego pokoju – jeszcze głębsza czerń */
.mirror-designer.md-dark .md-preview-wrap {
    background: radial-gradient(120% 120% at 50% 30%, #0f141c 0%, #05070a 80%);
    border-color: #141a22;
}

/* Panel sterowania */
.md-panel {
    background: var(--md-panel);
    border: 1px solid var(--md-border);
    border-radius: 12px;
    padding: 22px 22px 26px;
    display: flex;
    flex-direction: column;
}
.md-title { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 18px; line-height: 1.2; }
.md-group { margin-bottom: 18px; }
.md-label { display: block; font-size: 13px; font-weight: 600; color: var(--md-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }

.md-shapes, .md-led, .md-led-colors { display: flex; flex-wrap: wrap; gap: 8px; }

/* Chip barwy światła z próbką koloru */
.md-color-chip { display: inline-flex; align-items: center; gap: 8px; }
.md-swatch {
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.3);
    box-shadow: 0 0 6px rgba(0,0,0,.25) inset;
    display: inline-block; flex: 0 0 auto;
}
.md-color-chip.is-active .md-swatch { border-color: #fff; }
.md-chip {
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.03); color: #fff;
    border-radius: 8px; padding: 9px 14px;
    font-size: 14px; font-family: inherit; cursor: pointer; transition: all .15s ease;
}
.md-chip:hover { border-color: var(--md-accent); background: rgba(223,117,56,.12); }
.md-chip.is-active { background: var(--md-accent); border-color: var(--md-accent); color: #fff; }

.md-select {
    width: 100%; padding: 11px 12px;
    border: 1px solid #fff; border-radius: 4px;
    font-size: 16px; line-height: 28px; font-weight: 500;
    font-family: inherit;
    background: transparent; color: #fff;
    outline: none;
}
.md-select::placeholder { color: #fff; font-weight: 400; }
.md-select:focus { border-color: var(--md-accent); }

select.md-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg width="18" height="10" viewBox="0 0 18 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.91797 1.00732L9.21094 8.30029L16.5039 1.00732" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 97%;
    background-position-y: 50%;
}

.md-price-row {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 8px 0 16px; padding-top: 16px; border-top: 1px dashed var(--md-border);
}
.md-price-label { font-size: 14px; color: var(--md-muted); text-transform: uppercase; letter-spacing: .03em; }
.md-price { font-size: 28px; font-weight: 700; color: #E8E8E8; }
.md-price-loading { opacity: .4; }
.md-price del { font-size: 18px; opacity: .55; font-weight: 500; margin-right: 6px; }

.md-add {
    width: 100%; padding: 15px 20px;
    background: var(--md-accent); color: #fff; border: none;
    border-radius: 4px; font-size: 16px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background-color .2s ease;
}
.md-add:hover { background-color: var(--md-accent-hover); }
.md-add:disabled { opacity: .6; cursor: default; }
.md-note { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: rgb(180, 3, 28); }

/* Napis + czcionki */
@font-face { font-family: 'MDSans'; src: url('fonts/sans.ttf'); font-display: swap; }
@font-face { font-family: 'MDSerif'; src: url('fonts/serif.ttf'); font-display: swap; }
@font-face { font-family: 'MDScript'; src: url('fonts/script.ttf'); font-display: swap; }

.md-fonts { display: flex; flex-wrap: wrap; gap: 8px; }
.md-font-chip { font-size: 17px; }
.md-font-sans { font-family: 'MDSans', sans-serif; }
.md-font-serif { font-family: 'MDSerif', serif; }
.md-font-script { font-family: 'MDScript', cursive; font-size: 20px; }
.md-chip:disabled { opacity: .4; cursor: default; }

.md-slider-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.md-slider-label { font-size: 13px; color: var(--md-muted); white-space: nowrap; }
.md-slider-row input[type=range] { flex: 1; accent-color: var(--md-accent); }

/* Logo */
.md-logo-controls { display: flex; align-items: center; gap: 10px; }
.md-file-btn {
    display: inline-block; cursor: pointer; font-family: inherit;
    border: 1px dashed var(--md-accent); color: var(--md-accent);
    border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600;
    transition: background .15s ease;
}
.md-file-btn:hover { background: rgba(223,117,56,.12); }
.md-hint { min-height: 16px; margin: 8px 0 0; font-size: 13px; color: var(--md-muted); }

@media (max-width: 820px) {
    .mirror-designer { grid-template-columns: 1fr; }
    .md-stage { min-height: 340px; }
    .md-preview-wrap { min-height: 340px; }
}
