/* Custom CSS for FlowSketcher Pro */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    overflow: hidden;
    user-select: none;
}

/* Hand-drawn effect */
.hand-drawn {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Canvas styles */
#main-canvas {
    cursor: crosshair;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(156, 163, 175, 0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

.dark #main-canvas {
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(156, 163, 175, 0.1) 1px, transparent 0);
}

/* Tool buttons */
.tool-btn {
    @apply relative p-3 rounded-lg transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-800;
}

.tool-btn.active {
    @apply bg-primary-100 dark:bg-primary-900 text-primary-600 dark:text-primary-400;
}

.tool-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Color picker */
.color-picker-wrapper {
    position: relative;
    overflow: hidden;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.dark .color-picker-wrapper {
    border-color: #374151;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    right: -8px;
    top: -8px;
    width: 56px;
    height: 56px;
    border: none;
    cursor: pointer;
    opacity: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Animation for new elements */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.shape-animating {
    animation: fadeIn 0.2s ease-out;
}

/* Selection box */
.selection-box {
    border: 2px dashed #6366f1;
    background: rgba(99, 102, 241, 0.1);
    pointer-events: none;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #6366f1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

/* Text input for shapes */
.shape-text-input {
    position: absolute;
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    pointer-events: all;
}

/* Loading animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}