/* Random Color Palette Generator Custom Styles */

.palette-display {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-swatch {
    min-height: 120px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.color-swatch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.1) 50%, transparent 51%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-swatch:hover::before {
    opacity: 1;
}

.copy-color-btn {
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.copy-color-btn:hover {
    transform: scale(1.1);
}

.copy-value-btn {
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.copy-value-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.color-details {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.color-details:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-generate > div {
    transition: all 0.2s ease;
}

.quick-generate:hover > div {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-info-animation {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading state */
.palette-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Toast notifications */
.toast {
    font-weight: 500;
    font-size: 14px;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .color-swatch {
        min-height: 100px;
    }

    .color-swatch .font-bold {
        font-size: 14px;
    }

    .color-swatch .text-sm {
        font-size: 12px;
    }
}

/* Enhanced color preview circles */
.color-preview-circle {
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.color-preview-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Enhanced form controls */
select:focus,
input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button enhancements */
button {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Palette grid responsiveness */
@media (min-width: 1024px) {
    .palette-grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }

    .palette-grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    .palette-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .palette-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Enhanced contrast for accessibility */
.high-contrast-text {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.low-contrast-text {
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* Smooth scrolling for palette container */
.palette-container {
    scroll-behavior: smooth;
}

/* Export/Save button enhancements */
.action-button {
    position: relative;
    overflow: hidden;
}

.action-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-button:active::after {
    width: 300px;
    height: 300px;
}

/* Color name truncation for long names */
.color-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Enhanced focus states for accessibility */
button:focus-visible,
select:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Improved spacing for mobile devices */
@media (max-width: 768px) {
    .mobile-spacing {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
