* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calculator {
    background: #2c3e50;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 350px;
    margin: 0 auto;
}

.display {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.previous-operand {
    font-size: 1.2rem;
    color: #7f8c8d;
    min-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-operand {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

button {
    padding: 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

button:hover:before {
    transform: translateX(0);
}

button:active {
    transform: scale(0.95);
}

.number {
    background: #34495e;
    color: #ecf0f1;
}

.number:hover {
    background: #3d566e;
}

.operation {
    background: #e74c3c;
    color: white;
}

.operation:hover {
    background: #c0392b;
}

.clear, .backspace {
    background: #95a5a6;
    color: #2c3e50;
    font-size: 1.2rem;
}

.clear:hover, .backspace:hover {
    background: #7f8c8d;
}

.equals {
    background: #27ae60;
    color: white;
    grid-column: span 2;
}

.equals:hover {
    background: #229954;
}

.zero {
    grid-column: span 2;
}

.decimal {
    background: #34495e;
    color: #ecf0f1;
}

.decimal:hover {
    background: #3d566e;
}

@media (max-width: 400px) {
    .calculator {
        padding: 15px;
        max-width: 300px;
    }
    
    button {
        padding: 15px;
        font-size: 1.2rem;
    }
    
    .current-operand {
        font-size: 2rem;
    }
}

.calculator-title {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.instructions {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 20px;
    font-size: 0.9rem;
}
