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

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-color: #8b5cf6;
    --operator-color: #3b82f6;
    --clear-color: #ef4444;
    --text-primary: #ffffff;
}

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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    overflow: hidden;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.calculator {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 340px;
    position: relative;
    z-index: 1;
}

.calculator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--glass-border), transparent);
    border-radius: 24px;
    z-index: -1;
}

#display {
    width: 100%;
    height: 80px;
    font-size: 2.5rem;
    font-weight: 300;
    text-align: right;
    margin-bottom: 25px;
    padding: 15px 20px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-color);
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    outline: none;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

button {
    height: 60px;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.15);
}

.btn-operator {
    background: rgba(255, 157, 0, 0.15);
    color: var(--operator-color);
    border: 1px solid rgba(255, 157, 0, 0.3);
}

.btn-operator:hover {
    background: rgba(255, 157, 0, 0.25);
}

.btn-equal {
    background: var(--accent-color);
    color: #000;
    font-weight: 700;
}

.btn-equal:hover {
    background: #00e67a;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-clear {
    background: rgba(255, 75, 43, 0.15);
    color: var(--clear-color);
    border: 1px solid rgba(255, 75, 43, 0.3);
}

.btn-clear:hover {
    background: rgba(255, 75, 43, 0.25);
}

.col-2 {
    grid-column: span 2;
}

/* Background floating elements for extra depth */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.15;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -100px;
    left: -100px;
    background: var(--operator-color);
}

.blob-2 {
    bottom: -100px;
    right: -100px;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}