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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(45deg, #6a11cb, #2575fc, #37ecba);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    padding: 20px;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: containerEntrance 0.8s ease;
    position: relative;
    overflow: hidden;
}

@keyframes containerEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.container:hover::before {
    left: 100%;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.header h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.input {
    margin-bottom: 2rem;
    position: relative;
}

#input-label {
    display: block;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

#input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1.1rem;
    color: white;
    transition: all 0.3s ease;
}

#input:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    animation: inputFocus 1.5s infinite;
}

@keyframes inputFocus {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); }
}

#input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#output-label {
    display: block;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

#output {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-top: 1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: resultPulse 2s infinite;
}

@keyframes resultPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@media (max-width: 480px) {
    .container {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    #input {
        padding: 0.8rem;
        font-size: 1rem;
    }
    
    #output {
        font-size: 1.8rem;
        padding: 1rem;
    }
}

/* New Border Animation */
.container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6a11cb, #2575fc, #37ecba);
    z-index: -1;
    border-radius: 22px;
    animation: borderAnimation 4s linear infinite;
    background-size: 400% 400%;
}

@keyframes borderAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}