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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #1a1a1a, #4a4a4a);
    padding: 20px;
}

.calculator {
    background-color: #22252D;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.mode-toggle {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.mode-toggle button {
    flex: 1;
    padding: 8px;
    margin: 0 5px;
    border: none;
    border-radius: 5px;
    background: #2A2D37;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mode-toggle button.active {
    background: #2193b0;
}

.display {
    background-color: #2A2D37;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 100px;
}

.previous-operand {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    margin-bottom: 5px;
    min-height: 24px;
    word-wrap: break-word;
    word-break: break-all;
}

.current-operand {
    color: white;
    font-size: 2rem;
    word-wrap: break-word;
    word-break: break-all;
}

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

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

.scientific .scientific-buttons {
    display: grid;
}

button {
    border: none;
    padding: 15px 10px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 10px;
    background-color: #2A2D37;
    color: white;
    transition: all 0.2s;
}

button:hover {
    background-color: #333842;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.operator {
    background-color: #2193b0;
}

.operator:hover {
    background-color: #1a7a94;
}

.equals {
    background-color: #6dd5ed;
    color: #22252D;
    grid-column: span 2;
}

.equals:hover {
    background-color: #5bc1d9;
}

.clear, .delete {
    background-color: #FF5757;
}

.clear:hover, .delete:hover {
    background-color: #ff4242;
}

.function {
    background-color: #4a4a4a;
}

.function:hover {
    background-color: #5a5a5a;
}

footer{
    margin-bottom: 10px;
    text-align: right;
    color: white;
    position: fixed;
    bottom: 0;
    right: 10px;
}
footer > p > a {
    color: white;
    text-align: justify;
    margin-top: 20px;
    font-size: 1rem;
    text-decoration: none;
}

@media (max-width: 480px) {
    .calculator {
        padding: 15px;
        margin-bottom: 10px;
    }

    button {
        padding: 12px 8px;
        font-size: 1rem;
    }

    .display {
        padding: 15px;
    }

    .current-operand {
        font-size: 1.6rem;
    }
    
    footer {
    margin-bottom: 10px;
    text-align: center;
    color: white;
    position: fixed;
    display: none;
    }
}
