/* === Editor prezentačních slajdů (administrace) ===
   Samotné vykreslení plátna řeší sdílený css/slide.css + js/slide-render.js. */

.se-root {
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #f6f7f9;
    min-height: 60vh;
    flex-grow: 1;
}

.se-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
}

.se-sep {
    width: 1px;
    height: 22px;
    background: #e3e6ea;
    margin: 0 4px;
}

.se-btn {
    border: 1px solid #cfd4da;
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
    cursor: pointer;
}

.se-btn:hover {
    background: #eef2ff;
    border-color: #9aa8ff;
}

.se-btn--danger:hover {
    background: #ffecec;
    border-color: #ff9d9d;
}

.se-btn--active {
    background: #e0e7ff;
    border-color: #7c8cff;
    color: #1e3a8a;
}

.se-btn--help {
    margin-left: 4px;
    font-weight: 600;
    width: 28px;
    padding: 4px 0;
    text-align: center;
}

/* Legenda klávesových zkratek */
.se-shortcuts {
    position: absolute;
    top: 46px;
    right: 12px;
    z-index: 40;
    width: 330px;
    max-height: calc(100% - 60px);
    overflow: auto;
    padding: 10px 12px 12px;
    background: #fff;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    font-size: 0.8rem;
}

.se-shortcuts[hidden] {
    display: none;
}

.se-shortcuts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.se-shortcuts-close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.se-shortcuts-close:hover {
    color: #111827;
}

.se-kbd-group {
    margin: 8px 0 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c7480;
}

.se-kbd-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0;
}

.se-kbd-row > span {
    color: #374151;
}

.se-kbd {
    flex: none;
    min-width: 74px;
    font-family: inherit;
    font-size: 0.72rem;
    padding: 1px 5px;
    border: 1px solid #cfd4da;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #f8fafc;
    color: #1f2937;
    text-align: center;
}

.se-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: #7a828c;
}

.se-hint--warning {
    margin-left: 0;
    color: #b45309;
    background: #fff7e6;
    border: 1px solid #ffe0a3;
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 2px;
}

.se-select {
    border: 1px solid #cfd4da;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.82rem;
    background: #fff;
    max-width: 220px;
}

.se-select--full {
    max-width: none;
    width: 100%;
}

.se-body {
    display: flex;
    flex-grow: 1;
    min-height: 0;
}

.se-stage {
    position: relative;
    flex-grow: 1;
    overflow: auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-conic-gradient(#eceff3 0% 25%, #e2e6ec 0% 50%) 50% / 24px 24px;
}

.se-canvas-wrap {
    position: relative;
    overflow: visible;
    flex: none;
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.22);
}

.se-render-host {
    position: absolute;
    inset: 0;
}

.se-render-host .slide-viewport {
    position: absolute;
    inset: 0;
}

/* Vodítka a kotvicí body — jen v editoru, do exportu se nekreslí */
.se-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.se-guide {
    position: absolute;
    background: rgba(37, 99, 235, 0.22);
}

.se-guide--v {
    top: 0;
    bottom: 0;
    width: 1px;
}

.se-guide--h {
    left: 0;
    right: 0;
    height: 1px;
}

/* Aktivní kotva, ke které se prvek právě přichytil */
.se-guide--snap {
    background: #db2777;
}

.se-guide-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.45);
}

