/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body full-screen */
body {
    background: #0f1115;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Full-screen Calculator Container */
.calculator {
    width: 60%;
    height: 75vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Top bar: title left, toggle right */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Calculator Title */
.calc-title {
    color: #00e676;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: bold;
}

/* Mode toggle buttons */
.mode-toggle {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    flex: 1;
    background: #2a313c;
    border: none;
    color: #aaa;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: clamp(12px, 2vw, 16px);
    transition: 0.2s;
}

.toggle-btn.active {
    background: #00c853;
    color: black;
}

/* Display */
.display {
    background: #11151c;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    color: #fff;
    text-align: right;
    font-size: clamp(24px, 4vw, 40px);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow-x: auto;
}

/* Buttons Grid (fills remaining space) */
.buttons {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* Buttons */
button {
    width: 100%;
    height: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: #2a313c;
    color: #fff;
    font-size: clamp(14px, 2vw, 20px);
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #3a4350;
}

button:active {
    transform: scale(0.95);
    background: #4a5563;
}

/* Operators */
.operator {
    background: #00c853;
    color: black;
}

/* Equal button */
.equal {
    background: #00e676;
    font-weight: bold;
}

/* Special buttons */
.special {
    background: #39424e;
}

.hidden {
    display: none;
}

button.special.delete {
    background: #e53935; 
    color: #fff; 
    border-radius: 10px;
    font-size: clamp(12px, 3.5vw, 16px);
    transition: 0.2s;
}

button.special.delete:hover { background: #d32f2f; }
button.special.delete:active { transform: scale(0.95); background: #c62828; }

/* Mobile tweaks */
@media (max-width: 600px) {
    .calculator {
        padding: 10px;
    }

    .buttons {
        gap: 8px;
    }

    .display {
        font-size: 22px;
        min-height: 60px;
        padding: 15px;
    }

    button {
        font-size: 14px;
        border-radius: 10px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    button {
        font-size: 22px;
    }
}