/* Enhanced Styles for Wplace Color Converter */

/* Enhanced Slider Styles */
.enhanced-slider-container {
    position: relative;
    width: 100%;
    height: 40px;
    margin: 0.5rem 0;
}

.slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
}

.slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 3px;
    transition: width 0.1s;
}

.slider-ticks {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.slider-tick {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 10px;
    background: #9ca3af;
    transition: background 0.2s;
}

.slider-tick.active {
    background: #3b82f6;
}

.tick-label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
}

/* Magic Badge Hover Effect */
.magic-badge {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.magic-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Color Grid Enhancements */
.color-tile {
    transition: all 0.2s ease;
    position: relative;
}

.color-tile:not(.locked):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Image Palette Display */
.image-palette-display {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    border: 1px solid #d1d5db;
    animation: fadeIn 0.3s ease;
}

.used-colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.palette-color-tile {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.palette-color-tile:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Custom Palette Dialog */
.custom-palette-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Highlight Canvas for Color Visualization */
#highlightCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    mix-blend-mode: normal;
}

/* Preview Viewport Enhancements */
.preview-viewport {
    position: relative;
}

.preview-viewport canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Palette Dropdown Styling */
#paletteSelect {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

#paletteSelect:hover {
    border-color: #3b82f6;
}

#paletteSelect:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Import/Create Buttons Enhancement */
.btn-import, .btn-create {
    transition: all 0.2s ease;
}

.btn-import:hover, .btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* URL Input Enhancement */
.url-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Copy Feedback */
.copy-feedback {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    animation: fadeInOut 1.5s ease;
    pointer-events: none;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .enhanced-slider-container {
        height: 50px;
    }
    
    .tick-label {
        font-size: 9px;
        top: 25px;
    }
    
    .custom-palette-dialog {
        width: 95%;
        padding: 1.5rem;
    }
    
    .palette-color-tile {
        width: 24px;
        height: 24px;
    }
}