/* General Styling specific to the calculator */
.uktc-container { /* Prefixed main container */
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    margin-left: auto; /* Center container if theme doesn't */
    margin-right: auto; /* Center container if theme doesn't */
    font-family: Arial, Helvetica, sans-serif; /* Use system fonts */
    font-size: 1rem; /* Set base font size for consistency */
    line-height: 1.5; /* Set a base line-height */
    color: #333;
}

/* Input Section */
.uktc-container .input-section {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px; /* Space between items */
    margin-bottom: 10px; /* Reduced margin to accommodate explanation text */
    align-items: flex-end; /* Align items to the bottom */
}

.uktc-container .input-group {
    flex: 1; /* Allow groups to grow */
    min-width: 200px; /* Minimum width before wrapping */
}

.uktc-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: inherit; /* Inherit base font size */
}

.uktc-container input[type="number"],
.uktc-container select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Include padding and border in width */
    font-family: inherit; /* Inherit body font */
    font-size: 1rem; /* Explicitly set to base size */
    transition: border-color 0.3s ease;
}

.uktc-container input[type="number"]:focus,
.uktc-container select:focus {
    border-color: #3498db;
    outline: none;
}

/* Remove arrows from number input */
.uktc-container input[type=number]::-webkit-inner-spin-button,
.uktc-container input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.uktc-container input[type=number] {
    -moz-appearance: textfield; /* Firefox */
}

/* Input Explanation Text Style */
.uktc-container .input-explanation {
    font-size: 1rem; /* Changed to base size */
    color: #555;
    margin-top: 5px; /* Space above this text */
    margin-bottom: 15px; /* Space below this text, before error message */
    width: 100%; /* Ensure it takes full width */
    text-align: left;
    line-height: 1.6; /* Added line-height for consistency */
}


/* Error Message */
.uktc-container #error-message {
    color: #e74c3c;
    font-weight: bold;
    min-height: 1.2em; /* Reserve space to prevent layout shifts */
    margin-bottom: 20px; /* Added margin below error message */
    font-size: 1rem; /* Consistent size */
}

/* Results Table */
.uktc-container .results-section {
    margin-bottom: 30px;
}

.uktc-container h2 {
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0; /* Reset margin */
    margin-bottom: 20px;
    font-size: 1.5rem; /* Larger than base */
     line-height: 1.2; /* Adjust line-height for headings */
}

.uktc-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 1rem; /* Set base size for table */
}

.uktc-container th,
.uktc-container td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    line-height: 1.5; /* Consistent line height for table cells */
}

.uktc-container th {
    background-color: #ecf0f1;
    color: #34495e;
    font-weight: bold;
}

.uktc-container td:nth-child(n+2) { /* Align numeric columns to the right */
     text-align: right;
}

.uktc-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Explanation Section */
.uktc-container .explanation-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #eee;
    line-height: 1.6; /* Base line height for this section */
    margin-top: 30px; /* Add space above explanation */
}

.uktc-container .explanation-section h3 {
    margin-top: 0;
    color: #34495e;
    font-size: 1.2rem; /* Larger than base */
     line-height: 1.2; /* Adjust line-height for headings */
     margin-bottom: 15px;
}

/* Styles for the HTML explanation container */
.uktc-container #explanation-html {
    font-family: Arial, Helvetica, sans-serif; /* Match body/input font */
    font-size: 1rem; /* Explicitly set to base size */
    line-height: 1.6; /* Match section line height */
}
/* Add some spacing for paragraphs and lists within the explanation */
.uktc-container #explanation-html p {
    margin-bottom: 0.8em;
}
.uktc-container #explanation-html p:last-child {
    margin-bottom: 0;
}
.uktc-container #explanation-html ul {
    list-style-position: outside;
    padding-left: 20px; /* Indent lists */
    margin-top: 0.5em;
    margin-bottom: 0.8em;
}
.uktc-container #explanation-html ul ul { /* Nested lists */
     margin-top: 0.3em;
     margin-bottom: 0.5em;
     padding-left: 20px; /* Further indent nested lists */
 }
.uktc-container #explanation-html li {
    margin-bottom: 0.3em;
}
.uktc-container #explanation-html strong {
    font-weight: bold;
}


/* Responsive Design */
@media (max-width: 600px) {
    /* Adjust base font size slightly for smaller screens if needed within the container */
     .uktc-container {
         /* font-size: 0.9rem; */ /* Let theme handle base size */
     }

    .uktc-container .input-section {
        flex-direction: column; /* Stack inputs vertically */
        align-items: stretch; /* Stretch items to full width */
    }

    .uktc-container .input-group {
        min-width: 100%; /* Full width on small screens */
    }

    .uktc-container th,
    .uktc-container td {
        padding: 8px; /* Reduce padding on smaller screens */
    }

    .uktc-container h2 {
        font-size: 1.3rem; /* Adjust heading size relative to new base */
    }
     .uktc-container h3 {
        font-size: 1.1rem; /* Adjust heading size relative to new base */
    }

}

