/* General body and layout styles */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    margin: 0;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    width: 100%;
    gap: 2rem;
}

/* Header styling */
.site-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #f4f4f4;
    border-bottom: 2px solid #ccc;
    font-family: "Oswald", sans-serif;
    width: 100%;
    box-sizing: border-box;
}

/* Branding aligned to far left */
.branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 0.5rem;
}

.logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.calculator-header {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: "Oswald", sans-serif;
}

.calculator-header h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

.calculator-header b {
    color: #666;
}

/* Styling for the calculator container */
.calculator {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
    border: 5px solid #ffc940;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    margin: 0 auto;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    width: 100%;
}

.calculator-column,
.breakdown-column,
.map-subcolumn {
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow-y: auto;
    box-sizing: border-box;
}

.map-box {
    height: 200px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 6px;
    border: 1px dashed #999;
    margin-bottom: 0.5rem;
}

/* Form styling */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-family: "source sans pro", sans-serif;
    font-weight: 900;
}

label:has(input[type="radio"]) {
  font-size: 14px;
}

form input[type="text"],
form input[type="number"],
form select,
form button {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.load-details {
    min-height: 40px;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #f5f5f5;
    color: #888;
    font-weight: bold;
    cursor: not-allowed;
}

.breakdownLog {
    min-height: 640px !important;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 12px;
    background-color: #f5f5f5;
    color: #888;
    font-weight: 500;
    cursor: not-allowed;
    white-space: pre-wrap; 
    word-break: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    max-width: 100%; 
}

form button {
    background-color: #ffc940;
    color: black;
    border: none;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

form button:hover {
    background-color: #e6b53a;
    transform: scale(1.03);
}

#totalCost {
    font-weight: bold;
}

.help-text {
    color: red !important;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Disabled input styling */
input[readonly] {
    background-color: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

/* Focus styling for accessibility */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #ffc940;
    outline-offset: 2px;
}

/* Footer styling */
.site-footer {
    background-color: #f4f4f4;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.footer-bottom {
    background-color: #ddd;
    color: #444;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    border-top: 1px solid #ccc;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 20px;
        width: 95vw;
    }
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    .breakdownLog {
        min-height: 40px;
    }
    .site-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: static;
        text-align: center;
        gap: 1rem;
    }

    .calculator-header {
        position: static;
        transform: none;
        width: 100%;
    }

    .branding {
        align-items: center;
        justify-content: center;
    }

    .logo {
        max-height: 70px;
    }

    .form-group {
        margin-bottom: 1rem;
    }
    form input[type="text"],
    form input[type="number"],
    form select,
    form button {
        font-size: 14px;
        padding: 10px;
    }
    form button {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px;
        width: 90vw;
    }
    .calculator {
        width: 100%;
        box-shadow: none;
    }

    form button {
        font-size: 14px;
    }
}