/* Canvas Tool Styles */
.canvas-tools {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.canvas-tool {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.canvas-tool:hover {
    background-color: #4b5563;
    color: #e5e7eb;
    border-color: #6b7280;
    transform: translateY(-1px);
}

.canvas-tool.active {
    background-color: #2563eb;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    transform: scale(1.05);
}

.canvas-tool.active:hover {
    background-color: #1d4ed8;
    border-color: #2563eb;
    transform: scale(1.05);
}

/* Canvas container */
.canvas-container {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    overflow: hidden;
}

.canvas-container:fullscreen {
    background-color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container:fullscreen #canvasElement {
    max-width: 100%;
    max-height: 100%;
}

/* Canvas element */
#canvasElement {
    display: block;
    touch-action: none;
    user-select: none;
}

/* Color picker styling */
#colorPicker {
    width: 36px;
    height: 36px;
    border: 2px solid #4b5563;
    border-radius: 0.375rem;
    cursor: pointer;
    background-color: transparent;
    padding: 2px;
}

#colorPicker:hover {
    border-color: #6b7280;
}

/* Brush size slider */
#brushSize {
    appearance: none;
    background: #374151;
    outline: none;
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
}

#brushSize::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

#brushSize::-webkit-slider-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

#brushSize::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

#brushSize::-moz-range-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

/* Text input for text tool */
#textInput {
    position: absolute;
    z-index: 10;
    background-color: #1f2937;
    border: 1px solid #374151;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    min-width: 150px;
}

#textInput:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Divider in toolbar */
.canvas-tools .border-l {
    height: 24px;
    align-self: center;
}

/* Fullscreen button */
.canvas-container:fullscreen ~ .acme-button-secondary {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

/* Labels */
.canvas-tools label,
.text-xs.text-gray-400 {
    user-select: none;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .canvas-tool {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    #colorPicker {
        width: 32px;
        height: 32px;
    }
}

/* Dark theme adjustments */
.theme-dark .canvas-tool {
    background-color: #1f2937;
    border-color: #374151;
}

.theme-dark .canvas-tool:hover {
    background-color: #374151;
    border-color: #4b5563;
}

.theme-dark .canvas-container {
    border-color: #374151;
}

/* Prevent text selection when drawing */
.canvas-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Custom cursors for tools */
.canvas-container[data-tool="pen"] {
    cursor: crosshair;
}

.canvas-container[data-tool="text"] {
    cursor: text;
}

.canvas-container[data-tool="eraser"] {
    cursor: none; /* We'll show custom cursor */
}

/* Cursor preview circle */
.cursor-preview {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.canvas-container[data-tool="eraser"] .cursor-preview {
    display: block;
    background-color: rgba(255, 255, 255, 0.1);
}