/* Interactions & Animations */

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-warning {
    border-left: 4px solid #F59E0B;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #111827;
}

/* --- Animations --- */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.pulse-animation {
    animation: pulse 0.3s ease-in-out;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton-box {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* --- Components --- */
.copy-button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    /* For ripple */
}

.color-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.color-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    transition: opacity 0.3s;
    pointer-events: none;
}

.color-card:hover::before {
    opacity: 1;
}

/* Advanced Color Picker */
.sl-picker {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 8px;
    cursor: crosshair;
    background: linear-gradient(to bottom, transparent, black),
        linear-gradient(to right, white, transparent);
    /* background-color set by JS */
    touch-action: none;
}

.sl-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.1s ease-out;
}

.sl-cursor:active {
    transform: translate(-50%, -50%) scale(1.2);
}

.hue-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(to right,
            hsl(0, 100%, 50%),
            hsl(60, 100%, 50%),
            hsl(120, 100%, 50%),
            hsl(180, 100%, 50%),
            hsl(240, 100%, 50%),
            hsl(300, 100%, 50%),
            hsl(360, 100%, 50%));
    outline: none;
}

.hue-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid currentColor;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.hue-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.hue-range::-webkit-slider-thumb:active {
    transform: scale(1.2);
}