* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 20px;
}

.calculator {
    background: rgba(25, 25, 45, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    padding: 25px;
    width: 540px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.display {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.previous-operand {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    margin-bottom: 10px;
    min-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-operand {
    color: white;
    font-size: 2.2rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
}

button {
    border: none;
    outline: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(30, 30, 50, 0.8);
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    border-radius: 12px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    background: rgba(40, 40, 60, 0.9);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.operator {
    background: rgba(100, 70, 200, 0.5);
}

.operator:hover {
    background: rgba(120, 90, 220, 0.7);
    box-shadow: 0 0 15px rgba(120, 90, 220, 0.5);
}

.equals {
    background: rgba(240, 90, 40, 0.7);
    grid-column: span 2;
}

.equals:hover {
    background: rgba(255, 110, 60, 0.9);
    box-shadow: 0 0 20px rgba(255, 110, 60, 0.6);
}

.clear, .delete {
    background: rgba(200, 60, 60, 0.6);
}

.clear:hover, .delete:hover {
    background: rgba(220, 80, 80, 0.8);
    box-shadow: 0 0 15px rgba(220, 80, 80, 0.5);
}

.glow {
    animation: glow 0.5s ease-out;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    }
}

.title {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-size: 1.2rem;
    letter-spacing: 2px;
}