/* Corner Scaling Handle Styles */

.corner-scale-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: rgba(128, 128, 128, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: nw-resize;
    display: flex;
    align-items: center;
    justify-content: center;    color: rgba(255, 255, 255, 0.8);
    font-size: 8px;
    z-index: 10;
    transition: all 0.2s ease;
    transform: translate(50%, 50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
}

/* Show handle when tool is hovered */
.tool:hover .corner-scale-handle {
    opacity: 0.4;
}

.corner-scale-handle:hover {
    background: rgba(128, 128, 128, 0.7);
    transform: translate(50%, 50%) scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
}

.corner-scale-handle:active {
    background: rgba(100, 100, 100, 0.8);
    transform: translate(50%, 50%) scale(0.95);
    opacity: 1;
}

/* Visual feedback during scaling */
.tool.corner-scaling {
    box-shadow: 0 4px 16px rgba(128, 128, 128, 0.2);
}

.tool.corner-scaling .corner-scale-handle {
    background: rgba(100, 100, 100, 0.9);
    transform: translate(50%, 50%) scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Ensure corner handle doesn't interfere with other elements */
.corner-scale-handle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: transparent;
    border-radius: 50%;
}

/* Hide corner handle when tool is in spotlight mode */
.tool.spotlight-mode .corner-scale-handle {
    display: none !important;
}

/* Ensure spotlight mode tools maintain consistent styling regardless of hover states */
.tool.spotlight-mode {
    pointer-events: auto !important;
}

.tool.spotlight-mode:hover .corner-scale-handle {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .corner-scale-handle {
        width: 24px;
        height: 24px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .corner-scale-handle {
        transition: none;
    }
    
    .corner-scale-handle:hover {
        transform: translate(50%, 50%);
    }
    
    .tool.corner-scaling .corner-scale-handle {
        transform: translate(50%, 50%);
    }
}
