/* Color Palette Generator Custom Styles */

/* Color Preview Animations */
.color-preview .group\/color {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-preview .group\/color:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Palette Card Hover Effects */
.palette-card {
    transition: all 0.3s ease;
}

.palette-card:hover {
    transform: translateY(-4px);
}

/* Color Analysis Gradients */
.color-analysis .aspect-square {
    background: linear-gradient(135deg, var(--color) 0%, var(--color) 100%);
    position: relative;
}

.color-analysis .aspect-square::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Mode Button Active State */
.mode-btn.active {
    position: relative;
    overflow: hidden;
}

.mode-btn.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: slide 2s infinite;
}

@keyframes slide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Color Harmony Previews */
.color-harmony {
    position: relative;
    overflow: hidden;
}

.color-harmony::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: sweep 2s infinite;
}

@keyframes sweep {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Loading Animation */
#loading-state .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Toast Animations */
.toast-enter {
    animation: toastSlideIn 0.3s ease-out;
}

.toast-exit {
    animation: toastSlideOut 0.3s ease-in;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Color Input Focus Effects */
input[type="color"] {
    transition: all 0.2s ease;
}

input[type="color"]:focus {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Custom Scrollbar for Modal */
#palette-modal .overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

#palette-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
}

#palette-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

#palette-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Gradient Backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .color-preview {
        height: 60px;
    }

    .color-preview .group\/color:hover {
        transform: none;
        flex: 2;
    }

    #palette-modal .max-w-4xl {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .color-preview .group\/color,
    .palette-card,
    .mode-btn,
    input[type="color"] {
        transition: none;
    }

    .color-analysis .aspect-square::before,
    .mode-btn.active::before,
    .color-harmony::after,
    #loading-state .animate-spin {
        animation: none;
    }
}

/* Focus Indicators */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-white\/80 {
        background-color: white;
    }

    .border-gray-200 {
        border-color: #000;
    }
}
