/* ===== SIGNATRACE STYLES ===== */
.canvas-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #ffffff;
    overflow: hidden;
    border-radius: 0;
}

/* Grid Background */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, #e2e8f0 1px, transparent 1px),
        linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    z-index: 1;
}

/* Signature Baseline */
.signature-line {
    position: absolute;
    bottom: 60px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #94a3b8, #94a3b8, #94a3b8, transparent);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.signature-line.hidden {
    opacity: 0;
}

/* Canvas Element */
#sigCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 3;
    touch-action: none;
    display: block;
}

/* Toggle Switch */
.toggle-bg {
    transition: background-color 0.2s ease;
}

input:checked ~ .toggle-bg {
    background-color: #4f46e5;
}

input:checked ~ .toggle-dot {
    transform: translateX(20px);
}

.toggle-dot {
    transition: transform 0.2s ease;
}

/* Color Presets */
.color-preset {
    transition: all 0.2s ease;
    cursor: pointer;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.active {
    border-color: #4f46e5;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4f46e5;
    border-radius: 50%;
    margin-top: -6px;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4f46e5;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Drawing indicator */
#drawing-indicator {
    transition: opacity 0.1s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .canvas-container {
        height: 350px;
    }
    
    .signature-line {
        bottom: 40px;
    }
}

/* Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.drawing-active {
    animation: pulse 1s infinite;
}