* {
    box-sizing: border-box;
    font-family: 'Orbitron', monospace;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    margin: 0;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Calculator Container */
.calc-wrapper {
    background-color: #1e1e1e;
    border: 4px solid #30c3fc;
    border-radius: 18px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    margin: 0 12px;
    box-shadow: 0 0 20px #30c3fc;
}

/* Display Screen */
.display-screen {
    background-color: rgba(83, 82, 82, 0.243);
    backdrop-filter: blur(10px);
    color: #30c3fc;
    font-size: 1rem;
    min-height: 100px;
    height: auto;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px inset rgba(49, 194, 252, 0.464);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
    justify-content: space-between;
}

.ans-memory {
    font-size: 0.85rem;
    color: #fff;
    opacity: 0.6;
}

#display-expression {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    font-size: 2rem;
    font-weight: 500;
    color: #fff;
    padding: 4px 6px;
    margin: 4px 0;
    height: 2.4rem;
    line-height: 1;
    letter-spacing: 0.1em;
    word-spacing: 0.1em;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    max-width: 100%;
    width: 100%;
}

.live-result {
    font-size: 1rem;
    color: #95e2fc;
    opacity: 0.8;
    margin-top: 4px;
    min-height: 1.2em;
    letter-spacing: 2px;
}

/* Keypad Layout */
.calc-keys {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.keypad-left {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 12px;
    flex: 1;
}

.operator-keys {
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
}

button {
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.3s ease;
}

.keypad-left button {
    background-color: #333;
    color:#30c3fc;
}

.keypad-left button:hover {
    background-color: #666;
}

.operator-keys button, button.clear, button.delete, button.left-arrow, button.right-arrow {
    background-color: #30c3fc;
    color: #fff;
}

.operator-keys button:hover, button.clear:hover, button.delete:hover, button.left-arrow:hover, button.right-arrow:hover {
    background-color: #95e2fc;
}

button:active {
    transform: translateY(2px);
}

button.active {
    transform: scale(0.95);
    background-color: #cc89ef !important;
}

button.equal {
  background-color: #514fe8;
  color: #ffffff;
}

button.equal:hover {
  background-color: #9795fc;
}

/* Blinking Cursor */
#blinking-cursor::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #95e2fcca;
    animation: blink 1s steps(2, start) infinite;
    vertical-align: middle;
    margin-left: -2px;
}

.no-cursor #blinking-cursor::after {
    display: none;
}

@keyframes blink {
    to {
        visibility: hidden;
    }
}