/* Calculator styles */

/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.calculator {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 24px;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

#display {
    width: 100%;
    padding: 16px;
    font-size: 28px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 20px;
    border: none;
    border-radius: 8px;
    background-color: #f5f5f5;
    text-align: right;
    outline: none;
    transition: background-color 0.2s;
}

#display:focus {
    background-color: #e8e8e8;
}

#display::placeholder {
    color: #999;
}

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

.button {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 500;
    padding: 18px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.button:active {
    transform: translateY(0);
    box-shadow: none;
}

.button:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.operator {
    background-color: #FF5722;
}

.operator:hover {
    background-color: #e64a19;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.calculate {
    background-color: #2196F3;
}

.calculate:hover {
    background-color: #1976D2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.clear {
    background-color: #f44336;
}

.clear:hover {
    background-color: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .calculator {
        padding: 16px;
    }

    .button {
        padding: 14px 0;
        font-size: 18px;
    }

    #display {
        font-size: 24px;
        padding: 12px;
    }

    .buttons {
        gap: 8px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .button {
        transition: none;
    }

    .button:hover {
        transform: none;
    }
}

