@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: drift 20s linear infinite;
    pointer-events: none;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50px, -50px);
    }
}

.container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px 60px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #ffffff;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
}

h1::after {
    content: '🎨';
    position: absolute;
    right: -45px;
    top: -5px;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

#colorPicker {
    width: 150px;
    height: 150px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
                0 0 0 8px rgba(255, 255, 255, 0.2),
                0 0 0 12px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s infinite;
    position: relative;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
                    0 0 0 8px rgba(255, 255, 255, 0.2),
                    0 0 0 12px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
                    0 0 0 12px rgba(255, 255, 255, 0.3),
                    0 0 0 18px rgba(255, 255, 255, 0.1);
    }
}

#colorPicker:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4),
                0 0 0 10px rgba(255, 255, 255, 0.3),
                0 0 0 15px rgba(255, 255, 255, 0.15);
}

#colorPicker:active {
    transform: scale(1.05);
}

/* Remove default color picker appearance for webkit browsers */
#colorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

#colorPicker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

#colorInput {
    width: 100%;
    padding: 18px 55px 18px 20px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    margin: 25px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    animation: slideInRight 0.8s ease-out 0.2s both;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

#colorInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#colorInput:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
                0 0 0 4px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Input wrapper for icon */
.container {
    position: relative;
}

#colorInput::after {
    content: '\f1fc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

p {
    font-size: 1.1rem;
    color: #ffffff;
    margin-top: 20px;
    opacity: 0.9;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
    animation: fadeIn 1s ease-out 0.4s both;
    font-weight: 300;
    letter-spacing: 0.5px;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.9;
    }
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 40px 30px;
    }

    h1 {
        font-size: 2rem;
    }

    h1::after {
        right: -35px;
        font-size: 1.5rem;
    }

    #colorPicker {
        width: 120px;
        height: 120px;
    }

    #colorInput {
        font-size: 0.9rem;
        padding: 15px 20px;
    }

    p {
        font-size: 1rem;
    }
}