/* ══════════════════════════════════════════════════════════════
 *  EezyPrint Design Editor Styles
 *  Dark theme matching existing panel system
 * ══════════════════════════════════════════════════════════════ */

/* Force the panel body to fill height so the editor can flex */
.epai-float-body:has(.epai-de),
.epai-float-body[data-editor="true"] {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.epai-de {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    background: #0f172a;
    color: #f1f5f9;
    font-family: 'Futura Book BT', Helvetica, Arial, sans-serif;
    overflow: hidden;
    position: relative;
}

/* ── Top Toolbar ────────────────────────────────────────────── */
.epai-de__topbar {
    flex-shrink: 0;
    border-bottom: 1px solid #1e293b;
    z-index: 10;
}

.epai-de__toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #1e293b;
    flex-wrap: wrap;
    overflow: hidden; /* never scroll — wrap instead */
}

.epai-de__tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.epai-de__tool-btn:hover {
    background: #475569;
    border-color: #94a3b8;
}

.epai-de__tool-btn:active {
    background: #2563eb;
    border-color: #3b82f6;
}

.epai-de__tool-btn--primary {
    background: #2563eb;
    border-color: #3b82f6;
    font-weight: 600;
}

.epai-de__tool-btn--primary:hover {
    background: #1d4ed8;
}

.epai-de__tool-icon {
    font-size: 16px;
    line-height: 1;
}

.epai-de__tool-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.epai-de__toolbar-sep {
    width: 1px;
    height: 24px;
    background: #475569;
    margin: 0 4px;
}

/* ── Canvas Area ────────────────────────────────────────────── */
.epai-de__canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    overflow: hidden;
    padding: 16px;
    position: relative;
    min-height: 200px;
}

.epai-de__canvas-wrap canvas {
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    border-radius: 2px;
    max-width: 100%;
    max-height: 100%;
}

/* No scrollbars anywhere in the editor */
.epai-de, .epai-de__canvas-wrap, .epai-de__topbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.epai-de::-webkit-scrollbar,
.epai-de__canvas-wrap::-webkit-scrollbar,
.epai-de__topbar::-webkit-scrollbar {
    display: none;
}

/* ── Sidebar (Layers) — floating on right side ──────────────── */
.epai-de__sidebar {
    position: absolute;
    right: 0;
    top: 50px;
    bottom: 50px;
    width: 180px;
    background: rgba(30,41,59,0.95);
    border-left: 1px solid #334155;
    overflow-y: auto;
    z-index: 5;
    border-radius: 0 0 0 8px;
}

.epai-de__layers-title {
    padding: 10px 12px 6px;
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
}

.epai-de__layers-list {
    padding: 0 4px 12px;
}

.epai-de__layer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}

.epai-de__layer-row:hover {
    background: #334155;
}

.epai-de__layer-row--active {
    background: #2563eb22;
    border: 1px solid #2563eb44;
}

.epai-de__layer-icon {
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.epai-de__layer-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cbd5e1;
    font-weight: 600;
}

.epai-de__layer-del {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.1s;
}

.epai-de__layer-row:hover .epai-de__layer-del {
    opacity: 1;
}

.epai-de__layer-del:hover {
    color: #ef4444;
    background: #ef444422;
}

/* ── Footer ─────────────────────────────────────────────────── */
.epai-de__footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1e293b;
    border-top: 1px solid #334155;
}

.epai-de__footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.epai-de__footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.epai-de__mode-badge {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    background: #334155;
    padding: 4px 10px;
    border-radius: 4px;
}

.epai-de__btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.epai-de__btn--primary {
    background: #2563eb;
    color: #fff;
}

.epai-de__btn--primary:hover {
    background: #1d4ed8;
}

.epai-de__btn--secondary {
    background: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
}

.epai-de__btn--secondary:hover {
    background: #475569;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .epai-de__sidebar {
        display: none;
    }

    .epai-de__tool-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .epai-de__footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .epai-de__btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}
