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

body {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #181818 0%, #1b1b1b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: pulse 4s ease-in-out infinite;
}

body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.calculator {
    padding: 25px;
    width: 340px;
    background: rgba(5, 0, 31, 0.096);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.calculator:hover {
    transform: translateY(-5px);
}

.display-container {
    background: rgba(20, 20, 32, 0.6);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

input {
    width: 100%;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: right;
    background: transparent;
    font-size: 42px;
    font-weight: 300;
    color: #ffffff;
    border: none;
    outline: none;
    letter-spacing: 2px;
}

input::selection {
    background: rgba(139, 92, 246, 0.3);
}

.button-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

button {
    border: none;
    height: 65px;
    border-radius: 15px;
    background: rgba(45, 45, 68, 0.8);
    color: #e0e0e0;
    font-size: 22px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

button:active::before {
    width: 200px;
    height: 200px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: rgba(55, 55, 78, 0.9);
}

button:active {
    transform: translateY(0);
}

.operator {
    color: #8b5cf6;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
}

.operator:hover {
    background: rgba(139, 92, 246, 0.25);
    color: #a78bfa;
}

.equel {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 26px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.equel:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

.btn {
    font-weight: 400;
}

.btn:hover {
    color: #ffffff;
}

/* Responsive design */
@media (max-width: 400px) {
    .calculator {
        width: 90%;
        padding: 20px;
    }

    button {
        height: 55px;
        font-size: 20px;
    }

    input {
        font-size: 36px;
    }
}