body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

.calculator-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

h1 {
    text-align: center;
}

.tab {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-bottom: 20px;
}

.tab button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;  /* Reduce font size slightly for better fit */
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
    flex: 1 1 45%;  /* Adjust button size and allow wrapping */
    margin: 5px;    /* Add margin to buttons */
}

.tab button:hover {
    background-color: #0056b3;
}

.tab button.active {
    background-color: #0056b3;
}

.tabcontent {
    display: none;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
}

input {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

#result {
    margin-top: 20px;
    text-align: center;
}

#magneticFieldResult, #ohmsLawResult, #powerDissipationResult, #inductanceResult, 
#hallEffectResult, #linearPositionResult, #rotationalSpeedResult, #potentiometerResult, 
#tiltSensorResult {
    font-size: 24px;
    font-weight: bold;
}
