body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #e8eaf6; /* Light purple-blue background */
}

.calculator-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 660px;
    text-align: center;
}

h1 {
    color: #3f51b5; /* Indigo color */
    font-size: 1.8em;
    margin-bottom: 5px;
}

p:first-of-type {
    color: #555;
    margin-bottom: 25px;
    font-size: 0.95em;
}

/* --- Input Grid --- */
.input-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.band-group {
    text-align: left;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 0.85em;
}

select {
    width: 90%;
    padding: 8px;
    border: 1px solid #c5cae9;
    border-radius: 5px;
    font-size: 14px;
    appearance: none; /* Remove default dropdown arrow */
    background-color: #fff;
}

/* --- Resistor Visual Model --- */
.resistor-model {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
}



.band-display, .band-display-tolerance {
    width: 30px;
    height: 80px;
    z-index: 2;
    margin: 0 1px;
    background-color: #ccc; /* Default gray */
}

.band-display-tolerance {
    margin-left: 15px; /* Separation for tolerance band */
}

/* --- Result Display --- */
.result-display {
    margin-top: 25px;
    padding: 15px;
    background-color: #e8eaf6;
    border: 1px solid #c5cae9;
    border-radius: 8px;
    text-align: left;
}

.result-display h2 {
    margin: 0 0 10px 0;
    color: #3f51b5;
    font-size: 1.3em;
}

.result-display p {
    margin: 8px 0;
    font-size: 1.1em;
    color: #333;
}

.result-display span {
    font-weight: bold;
    color: #000;
}

#error-message {
    color: red;
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
}