/* Scarlet Color Tool CSS */

/* Custom slider styling */
input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #FF2400;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #FF2400;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #CC1D00;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #CC1D00;
}

/* Hue slider gradient */
#hueSlider {
    background: linear-gradient(to right, #FF0000, #FF2400, #FF4500);
}

/* Saturation slider gradient */
#saturationSlider {
    background: linear-gradient(to right, #808080, #FF2400);
}

/* Lightness slider gradient */
#lightnessSlider {
    background: linear-gradient(to right, #000000, #FF2400, #FFFFFF);
}

/* Color sample in table */
.color-sample {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Palette color hover effect */
.palette-color {
    transition: transform 0.2s ease;
    position: relative;
}

.palette-color:hover {
    transform: scale(1.05);
    z-index: 10;
}

.palette-color:hover::after {
    content: "Click to select";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 20;
}

/* Copy button hover effects */
.copy-icon {
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-icon:hover {
    transform: scale(1.2);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .grid-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .grid-cols-5 > div:nth-child(4),
    .grid-cols-5 > div:nth-child(5) {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .grid-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-cols-5 > div:nth-child(3),
    .grid-cols-5 > div:nth-child(4),
    .grid-cols-5 > div:nth-child(5) {
        margin-top: 1rem;
    }
}

/* Preset color buttons active state */
.preset-color.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #FF2400;
}

/* Table hover effects */
.hover\:bg-gray-50:hover {
    background-color: rgba(249, 250, 251, 0.8);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.palette-color, #currentColor {
    animation: fadeIn 0.3s ease-in-out;
}

/* Focus styles for accessibility */
button:focus, a:focus, input:focus, select:focus {
    outline: 2px solid rgba(255, 36, 0, 0.5);
    outline-offset: 2px;
}

/* Custom scrollbar for the table */
.overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #FF2400;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #CC1D00;
}