/* ==========================================
   Grid Snap Module Styles
   Controls for grid snapping feature
   ========================================== */

/* 
 * Settings Section - matches DEV-1248 structure (canvas-toolbar.css)
 * Note: When DEV-1248 is merged, these styles will be in canvas-toolbar.css
 * and this definition will be redundant but not conflicting.
 */
.settings-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.grid-snap-toggle-container {
    display: flex;
    align-items: center;
    padding: 8px 0;
    gap: 8px;
}

.grid-snap-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #333;
    transition: color 0.2s ease;
}

.grid-snap-toggle-label:hover {
    color: #28a745;
}

.grid-snap-toggle-text {
    font-weight: 500;
}

/* Checkbox styling */
#gridSnapToggle {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

/* Visual indicator when grid snap is active */
#gridSnapToggle:checked + .grid-snap-toggle-text {
    color: #28a745;
}

/* Snap All button */
.btn-snap-all {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-snap-all:hover {
    background: #218838;
}

.btn-snap-all:active {
    transform: scale(0.95);
}

/* Grid overlay SVG - positioned like other canvas layers */
#gridOverlaySvg {
    position: absolute;
    top: 0;
    left: 0;
    width: 10000px;
    height: 8000px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1; /* Above white background, below connections */
}

/* Show grid when canvas has grid-snap-enabled class */
.canvas-area.grid-snap-enabled #gridOverlaySvg {
    opacity: 1;
}

/* Make grid lines slightly more visible during drag */
.canvas-area.grid-snap-enabled.dragging #gridOverlaySvg {
    opacity: 0.8;
}