/* Bezpečný okraj 5 % (title-safe) */
.se-safe {
    position: absolute;
    border: 1px dashed rgba(217, 119, 6, 0.8);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

/* Rovnoměrné mezery mezi sousedy */
.se-gap {
    position: absolute;
    background: #db2777;
}

.se-gap--h {
    height: 2px;
}

.se-gap--v {
    width: 2px;
}

.se-gap-label {
    position: absolute;
    font-size: 10px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 3px;
    background: #db2777;
    color: #fff;
    white-space: nowrap;
}

.se-gap-label--h {
    transform: translate(-50%, -100%);
}

.se-gap-label--v {
    transform: translate(0, -50%);
}

/* Vzdálenosti od hran plátna při tažení */
.se-edge {
    position: absolute;
    background: rgba(100, 116, 139, 0.85);
}

.se-edge--h {
    height: 1px;
}

.se-edge--v {
    width: 1px;
}

.se-edge-label {
    position: absolute;
    font-size: 10px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 3px;
    background: rgba(100, 116, 139, 0.9);
    color: #fff;
    white-space: nowrap;
}

.se-edge-label--h {
    transform: translate(-50%, -100%);
}

.se-edge-label--v {
    transform: translate(0, -50%);
}

/* Zamčený prvek: bez úchytů, jiný rám a ikona zámku */
.se-frame--locked {
    border-color: #8a94a6;
    border-style: dashed;
    cursor: pointer;
}

.se-frame-lock {
    position: absolute;
    top: -11px;
    right: -11px;
    font-size: 11px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 4px;
    background: #8a94a6;
    pointer-events: none;
}

/* Vrstva s rámečkem výběru (nekreslí se do exportu) */
.se-frames {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.se-frame {
    position: absolute;
    border: 2px solid #4c6fff;
    box-sizing: border-box;
    cursor: move;
    pointer-events: auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.se-frame--dashed {
    border: 2px dashed #f0a000;
    cursor: pointer;
    background: rgba(240, 160, 0, 0.06);
}

.se-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: #fff;
    border: 2px solid #4c6fff;
    border-radius: 2px;
    box-sizing: border-box;
}

.se-handle--nw { left: 0; top: 0; cursor: nwse-resize; }
.se-handle--n { left: 50%; top: 0; cursor: ns-resize; }
.se-handle--ne { left: 100%; top: 0; cursor: nesw-resize; }
.se-handle--e { left: 100%; top: 50%; cursor: ew-resize; }
.se-handle--se { left: 100%; top: 100%; cursor: nwse-resize; }
.se-handle--s { left: 50%; top: 100%; cursor: ns-resize; }
.se-handle--sw { left: 0; top: 100%; cursor: nesw-resize; }
.se-handle--w { left: 0; top: 50%; cursor: ew-resize; }

/* Rotační úchyt nad rámem (jen obrázky) */
.se-rotate {
    position: absolute;
    left: 50%;
    top: -26px;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #4c6fff;
    cursor: grab;
}

.se-rotate::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 12px;
    width: 2px;
    height: 12px;
    margin-left: -1px;
    background: #4c6fff;
}

.se-rotate:hover {
    background: #eef2ff;
}

/* Bublina s úhlem při otáčení */
.se-angle {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(17, 24, 39, 0.88);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    pointer-events: none;
    white-space: nowrap;
}

/* Během tažení/otáčení nesmí prohlížeč označovat text */
body.se-dragging,
.se-frames {
    user-select: none;
    -webkit-user-select: none;
}

/* Inspektor */
.se-inspector {
    width: 320px;
    flex: none;
    border-left: 1px solid #e3e6ea;
    background: #fff;
    padding: 10px 12px 20px;
    overflow-y: auto;
    max-height: 72vh;
}

.se-inspector-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #2b3242;
}

.se-section {
    margin: 14px 0 6px;
    padding-top: 8px;
    border-top: 1px solid #eef0f3;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c7480;
}

.se-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
    min-width: 0;
}

.se-label {
    font-size: 0.74rem;
    color: #6c7480;
}

.se-input {
    width: 100%;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.82rem;
    box-sizing: border-box;
}

.se-textarea {
    width: 100%;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    padding: 6px;
    font-size: 0.85rem;
    box-sizing: border-box;
    resize: vertical;
}

.se-grid4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.se-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.se-grid4 .se-input,
.se-grid2 .se-input {
    padding: 3px 4px;
}

.se-color {
    display: flex;
    gap: 6px;
    align-items: center;
}

.se-color input[type="color"] {
    width: 34px;
    height: 28px;
    padding: 0;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    background: #fff;
}

.se-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.se-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.se-range input[type="range"] {
    flex-grow: 1;
}

.se-range-value {
    font-size: 0.76rem;
    color: #6c7480;
    min-width: 34px;
    text-align: right;
}

.se-hint-block {
    font-size: 0.74rem;
    color: #6c7480;
    background: #f6f8fb;
    border: 1px solid #e7ebf1;
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    line-height: 1.4;
}

.se-elrow {
    margin-bottom: 4px;
}

.se-elrow-btn {
    width: 100%;
    text-align: left;
    border: 1px solid #e3e6ea;
    background: #fbfcfd;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-elrow-btn:hover {
    background: #eef2ff;
}

@media (max-width: 992px) {
    .se-body {
        flex-direction: column;
    }

    .se-inspector {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e3e6ea;
        max-height: none;
    }
}
