/* Fluid Formulation AI - Google Cloud Console Style */
/* Halliburton Colors: Red (#E31837), White (#FFFFFF) */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #F8F9FA;
    color: #202124;
    line-height: 1.6;
    font-weight: 400;
    font-size: 14px;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 400;
    color: #202124;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 24px;
    font-weight: 400;
    color: #202124;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 20px;
    font-weight: 500;
    color: #202124;
    letter-spacing: 0;
}

/* Main Container */
.container-fluid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.main-container {
    /* Removed card styling to match admin page */
}

/* Header */
.header {
    background: linear-gradient(135deg, #E31837 0%, #B71C30 100%);
    color: white;
    padding: 32px 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header h1 {
    color: white;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Messages */
.messages-container {
    padding: 0 48px;
    margin-top: 20px;
}

.alert {
    border: 1px solid;
    border-radius: 4px;
    padding: 12px 16px;
    font-weight: 400;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success {
    background: #E6F4EA;
    color: #137333;
    border-color: #CEEAD6;
}

.alert-warning {
    background: #FEF7E0;
    color: #7D6116;
    border-color: #FDE293;
}

.alert-danger {
    background: #FCE8E6;
    color: #B3261E;
    border-color: #F9DEDC;
}

/* Form Sections */
.form-section {
    padding: 32px 48px;
    border-bottom: 1px solid #DADCE0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 500;
    color: #202124;
}

.form-section h3 i {
    margin-right: 12px;
    color: #E31837;
    font-size: 20px;
}

/* Form Controls */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 8px;
    letter-spacing: 0.1px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: #202124;
    background: #FFFFFF;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-family: 'Roboto', sans-serif;
}

.form-control:hover {
    border-color: #BDBEC0;
}

.form-control:focus {
    outline: none;
    border-color: #E31837;
    box-shadow: 0 0 0 1px #E31837;
}

.form-control::placeholder {
    color: #80868B;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 36px;
    letter-spacing: 0.25px;
}

.btn i {
    margin-right: 8px;
    font-size: 16px;
}

.btn-primary {
    background: #E31837;
    color: white;
    border-color: #E31837;
}

.btn-primary:hover {
    background: #C41530;
    border-color: #C41530;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-secondary {
    background: #5F6368;
    color: white;
    border-color: #5F6368;
}

.btn-secondary:hover {
    background: #4D5156;
    border-color: #4D5156;
}

.btn-outline-secondary {
    background: transparent;
    color: #5F6368;
    border: 1px solid #DADCE0;
}

.btn-outline-secondary:hover {
    background: #F8F9FA;
    border-color: #DADCE0;
}

.btn-success {
    background: #1E8E3E;
    color: white;
    border-color: #1E8E3E;
}

.btn-success:hover {
    background: #188038;
    border-color: #188038;
}

.btn-info {
    background: #1967D2;
    color: white;
    border-color: #1967D2;
}

.btn-info:hover {
    background: #1558B0;
    border-color: #1558B0;
}

.btn-warning {
    background: #F9AB00;
    color: #202124;
    border-color: #F9AB00;
}

.btn-warning:hover {
    background: #EA8600;
    border-color: #EA8600;
}

.btn-danger {
    background: #D93025;
    color: white;
    border-color: #D93025;
}

.btn-danger:hover {
    background: #C5221F;
    border-color: #C5221F;
}

/* Fluid Example Buttons */
.btn-outline-info {
    background: transparent;
    color: #1967D2;
    border: 1px solid #DADCE0;
}

.btn-outline-info:hover {
    background: #F8F9FA;
    border-color: #1967D2;
}

.btn-outline-warning {
    background: transparent;
    color: #F9AB00;
    border: 1px solid #DADCE0;
}

.btn-outline-warning:hover {
    background: #F8F9FA;
    border-color: #F9AB00;
}

.btn-outline-success {
    background: transparent;
    color: #1E8E3E;
    border: 1px solid #DADCE0;
}

.btn-outline-success:hover {
    background: #F8F9FA;
    border-color: #1E8E3E;
}

.btn-outline-danger {
    background: transparent;
    color: #D93025;
    border: 1px solid #DADCE0;
}

.btn-outline-danger:hover {
    background: #F8F9FA;
    border-color: #D93025;
}

/* Summary Cards */
.summary-card {
    background: #FFFFFF;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    transition: box-shadow 0.15s ease;
}

.summary-card:hover {
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.summary-card h5 {
    font-size: 11px;
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.summary-card h5 i {
    margin-right: 6px;
    color: #E31837;
}

.summary-value {
    font-size: 24px;
    font-weight: 400;
    color: #202124;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smaller font for processing time display */
#predictionTime {
    font-size: 28px;
}

/* Table */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #DADCE0;
    background: #FFFFFF;
    max-height: 700px;
    overflow-y: auto;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.table {
    margin-bottom: 0;
    font-size: 13px;
    white-space: nowrap;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}

.table thead,
.table tbody {
    border: none;
    margin: 0;
    padding: 0;
}

.table th {
    background: linear-gradient(135deg, #E31837 0%, #B71C30 100%);
    color: white;
    font-weight: 500;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 16px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 90px;
}

.table th:first-child {
    min-width: 80px;
    max-width: 120px;
    width: 80px;
    text-align: left;
    padding-left: 20px;
    position: sticky;
    left: 0;
    z-index: 15;
}

.table th.stats-column {
    background: linear-gradient(135deg, #C41530 0%, #A01228 100%);
    min-width: 100px;
}

.table td {
    padding: 12px;
    border: none;
    vertical-align: middle;
    border-bottom: 1px solid #DADCE0;
    text-align: center;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    color: #5F6368;
}

.table td:first-child {
    font-weight: 500;
    text-align: left;
    padding-left: 20px;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: #F8F9FA;
    position: sticky;
    left: 0;
    z-index: 6;
    min-width: 80px;
    max-width: 120px;
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #202124;
}

.table td.stats-value {
    font-weight: 600;
    background: #E8F0FE;
    color: #1967D2;
}

/* Force narrow Parameter column */
.table th:first-child,
.table td:first-child {
    width: 22% !important;
    min-width: 120px !important;
    max-width: 180px !important;
}

.table th:not(:first-child),
.table td:not(:first-child) {
    width: auto !important;
}

/* Ultra specific override for Parameter column */
table.table thead tr th:nth-child(1),
table.table tbody tr td:nth-child(1) {
    width: 22% !important;
    min-width: 120px !important;
    max-width: 180px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
}

.table tbody tr:hover {
    background: #F8F9FA;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Chart Container */
.chart-container {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #DADCE0;
    height: 400px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

/* Loading Spinner */
#loadingSpinner {
    padding: 48px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 3px;
    border-color: #E31837;
    border-right-color: transparent;
}

#loadingSpinner p {
    margin-top: 20px;
    font-size: 14px;
    color: #5F6368;
}

/* Footer */
.footer {
    background: #202124;
    color: #9AA0A6;
    text-align: center;
    padding: 32px;
    margin-top: 24px;
}

.footer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.footer a {
    color: #8AB4F8;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Custom Toggle Switches */
.form-check-input:checked {
    background-color: #E31837;
    border-color: #E31837;
}

.form-check-input:focus {
    border-color: #E31837;
    box-shadow: 0 0 0 0.2rem rgba(227, 24, 55, 0.25);
}

.form-range::-webkit-slider-thumb {
    background: #E31837;
}

.form-range::-moz-range-thumb {
    background: #E31837;
}

.form-range::-webkit-slider-thumb:hover {
    background: #b81329;
}

.form-range::-moz-range-thumb:hover {
    background: #b81329;
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 0.2rem rgba(227, 24, 55, 0.25);
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 0.2rem rgba(227, 24, 55, 0.25);
}

.badge.bg-secondary {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background: #E8EAED;
    color: #5F6368;
}

/* Input Group Styling */
.input-group {
    position: relative;
}

.input-group .form-control {
    border: 1px solid #DADCE0;
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

.input-group .form-control:focus {
    border-color: #E31837;
    box-shadow: 0 0 0 1px #E31837;
    outline: none;
}

.input-group-text {
    background-color: transparent;
    border: none;
    color: #80868B;
    font-weight: 400;
    font-size: 13px;
}

/* Form Group Spacing */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 8px;
    font-size: 13px;
}

/* Model Selector Enhancement */
#modelSelectorContainer .form-control {
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    transition: all 0.15s ease;
}

#modelSelectorContainer .form-control:hover {
    border-color: #BDBEC0;
}

#modelSelectorContainer .form-control:focus {
    border-color: #E31837;
    box-shadow: 0 0 0 1px #E31837;
}

/* Improved Summary Cards */
.summary-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border: 2px solid #E31837;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(227, 24, 55, 0.1);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(227, 24, 55, 0.2);
    border-color: #C01530;
}

.summary-card h5 {
    font-size: 12px;
    color: #5F6368;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-card .summary-value {
    font-size: 32px;
    font-weight: 700;
    color: #E31837;
    text-shadow: 0 2px 4px rgba(227, 24, 55, 0.1);
}

/* Table Improvements */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.table {
    margin-bottom: 0;
    table-layout: fixed;
}

.table thead {
    background: linear-gradient(135deg, #E31837 0%, #B71C30 100%);
    color: white;
}

.table thead th {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border: none;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #F8F9FA;
}

.table tbody td {
    padding: 12px 20px;
    vertical-align: middle;
    font-size: 13px;
}

.table tbody td:first-child {
    font-weight: 500;
    color: #202124;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table tbody td:last-child {
    text-align: right;
    font-weight: 500;
    color: #E31837;
    font-family: 'Roboto Mono', 'Courier New', monospace;
}

/* Component Flags Section */
.form-section h4 {
    color: #202124;
    font-weight: 500;
    margin-bottom: 16px;
    font-size: 16px;
}

/* Toggle Switch Enhancement */
.form-check-switch .form-check-input {
    transition: all 0.15s ease;
}

.form-check-switch .form-check-input:checked {
    box-shadow: 0 1px 2px rgba(227, 24, 55, 0.3);
}

.form-check-label {
    user-select: none;
    font-size: 14px;
    color: #5F6368;
}

/* Custom Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #F8F9FA;
    border: 1px solid #DADCE0;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.toggle-container:hover {
    background: #FFFFFF;
    border-color: #E31837;
    box-shadow: 0 1px 2px 0 rgba(227, 24, 55, 0.2);
}

.toggle-label {
    margin: 0;
    font-weight: 400;
    color: #202124;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #DADCE0;
    transition: 0.15s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.15s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #E31837;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(227, 24, 55, 0.2);
}

/* Number Input Enhancement */
input[type="number"].form-control {
    font-weight: 400;
    font-family: 'Roboto Mono', monospace;
}

input[type="number"].form-control::-webkit-inner-spin-button,
input[type="number"].form-control::-webkit-outer-spin-button {
    opacity: 1;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Section Headers */
.form-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.form-section h3 i {
    color: #E31837;
}
}

.footer a {
    color: #8AB4F8;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.w-100 { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mt-6 { margin-top: 40px; }
.mx-4 { margin-left: 24px; margin-right: 24px; }
.text-center { text-align: center; }

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 12px; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 12px; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 0 12px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 12px; }

.g-3 > * { padding: 6px; }
.g-4 > * { padding: 8px; }

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 12px;
    }
    
    .form-section, .header, .footer {
        padding: 24px;
    }
    
    .messages-container {
        padding: 0 24px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .col-md-4, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .summary-value {
        font-size: 24px;
    }
    
    #predictionTime {
        font-size: 20px;
    }
    
    .summary-card {
        height: 120px;
        min-height: 120px;
        padding: 20px;
    }
}