/* Gradient Generator Custom Styles */

/* Gradient Preview Enhancements */
#gradientPreview {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Override any Tailwind bg-black interference - but don't override background gradients */
#gradientPreview.bg-black {
    background-color: transparent !important;
}

/* Ensure Tailwind background classes don't interfere */
#gradientPreview.bg-gradient-to-r {
    background: none !important;
}

#gradientPreview:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Temporarily disable overlay to debug gradient visibility */
/*
#gradientPreview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#gradientPreview:hover::before {
    opacity: 1;
}
*/

/* Range Slider Styling */
.slider {
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e2e8f0, #3b82f6);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Quick Color Button Animations */
.quick-color {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.quick-color:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quick-color:active {
    transform: scale(0.95);
}

.quick-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quick-color:hover::before {
    opacity: 1;
}

/* Color Swatch Styling */
.color-swatch {
    transition: all 0.3s ease;
    background: white;
}

.color-swatch:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.02);
}

.color-swatch:active {
    transform: translateY(0) scale(0.98);
}

/* Variation Item Styling */
.variation-item {
    transition: all 0.3s ease;
}

.variation-item:hover {
    transform: translateY(-2px);
}

.variation-item:active {
    transform: translateY(0);
}

/* Gradient Variation Preview Fix */
.gradient-variation-preview {
    background-color: transparent !important;
}

.gradient-variation-preview.bg-black,
.gradient-variation-preview.bg-gray-900,
.gradient-variation-preview.bg-gray-800 {
    background-color: transparent !important;
}

/* Export Button Animations */
.export-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-btn:active {
    transform: translateY(0);
}

.export-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.export-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Code Output Styling */
#cssOutput {
    font-family: "Courier New", Consolas, Monaco, monospace;
    line-height: 1.6;
    color: #374151;
    word-break: break-all;
}

/* Loading Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Success Message Animation */
#successMessage {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .color-swatch {
        padding: 0.75rem;
    }

    .color-swatch .text-sm {
        font-size: 0.8rem;
    }

    .export-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    #gradientPreview {
        height: 200px;
    }
}

/* Focus States for Accessibility */
.slider:focus {
    box-shadow: 0 0 0 2px #3b82f6;
}

.quick-color:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.export-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.color-swatch:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom Scrollbar */
#cssOutput::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#cssOutput::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#cssOutput::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#cssOutput::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Gradient Animation for Preview */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Color Picker Styling */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0.5rem;
}

input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Button Hover Effects */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}
