* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.calculator-container {
    user-select: none;
}

.display {
    min-height: 120px;
    background-color: #f3f3f3;
}

#result {
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.2;
}

#expression {
    min-height: 24px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Memory Buttons - Disabled/Display Only */
.memory-btn {
    padding: 8px;
    background-color: #f9f9f9;
    border: none;
    font-size: 11px;
    color: #999;
    cursor: not-allowed;
    transition: background-color 0.1s ease;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    opacity: 0.6;
}

.memory-btn:last-child {
    border-right: none;
}

/* Calculator Buttons */
.calc-btn {
    padding: 20px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
    color: #1a1a1a;
}

.calc-btn:hover {
    background-color: #e5e5e5;
}

.calc-btn:active {
    background-color: #d0d0d0;
    transform: scale(0.98);
}

/* Number buttons */
.number-btn {
    background-color: #fafafa;
    font-size: 18px;
    font-weight: 400;
}

.number-btn:hover {
    background-color: #e5e5e5;
}

/* Operator buttons */
.operator-btn {
    background-color: #f5f5f5;
    font-size: 16px;
}

.operator-btn:hover {
    background-color: #e0e0e0;
}

/* Equals button */
.equals-btn {
    background-color: #0078d4;
    color: white;
    font-size: 20px;
    font-weight: 500;
}

.equals-btn:hover {
    background-color: #106ebe;
}

.equals-btn:active {
    background-color: #005a9e;
}

/* Remove border from last column */
.calculator-buttons button:nth-child(4n) {
    border-right: none;
}

/* Remove border from last row */
.calculator-buttons button:nth-last-child(-n+4) {
    border-bottom: none;
}

/* Scrollbar styling */
#result::-webkit-scrollbar,
#expression::-webkit-scrollbar {
    height: 4px;
}

#result::-webkit-scrollbar-thumb,
#expression::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

#result::-webkit-scrollbar-thumb:hover,
#expression::-webkit-scrollbar-thumb:hover {
    background: #555;
}


@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.button-pressed {
    animation: buttonPress 0.1s ease;
}


.memory-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    color: #666;
}
