/* Drawing Tools Styles for Nano Banana */

/* Drawing Mode Indicator */
.drawing-mode-active {
    position: relative;
}

.drawing-mode-active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid #10b981;
    border-radius: inherit;
    pointer-events: none;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Drawing Toolbar */
.drawing-toolbar {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Tool Buttons */
.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.tool-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: transparent;
}

.tool-btn.active::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 10px;
    opacity: 0.3;
    z-index: -1;
}

/* Tool Divider */
.tool-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-picker-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-preset {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

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

.color-preset.active {
    border-color: white;
}

.color-preset.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-input {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

/* Size Slider */
.size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.size-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #059669;
}

.size-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.size-value {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 30px;
    text-align: center;
}

/* Opacity Control */
.opacity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.opacity-slider {
    width: 60px;
}

/* Action Buttons */
.drawing-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Canvas Overlay Styles */
#drawingCanvas, #tempCanvas {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#drawingCanvas.drawing-active {
    cursor: crosshair;
}

/* Drawing Mode Toggle */
.drawing-toggle {
    padding: 8px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drawing-toggle:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.drawing-toggle.active {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .drawing-toolbar {
        flex-wrap: wrap;
        max-width: 100%;
        padding: 6px;
    }
    
    .tool-btn {
        width: 32px;
        height: 32px;
    }
    
    .size-control, .opacity-control {
        flex: 1;
        min-width: 120px;
    }
    
    .size-slider, .opacity-slider {
        flex: 1;
    }
    
    .drawing-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 4px;
    }
}

/* Tooltips */
.tool-btn[title] {
    position: relative;
}

.tool-btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade 0.2s forwards;
}

@keyframes tooltip-fade {
    to { opacity: 1; }
}

/* Drawing Indicator Badge */
.has-drawings-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #111827;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}