/* Base styles - Reset, body, header, main container */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    overflow: hidden;
}

/* Header */
.header {
    background: #1a237e;
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
}

.header-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    opacity: 0.9;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255,255,255,0.2);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active { background: #4caf50; }
.toggle-switch.disabled { opacity: 0.4; cursor: not-allowed; }
.toggle-group.disabled { opacity: 0.4; }
.toggle-group.disabled .toggle-label { cursor: not-allowed; }

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.toggle-switch.active::after { left: 20px; }

.zoom-controls {
    display: flex;
    gap: 8px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover { background: rgba(255,255,255,0.2); }

/* Main container */
.diagram-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - 50px);
    overflow: hidden;
    cursor: grab;
}

.diagram-container.dragging { cursor: grabbing; }

/* Canvas */
.canvas {
    position: absolute;
    width: 1600px;
    height: 1200px;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
}

/* SVG layer for connections - ABOVE REGIONS */
.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}
