/* ============================= */
/* Global styles and layout       */
/* ============================= */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px; /* reduced padding for mobile-first */
    box-sizing: border-box;
}

/* Page title */
h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================= */
/* Form styling                  */
/* ============================= */
form {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 90%;           /* responsive width for mobile */
    max-width: 400px;     /* max width for larger screens */
    box-sizing: border-box;
}

/* Form labels */
label {
    font-weight: bold;
}

/* Form inputs */
input {
    width: 100%;
    padding: 8px;
    margin: 5px 0 10px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Placeholder text for optional fields */
input::placeholder {
    color: #999;
    font-size: 0.9em;
}


/* ============================= */
/* Buttons                        */
/* ============================= */
button {
    background-color: #007bff;
    color: white;
    padding: 10px;
    width: 100%;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
    box-sizing: border-box;
}

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

/* Clear button specific styling */
#clearBtn {
    background-color: #6c757d;
}

#clearBtn:hover {
    background-color: #5a6268;
}

/* ============================= */
/* Prediction boxes               */
/* ============================= */
.result-box {
    padding: 15px;
    border: 1px solid #ccc;
    margin-top: 15px;
    border-radius: 8px;
    width: 90%;          /* responsive width */
    max-width: 400px;    /* aligns with form max-width */
    text-align: center;
    font-size: 1.1em;
    box-sizing: border-box;
}

/* Box background colors */
#valueBox.result-box {
    background-color: #e8f0fe;  /* light blue for estimated value */
}

#reasonBox.result-box {
    background-color: #fef8e8;  /* light yellow for reasoning */
}

/* ============================= */
/* Loading spinner                */
/* ============================= */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================= */
/* Responsive adjustments         */
/* ============================= */
@media (min-width: 600px) {
    body {
        padding: 30px;
    }
}

@media (min-width: 900px) {
    body {
        padding: 40px;
        font-size: 1.1rem;
    }

    /* Optionally make form and boxes side-by-side on wide screens */
    form, #valueBox, #reasonBox {
        width: 400px;
    }
}
