/* Estilos para el editor de salones */
.salon-editor {
    display: flex;
    width: 100%;
    height: 700px; /* Aumentado para mostrar mÃ¡s contenido vertical */
    background-color: #f8f9fa;
    position: relative;
    margin-top: -10px;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    overflow: hidden; /* Evita que el contenido se salga */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-mesas {
    width: 250px; /* Aumentado para mÃ¡s espacio en la lista de combinaciones */
    background-color: white;
    border-right: 1px solid #e9ecef;
    padding: 0;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto; /* Scroll si hay muchos tipos de mesas */
    z-index: 20; /* Por encima de la cuadrÃ­cula */
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
}

.editor-tab {
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-tab.active {
    color: white;
    background: linear-gradient(90deg, #2563eb, #4338ca);
}

.editor-tab:hover:not(.active) {
    background-color: #f1f5f9;
}

.tipos-mesas-title {
    display: flex;
    align-items: center;
    padding: 15px;
    font-weight: bold;
    color: #1e3a8a;
}

.tipos-mesas-title svg {
    margin-right: 8px;
}

.mesa-tipo-container {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.mesa-tipo-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
}

.mesa-tipo-options {
    display: flex;
    gap: 10px;
}

.mesa-tipo {
    cursor: grab;
    border: 2px solid #2563eb;
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2563eb;
    transition: all 0.2s;
}

.mesa-tipo:hover {
    background-color: #dbeafe;
}

.mesa-tipo:active {
    cursor: grabbing;
}

.mesa-tipo.square {
    width: 60px;
    height: 60px;
}

.mesa-tipo.round {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.mesa-tipo-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mesa-tipo-capacity {
    margin-top: 3px;
    font-size: 0.7rem;
}

/* Contenedor de la cuadrÃ­cula con lÃ­mites claros */
.salon-grid-container {
    flex-grow: 1;
    position: relative;
    overflow: auto;
    height: 100%;
    background-color: white;
}

.salon-grid {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(rgba(207, 207, 207, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(207, 207, 207, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 20px;
    transform-origin: 0 0;
}

.mesa-element {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    cursor: grab;
    z-index: 10;
    background-color: #10b981;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
    user-select: none; /* Prevenir selecciÃ³n de texto al arrastrar */
}

.mesa-element:active {
    cursor: grabbing;
}

.mesa-element.square {
    border-radius: 2px;
}

.mesa-element.round {
    border-radius: 50%;
}

.mesa-element:hover {
    transform: scale(1.05);
    z-index: 20;
}

.mesa-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Asegurar que los eventos pasen al elemento padre */
}

.mesa-element .mesa-name {
    font-weight: bold;
    line-height: 1;
}

.mesa-element .mesa-capacity {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* BotÃ³n de eliminar para las mesas */
.mesa-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto; /* Asegurar que recibe eventos incluso si el padre tiene pointer-events:none */
}

.mesa-element:hover .mesa-delete-btn {
    opacity: 1;
}

.mesa-delete-btn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Modo eliminar */
.salon-grid.delete-mode .mesa-element {
    cursor: pointer;
    opacity: 0.8;
}

.salon-grid.delete-mode .mesa-element .mesa-delete-btn {
    opacity: 1;
}

.salon-grid.delete-mode .mesa-element:hover {
    background-color: #ef4444;
}

/* Panel de combinaciÃ³n de mesas */
#panel-combinar {
    padding: 10px;
    overflow-y: auto;
    max-height: calc(100% - 40px); /* Altura restante despuÃ©s de las pestaÃ±as */
}

.combine-mesas-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 10px;
}

.mesa-combo-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
}

.mesa-combo-item:hover {
    background-color: #f1f5f9;
}

.mesa-combo-checkbox {
    margin-right: 10px;
}

.mesa-combo-info {
    font-size: 0.85rem;
}

.mesa-combo-actions {
    margin-top: 15px;
    text-align: center;
}

.btn-combine {
    background: linear-gradient(90deg, #2563eb, #4338ca);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

.btn-combine:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.saved-combinations {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 5px;
}

/* Modal para configuraciÃ³n de mesa */
.mesa-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.mesa-config-content {
    background-color: white;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mesa-config-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mesa-config-header h3 {
    margin: 0;
    font-weight: bold;
    color: #2d3748;
}

.mesa-config-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
}

.mesa-config-body {
    padding: 20px;
}

.mesa-config-body .form-group {
    margin-bottom: 16px;
}

.mesa-config-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.mesa-config-body input,
.mesa-config-body select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.mesa-config-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-save {
    background: linear-gradient(90deg, #2563eb, #4338ca);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.mesa-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.mesa-checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Barra de herramientas flotante debajo del encabezado */
.salon-tools {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: flex;
    gap: 8px;
    z-index: 100;
    flex-wrap: wrap;
    justify-content: center;
}

.salon-tool-btn {
    padding: 8px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #4a5568;
    white-space: nowrap;
    font-size: 0.9rem;
}

.salon-tool-btn:hover {
    background-color: #f1f5f9;
}

.salon-tool-btn.active {
    background-color: #fee2e2;
    color: #dc2626;
}

.salon-tool-btn svg {
    margin-right: 8px;
}

/* Vista de salÃ³n mejorada - reducir margen superior */
#view-editor-salon .mb-6 {
    margin-bottom: 0.5rem;
}

/* Estilos para la simulaciÃ³n */
.expand-salon-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
}

.expand-salon-btn:hover {
    background-color: white;
}

/* Modal para visualizaciÃ³n ampliada */
.salon-expanded-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.salon-expanded-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
}

.salon-expanded-header {
    padding: 10px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #059669, #047857);
    color: white;
}

.salon-expanded-header h3 {
    margin: 0;
    font-weight: bold;
}

.salon-expanded-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.salon-expanded-body {
    width: 100%;
    height: calc(100% - 50px);
    overflow: auto;
}

/* Mesa seleccionada para combinar */
.mesa-element.selected-for-combination {
    border: 2px dashed #f59e0b;
    background-color: #fbbf24;
}

/* Ocultar botÃ³n expandir en vista expandida */
.salon-expanded-modal .expand-salon-btn {
    display: none;
}