/* Utilities & Scrollbar */
.pt-safe {
    padding-top: env(safe-area-inset-top);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #2A2F45;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #3B82F6;
}

/* SVG Background pattern */
.grid-bg {
    background-image: radial-gradient(#2A2F45 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Tool buttons */
.tool-btn.active {
    background-color: rgba(59, 130, 246, 0.15);
    /* Primary tint */
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Layer items */
.layer-item.active {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Range input vertical */
input[type=range].custom-range {
    -webkit-appearance: none;
    background: #2A2F45;
}

input[type=range].custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3B82F6;
    cursor: pointer;
}

input[type=range].custom-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3B82F6;
    cursor: pointer;
}

/* Color inputs */
input[type="color"] {
    -webkit-appearance: none;
    padding: 0;
    border: 2px solid #2A2F45;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* SVG Selection UI elements */
.svg-handle {
    fill: #fff;
    stroke: #3B82F6;
    stroke-width: 2;
    cursor: grab;
    transition: transform 0.1s;
}

.svg-handle:hover {
    transform: scale(1.2);
    fill: #3B82F6;
}

.svg-handle:active {
    cursor: grabbing;
}

.svg-bbox {
    fill: none;
    stroke: #3B82F6;
    stroke-width: 1;
    stroke-dasharray: 4, 4;
    pointer-events: none;
}

.svg-element-drawn {
    cursor: pointer;
    transition: filter 0.2s;
}

.svg-element-drawn:hover {
    filter: brightness(1.2);
}