/* style.css */
body {
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.0;
    background-color: #4280B4;
    padding: 10px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background: #fff;
    /* Reduced padding from 30px to 25px */
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 750px;
    width: 100%;
    box-sizing: border-box;
}

header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Reduced padding-bottom from 20px to 15px */
    padding-bottom: 15px;
    /* Reduced margin-bottom from 20px to 15px */
    margin-bottom: 15px;
}

/* New class for the div containing the logo for better semantic meaning */
.header-logo-area {
    border-bottom: 2px solid #667;
    width: 100%;
    padding-bottom: 0;
    /* Reduced margin-bottom from 15px to 10px */
    margin-bottom: 10px;
}

.header-left, .header-right {
    flex: 1;
    min-width: 280px;
}

.header-right {
    margin: auto;
    padding-top: 35px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    text-transform: uppercase;
}

header h2 {
    margin: 0;
    font-size: 1em;
    font-weight: normal;
    color: #555;
}

header p {
    margin: 0;
    font-size: 0.9em;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* Reduced margin-top from 20px to 15px */
    margin-top: 15px;
}

th, td {
    /* Reduced padding from 5px to 4px */
    padding: 4px;
    border: 1px solid #ccc;
    text-align: left;
}

th {
    background-color: #f0f7ff;
    font-weight: bold;
    text-align: center;
}

.category td {
    background-color: #e9e9e9;
    font-weight: bold;
    text-align: center;
    /* Reduced vertical padding from 12px 10px to 10px 10px */
    padding: 10px 10px;
}

.subcategory td {
    text-align: left;
    /* Reduced vertical padding from 10px 5px to 8px 5px */
    padding: 8px 5px;
}

input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: right;
    border: 1px solid #ccc;
    border-radius: 4px;
    -moz-appearance: textfield;
}

/* Hide arrows for Chrome, Safari, Edge */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Style for the custom description field */
.description-input {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px;
    font-family: inherit;
    font-size: 1.0em;
    box-sizing: border-box;
    background-color: #f9f9f9;
}

.description-input:focus {
    outline: none;
    border-color: #4280B4;
    background-color: #fff;
}

/* Ensure the table cell doesn't squash the input */
td:first-child {
    min-width: 200px;
}

/* Styling for the new fillable Misc Rate input */
td.rate-input {
    text-align: right;
}

td.rate-input input[type="number"] {
    width: 80px;
    padding-left: 5px;
}

.rate, .subtotal, .total-row td {
    text-align: right;
/* font-weight: bold; */
}

.total-row td:first-child {
    text-align: left;
    font-weight: bold;
    font-size: 1.1em;
}

/* Specific styling for the distinct Annual Average row */
.annual-avg-row td {
    background-color: #f0f7ff;
    border-top: 3px solid #323232;
    padding: 15px 10px;
}

.annual-avg-row td:first-child {
    text-align: left;
    font-size: 1.1em;
    color: #333;
}

/* Inline year input styling */
.year-input {
    font-size: 1em;
/*    border: 1px solid #4280B4; */
    border-radius: 3px;
    text-align: center;
    margin: 0 2px;
    padding: 0;
    background: #f0f7ff; /* #fff; */
}

#annual-average {
    font-weight: bold;
    font-size: 1.3em;
    color: #CA6800;
}

/* Tooltip Container */
.tooltip-container {
    position: relative;
    cursor: help;
}

/* Styled Hover Window (Tooltip) */
.tooltip-text {
    visibility: hidden;
    width: 160px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 10;
    bottom: 125%; /* Position above the total */
    right: 0;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
    font-weight: normal;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Show tooltip on hover */
.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.form-actions {
    text-align: right;
    /* Reduced margin-top from 20px to 15px */
    margin-top: 15px;
}

.form-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}

#print-button {
    background-color: #4280B4;
    color: #fff;
}

#print-button:hover {
    background-color: #0056b3;
}

#reset-button {
    background-color: #6c757d;
    color: #fff;
}

#reset-button:hover {
    background-color: #5a6268;
}


/* Responsive adjustments */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-logo-area {
        margin-bottom: 10px;
        text-align: center;
    }
    .header-left, .header-right {
        padding-right: 0;
        margin-bottom: 10px;
    }
    th, td {
        /* Adjusted padding in media query to match general reduction */
        padding: 4px;
        font-size: 0.9em;
    }
    input[type="number"] {
        width: 50px;
    }
    td.rate-input input[type="number"] {
        width: 70px;
    }
    .form-actions button {
        width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
    }
}

/* Print Styles: Hide buttons when printing */
@media print {
    .form-actions {
        display: none;
    }
}