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

body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Responsividade para Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 14px;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        width: 100%;
        margin-bottom: 5px;
    }

    .input-group input {
        width: 100%;
    }

    .button-group {
        gap: 5px;
    }

    button {
        padding: 12px 10px;
        font-size: 13px;
        flex: 1 1 45%;
        min-width: 45%;
    }

    .formula-display {
        min-height: 100px;
        font-size: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
        min-width: 100%;
    }

    .result, .result-text {
        font-size: 14px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

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

    .formula-display {
        font-size: 14px;
    }
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.section {
    margin-bottom: 25px;
}

.section-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.input-group label {
    width: 50px;
    font-weight: bold;
}

.input-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f8f8;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #e8e8e8;
}

button:active {
    background-color: #d8d8d8;
}

.formula-display {
    width: 100%;
    min-height: 80px;
    padding: 15px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-calculate {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    flex: 1;
}

.btn-calculate:hover {
    background-color: #45a049;
}

.btn-clear {
    background-color: #f44336;
    color: white;
    font-weight: bold;
}

.btn-clear:hover {
    background-color: #da190b;
}

.btn-backspace {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
}

.btn-backspace:hover {
    background-color: #e68900;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    display: none;
}

.result.valid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.invalid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-text {
    margin-top: 15px;
    padding: 15px;
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
    font-size: 16px;
    line-height: 1.6;
    display: none;
}

.btn-parens {
    background-color: #2196F3;
    color: white;
}

.btn-parens:hover {
    background-color: #0b7dda;
}
