@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

/* 🌌 Cyberpunk Background */
body {
    font-family: 'Orbitron', sans-serif;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.9), black);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: white;
}

/* ✨ Animated Glowing Grid */
.background-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0, 255, 255, 0.1) 0px, transparent 30px),
                repeating-linear-gradient(90deg, rgba(255, 0, 255, 0.1) 0px, transparent 30px);
    animation: grid-flicker 6s infinite alternate;
    z-index: -1;
}

@keyframes grid-flicker {
    0% { opacity: 0.2; }
    100% { opacity: 0.4; }
}

/* 🖥️ Calculator Panel */
.calculator {
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid cyan;
    border-radius: 15px;
    padding: 20px;
    width: 360px;
    box-shadow: 0px 0px 30px cyan;
    text-align: center;
    animation: floatingEffect 3s infinite alternate;
}

/* ✨ Floating Calculator Animation */
@keyframes floatingEffect {
    0% { transform: translateY(-5px); }
    100% { transform: translateY(5px); }
}

/* 📟 Display Screen */
.screen {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid cyan;
    border-radius: 10px;
    padding: 20px;
    font-size: 2rem;
    text-align: right;
    color: cyan;
    box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.5);
    overflow-x: auto;
    transition: 0.3s ease-in-out;
}

/* 🛸 Glitch Effect for Display */
@keyframes glitch {
    0% { text-shadow: 2px 2px 5px rgba(0, 255, 255, 0.8); }
    50% { text-shadow: -2px -2px 5px rgba(255, 0, 255, 0.8); }
    100% { text-shadow: 2px 2px 5px rgba(0, 255, 255, 0.8); }
}

.screen:hover {
    animation: glitch 1s infinite alternate;
}

/* 🔲 Button Grid */
.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
}

/* 🔘 Button Styling */
.key {
    border: none;
    padding: 18px;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    text-shadow: 0px 0px 10px rgba(255, 255, 255, 0.9);
    box-shadow: 0px 0px 15px rgba(0, 255, 255, 0.4);
}

/* ✨ Number Buttons */
.key.num {
    background: rgba(0, 255, 255, 0.2);
    color: cyan;
    box-shadow: 0px 0px 15px cyan;
}

/* 🔥 Operator Buttons */
.key.operator {
    background: rgba(255, 0, 255, 0.2);
    color: magenta;
    box-shadow: 0px 0px 15px magenta;
}

/* 🚀 Function Buttons */
.key.func {
    background: rgba(255, 255, 0, 0.2);
    color: yellow;
    box-shadow: 0px 0px 15px yellow;
}

/* 🟥 Equals Button */
.key.equal {
    background: rgba(255, 0, 0, 0.6);
    color: white;
    box-shadow: 0px 0px 20px red;
    font-size: 2rem;
}

/* ✨ Button Hover Effects */
.key:hover {
    transform: scale(1.1);
    filter: brightness(1.4);
}

/* 🛑 Button Press Effect */
.key:active {
    transform: scale(0.9);
    box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.5);
}

/* 💫 Cursor Glow Trail */
body {
    cursor: none;
}

body::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: cyan;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.1s linear;
    filter: blur(5px);
}

body:hover::before {
    animation: cursorGlow 0.5s infinite alternate;
}

@keyframes cursorGlow {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0.7; }
}