* {
    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, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.calculator {
    background-color: #2d3047;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 25px;
    width: 350px;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 300;
    font-size: 1.8rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.display-container {
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#display {
    width: 100%;
    height: 80px;
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    text-align: right;
    padding: 0 10px;
    outline: none;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: default;
}

.previous-operation {
    color: #888;
    text-align: right;
    font-size: 1rem;
    height: 25px;
    padding-right: 10px;
    opacity: 0.8;
}

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

button {
    height: 65px;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.number {
    background: linear-gradient(145deg, #3a3d5c, #323552);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.number:hover {
    background: linear-gradient(145deg, #4a4d7c, #3a3d6c);
}

.operator {
    background: linear-gradient(145deg, #ff9500, #e68500);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.operator:hover {
    background: linear-gradient(145deg, #ffaa33, #ff9500);
}

.equals {
    background: linear-gradient(145deg, #ff2d55, #e6003a);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.equals:hover {
    background: linear-gradient(145deg, #ff4d6d, #ff2d55);
}

.clear, .decimal {
    background: linear-gradient(145deg, #a5a5a5, #8a8a8a);
    color: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.clear:hover, .decimal:hover {
    background: linear-gradient(145deg, #c5c5c5, #a5a5a5);
}

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

/* Efeito de clique */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

button:active::before {
    opacity: 1;
}

/* Indicador de botão pressionado */
button.pressed {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsividade */
@media (max-width: 480px) {
    .calculator {
        width: 320px;
        padding: 20px;
    }
    
    button {
        height: 60px;
        font-size: 1.2rem;
    }
    
    #display {
        font-size: 2rem;
        height: 70px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* Melhorar acessibilidade */
button:focus {
    outline: 2px solid #ff9500;
    outline-offset: 2px;
}

#display:focus {
    outline: none;
}