/**
 * Warehouse Diagram Builder - Estilos públicos
 * Sincronizado con admin - Sin fondos, estilo minimalista
 */

 :root {
    --wdb-primary: #4f46e5;
    --wdb-primary-light: #818cf8;
    --wdb-line-color: #d1d5db;
    --wdb-text-dark: #1f2937;
    --wdb-text-light: #6b7280;
    --wdb-border-light: #e5e7eb;
}

.wdb-diagram-wrapper {
    width: 100%;
    height: auto;
    min-height: 400px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Canvas Container */
.wdb-canvas-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.wdb-canvas {
    position: relative;
    width: 1200px;
    height: 800px;
    margin: 0;
    transform-origin: 0 0;
}

/* Background Image */
.wdb-background-image {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.wdb-background-image img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    display: block;
}

/* Elements Container */
.wdb-elements-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* SVG Connections */
.wdb-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.wdb-connections-svg path {
    stroke: var(--wdb-primary);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    opacity: 0.6;
}

.wdb-connections-svg circle {
    fill: var(--wdb-primary);
    r: 3;
    opacity: 0.8;
}

/* Info Box - Sin fondo, estilo idéntico al admin */
.wdb-info-box {
    position: absolute;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 50;
    overflow: visible;
    pointer-events: auto;
    padding: 20px;
}

.wdb-info-box.title-only {
    padding: 10px 15px;
}

.wdb-info-box .box-header {
    padding: 0 0 12px 0;
    border-bottom: 1px dashed var(--wdb-line-color);
    background: transparent !important;
}

.wdb-info-box.title-only .box-header {
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.wdb-info-box .box-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wdb-text-dark);
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.wdb-info-box.title-only .box-header h4 {
    font-size: 16px;
    flex: 1;
}

.wdb-info-box .box-content {
    padding: 12px 0 0 0;
    background: transparent !important;
}

.wdb-info-box .box-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wdb-info-box .box-content li {
    margin: 0;
    padding: 0;
    font-size: 15px;
    color: var(--wdb-text-light);
    line-height: 1.6;
}

/* Image Points - Morados como las líneas */
.wdb-image-point {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--wdb-primary);
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

.wdb-image-point:hover {
    transform: scale(1.5);
    box-shadow: 0 3px 6px rgba(79, 70, 229, 0.5);
}

/* Responsive - escalado proporcional */
@media (max-width: 1250px) {
    .wdb-diagram-wrapper {
        overflow: hidden;
        height: 640px; /* 800 * 0.8 */
    }

    .wdb-canvas {
        transform-origin: top left;
        transform: scale(0.8);
        width: 1200px !important;
        height: 800px !important;
    }
}

@media (max-width: 1024px) {
    .wdb-diagram-wrapper {
        height: 480px; /* 800 * 0.6 */
        min-height: auto;
    }

    .wdb-canvas {
        transform: scale(0.6);
    }

    /* Textos más grandes en tablet */
    .wdb-info-box .box-header h4 {
        font-size: 20px !important;
    }

    .wdb-info-box.title-only .box-header h4 {
        font-size: 18px !important;
    }

    .wdb-info-box .box-content li {
        font-size: 16px !important;
    }
}

@media (max-width: 768px) {
    .wdb-diagram-wrapper {
        height: 360px; /* 800 * 0.45 */
    }

    .wdb-canvas {
        transform: scale(0.45);
    }
}

@media (max-width: 480px) {
    .wdb-diagram-wrapper {
        height: 280px; /* 800 * 0.35 */
        overflow-y: hidden;
    }

    .wdb-canvas {
        transform: scale(0.35);
    }
}

/* Loading y error states */
.wdb-diagram-loading {
    text-align: center;
    padding: 40px;
    color: var(--wdb-text-light);
}

.wdb-diagram-loading:before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: var(--wdb-primary);
    border-radius: 50%;
    animation: wdb-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes wdb-spin {
    to { transform: rotate(360deg); }
}

.wdb-diagram-error {
    text-align: center;
    padding: 40px;
    color: #ef4444;
}

/* Print styles */
@media print {
    .wdb-diagram-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
        background: white !important;
    }

    .wdb-info-box {
        page-break-inside: avoid;
    }

    @page {
        size: landscape;
    }
}