body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #606060, #272727);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.calculator {
    background: #222;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    width: 340px;
    position: relative; /* so modal can position relative to this */
}

h1 {
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.calc-display {
    background: #000;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

input[type="number"] {
    width: 95%;
    background: #111;
    border: none;
    color: #0f0;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-align: right;
}

#result {
    display: none; /* hide until operation is performed */
    background: #111;
    color: #0f0;
    font-weight: bold;
    padding: 8px;
    border-radius: 8px;
    text-align: right;
    min-height: 30px;
}

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

button {
    background: #333;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

button:hover {
    background: #555;
}

button:active {
    background: #777;
}

/* =========================
   Modal Background
========================= */
.modal {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.25);
    backdrop-filter: blur(4px); /* soft blur effect */
    animation: fadeIn 0.3s ease-in-out;
}

/* =========================
   Modal Content - Neumorphic Style
========================= */
.modal-content {
    background: #4b4b4b;
    margin: 15% auto;
    padding: 20px 25px;
    border-radius: 20px;
    width: 320px;
    max-width: 85%;
    text-align: center;
    color: #000000;
    font-size: 1rem;
    font-weight: 500;
    animation: scaleUp 0.25s ease-in-out;
    position: relative;
}

/* =========================
   Close Button
========================= */
.close {
    position: absolute;
    top: 10px;
    right: 12px;
    color: #999;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}
.close:hover {
    color: #666;
    transform: scale(1.2);
}

/* =========================
   Message Styling
========================= */
#modalMessage {
    margin-top: 10px;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* =========================
   Animations
========================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}   
