﻿/* EspacioComandas.css
   Agregar en wwwroot/css/ e importar en app.css o _Host.cshtml */

/* ── Contenedor principal ──────────────────────────────────────────────── */

.espacio-comandas {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bs-body-bg, #f8f9fa);
}

/* ── Toolbar ───────────────────────────────────────────────────────────── */

.ec-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--app-surface-1, #fff);
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ec-toolbar-sep {
    width: 1px;
    height: 20px;
    background: #dee2e6;
    margin: 0 4px;
}

.ec-zonas {
    display: flex;
    gap: 4px;
}

.ec-zona-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    transition: all .12s;
}

    .ec-zona-btn:hover {
        background: #f0f0f0;
        color: #212529;
    }

    .ec-zona-btn.active {
        background: #e8f0fe;
        border-color: #4f7cff;
        color: #4f7cff;
        font-weight: 500;
    }

.ec-tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    transition: all .12s;
}

    .ec-tool-btn:hover {
        background: #f0f0f0;
        color: #212529;
    }

    .ec-tool-btn.active {
        background: #fff3cd;
        border-color: #ffc107;
        color: #856404;
        font-weight: 500;
    }

.ec-leyenda {
    display: flex;
    gap: 14px;
    margin-left: auto;
    align-items: center;
    flex-wrap: wrap;
}

.ec-leg {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
}

.ec-leg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .ec-leg-dot.libre {
        background: #2ecc8a;
    }

    .ec-leg-dot.ocupada {
        background: #f05260;
    }

    .ec-leg-dot.reservada {
        background: #f5a623;
    }

/* ── Body (canvas + panel) ─────────────────────────────────────────────── */

.ec-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Canvas ────────────────────────────────────────────────────────────── */

.ec-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f0;
    background-image: radial-gradient(circle, #ccc 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ── Entidades (mesas, habitaciones, etc.) ─────────────────────────────── */

.ec-entidad {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid transparent;
    transition: box-shadow .12s, transform .08s;
}

    .ec-entidad:hover {
        transform: scale(1.04);
    }

    .ec-entidad.modo-edicion {
        cursor: grab;
    }

        .ec-entidad.modo-edicion:hover {
            transform: scale(1.02);
            box-shadow: 0 2px 8px rgba(0,0,0,.15);
        }

    .ec-entidad.arrastrando {
        cursor: grabbing !important;
        opacity: .75;
        transform: scale(1.06);
        box-shadow: 0 6px 20px rgba(0,0,0,.2);
    }

    .ec-entidad.seleccionada {
        box-shadow: 0 0 0 3px #4f7cff, 0 4px 12px rgba(79,124,255,.25);
        z-index: 10;
    }

    /* Estados */
    .ec-entidad.entidad-libre {
        background: #e1f5ee;
        border-color: rgba(46,204,138,.5);
    }

    .ec-entidad.entidad-ocupada {
        background: #fcebeb;
        border-color: rgba(240,82,96,.5);
    }

    .ec-entidad.entidad-reservada {
        background: #faeeda;
        border-color: rgba(245,166,35,.5);
    }

/* Textos internos */
.ec-entidad-num {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.entidad-libre .ec-entidad-num {
    color: #0f6e56;
}

.entidad-ocupada .ec-entidad-num {
    color: #a32d2d;
}

.entidad-reservada .ec-entidad-num {
    color: #854f0b;
}

.ec-entidad-cap {
    font-size: 10px;
    color: #888;
    margin-top: 3px;
}

.ec-entidad-info {
    font-size: 9px;
    position: absolute;
    bottom: 4px;
    right: 6px;
    color: #aaa;
}

/* ── Panel lateral ─────────────────────────────────────────────────────── */

.ec-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--app-surface-1, #fff);
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}

.ec-panel-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ec-panel-titulo {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.ec-panel-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.ec-estado-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

    .ec-estado-badge.entidad-libre {
        background: #e1f5ee;
        color: #0f6e56;
    }

    .ec-estado-badge.entidad-ocupada {
        background: #fcebeb;
        color: #a32d2d;
    }

    .ec-estado-badge.entidad-reservada {
        background: #faeeda;
        color: #854f0b;
    }

.ec-panel-cerrar {
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

    .ec-panel-cerrar:hover {
        color: #495057;
    }

.ec-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ec-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 140px;
    gap: 8px;
    color: #aaa;
}

    .ec-panel-placeholder p {
        font-size: 13px;
    }

.ec-panel-acciones {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid #dee2e6;
}

/* ── Botones de acción ─────────────────────────────────────────────────── */

.ec-btn {
    padding: 8px 14px;
    border-radius: 7px;
    border: 1px solid #dee2e6;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all .12s;
    font-family: inherit;
}

    .ec-btn:hover {
        background: #f5f5f5;
    }

.ec-btn-primary {
    background: #4f7cff;
    border-color: #4f7cff;
    color: #fff;
}

    .ec-btn-primary:hover {
        background: #3a6ae8;
    }

.ec-btn-success {
    border-color: rgba(46,204,138,.5);
    color: #0f6e56;
}

    .ec-btn-success:hover {
        background: #e1f5ee;
    }

.ec-btn-secondary {
    color: #495057;
}

.ec-btn-danger {
    border-color: rgba(240,82,96,.4);
    color: #a32d2d;
}

    .ec-btn-danger:hover {
        background: #fcebeb;
    }
