/* LOCA2 Climate Analysis - Main Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #20B2AA 100%);
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow: hidden;
}

/* Main Container */
.main-container {
    background: rgba(255, 255, 255, 0.95);
    margin: 0;
    width: 100%;
    height: 100vh;
    backdrop-filter: blur(10px);
}

/* Ensure row takes full height */
.main-container .row {
    height: 100vh;
    margin: 0;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #f0f8ff 0%, #e6f3ff 100%);
    padding: 25px;
    height: 100vh;
    position: relative;
    overflow-y: auto;
}

/* Ensure sidebar column takes full height */
aside.col-md-4.col-lg-3 {
    height: 100vh;
    padding: 0;
}

/* Ensure main content column takes full height */
main.col-md-8.col-lg-9 {
    height: 100vh;
    padding: 0;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #2a5298, transparent);
}

.sidebar h2 {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.sidebar h2 i {
    color: #2a5298;
    margin-right: 0.5rem;
}

/* Content Area */
.content-area {
    padding: 25px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure content area children are properly sized */
.content-area > * {
    width: 100%;
    max-width: 100%;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e6f3ff;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

fieldset legend {
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}

/* Metric Categories Styling */
.metric-category {
    border-left: 3px solid #e6f3ff;
    padding-left: 15px;
    margin-bottom: 20px;
}

.metric-category h6 {
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.metric-category .form-check {
    margin-bottom: 8px;
}

.metric-category .form-check-label {
    font-size: 0.85rem;
    color: #555;
}

/* Optgroup styling for select dropdowns */
optgroup {
    font-weight: 600;
    color: #1e3c72;
    background-color: #f8f9fa;
}

optgroup option {
    font-weight: normal;
    color: #333;
    padding-left: 20px;
}

.form-control:focus, .form-select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.form-label i {
    color: #2a5298;
    margin-right: 0.5rem;
}

/* Enhanced tooltip styles */
.tooltip {
    font-size: 0.875rem;
    max-width: 300px;
}

.tooltip-inner {
    background-color: #1e3c72;
    color: white;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #1e3c72;
}

.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before,
.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #1e3c72;
}

.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before,
.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #1e3c72;
}

.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before,
.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #1e3c72;
}

/* Enhanced form help text */
.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.form-text i {
    color: #2a5298;
    margin-right: 0.25rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #2a5298, #20B2AA);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.4);
    background: linear-gradient(45deg, #1e3c72, #1E90FF);
}

.btn-outline-secondary {
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Plot Containers */
.plot-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: none;
    border: none;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner-border {
    color: #2a5298;
    width: 3rem;
    height: 3rem;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e6f3ff;
    width: 100%;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.metric-card h5 {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 1rem;
}

.metric-card h5 i {
    color: #2a5298;
    margin-right: 0.5rem;
}

/* Metric description styling */
.metric-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 3px solid #2a5298;
    margin-bottom: 1rem;
}

.metric-description small {
    color: #495057;
    line-height: 1.4;
}

.metric-description i {
    color: #2a5298;
    margin-right: 0.25rem;
}

/* Ensure metric cards take full width */
.metric-card .plot-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Scenario Controls */
.scenario-controls {
    background: #f0f8ff;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #e6f3ff;
}

/* Enhanced scenario labels */
.scenario-controls .form-check-label {
    font-weight: 500;
    color: #1e3c72;
    cursor: pointer;
    transition: color 0.3s ease;
}

.scenario-controls .form-check-label:hover {
    color: #2a5298;
}

/* Metrics Controls */
.metrics-controls {
    background: #f0f8ff;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #e6f3ff;
    max-height: 200px;
    overflow-y: auto;
}

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: #2a5298;
    border-color: #2a5298;
}

.form-check-label {
    font-weight: 500;
    color: #1e3c72;
    cursor: pointer;
    transition: color 0.3s ease;
    padding-left: 0.25rem;
}

.form-check-label:hover {
    color: #2a5298;
}

/* Enhanced metric labels with tooltips */
.metrics-controls .form-check-label {
    position: relative;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.metrics-controls .form-check-label:hover {
    background-color: rgba(42, 82, 152, 0.1);
    color: #2a5298;
}

/* All Metrics option styling */
.metrics-controls .form-check:first-child {
    border-bottom: 1px solid #e6f3ff;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.metrics-controls .form-check:first-child .form-check-label {
    font-weight: 600;
    color: #1e3c72;
}

.metrics-controls .form-check:first-child .form-check-input:checked {
    background-color: #20B2AA;
    border-color: #20B2AA;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid #2196F3;
}

.alert-success {
    background-color: #e0f2f1;
    color: #00695c;
    border-left: 4px solid #20B2AA;
}

.alert-warning {
    background-color: #fff8e1;
    color: #f57c00;
    border-left: 4px solid #ff9800;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* Cards */
.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-title i {
    color: #2a5298;
    margin-right: 0.5rem;
}

.card-text {
    color: #6c757d;
    line-height: 1.5;
}

/* Enhanced information card */
.card .alert-light {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-top: 1rem;
}

.card .alert-light i {
    color: #2a5298;
    margin-right: 0.5rem;
}

.card .alert-light strong {
    color: #1e3c72;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        margin: 0;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .btn-primary {
        padding: 10px 20px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        padding: 15px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .plot-container {
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb {
    background: #2a5298;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #1e3c72;
}

/* Utility Classes */
.text-primary {
    color: #2a5298 !important;
}

.bg-gradient {
    background: linear-gradient(45deg, #2a5298, #20B2AA);
}

.shadow-custom {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.border-custom {
    border: 1px solid #e6f3ff;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Plot Responsive */
.plot-container {
    min-height: 600px;
    width: 100%;
    position: relative;
    padding: 40px;
    box-sizing: border-box;
}

.plot-container .js-plotly-plot {
    width: 100% !important;
    height: 100% !important;
    position: relative;
}

/* Ensure Plotly plots are properly centered */
.plot-container .plotly {
    width: 100% !important;
    height: 100% !important;
}

/* Fix Plotly toolbar positioning */
.plot-container .plotly .modebar {
    position: absolute !important;
    top: 30px !important;
    right: 30px !important;
    z-index: 1000;
}

/* Ensure plot content fills container */
.plot-container .plotly .main-svg {
    width: 100% !important;
    height: 100% !important;
}

/* Force Plotly container to fill available space */
.plot-container .plotly {
    display: block !important;
    width: 100% !important;
    height: 600px !important;
}

/* Ensure the plot container itself is properly sized */
#resultsContainer .metric-card {
    width: 100%;
    max-width: 100%;
}

#resultsContainer .metric-card .plot-container {
    width: 100%;
    max-width: 100%;
    min-height: 600px;
    overflow: visible;
}

/* Add extra padding to metric cards to prevent label cutoff */
.metric-card {
    padding: 25px;
}

/* Ensure plot labels have enough space */
.plot-container .plotly .gtitle,
.plot-container .plotly .xtick,
.plot-container .plotly .ytick {
    overflow: visible !important;
}

/* Additional spacing for plot elements */
.plot-container .plotly .main-svg {
    overflow: visible !important;
}

.plot-container .plotly .bglayer,
.plot-container .plotly .plotlayer {
    overflow: visible !important;
}

/* Ensure axis labels are fully visible */
.plot-container .plotly .xaxis .axis-title,
.plot-container .plotly .yaxis .axis-title {
    overflow: visible !important;
    text-overflow: unset !important;
}

/* Add extra padding to metric cards for better label visibility */
.metric-card {
    padding: 40px;
    margin: 25px 0;
}

/* Prediction Controls Styling */
.prediction-controls {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 1px solid #e6f3ff;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.prediction-controls:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.prediction-controls h6 {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 1rem;
}

.prediction-controls h6 i {
    color: #2a5298;
    margin-right: 0.5rem;
}

.prediction-controls .form-control,
.prediction-controls .form-select {
    border-radius: 6px;
    border: 2px solid #e6f3ff;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.prediction-controls .form-control:focus,
.prediction-controls .form-select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.prediction-controls .btn {
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.prediction-controls .btn-primary {
    background: linear-gradient(45deg, #2a5298, #20B2AA);
    border: none;
}

.prediction-controls .btn-primary:hover {
    background: linear-gradient(45deg, #1e3c72, #1E90FF);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(42, 82, 152, 0.3);
}

.prediction-controls .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.prediction-controls .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* Compact Prediction Controls Styling */
.prediction-controls-compact {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 1px solid #e6f3ff;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: auto;
}

.prediction-controls-compact:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prediction-controls-compact .compact-input,
.prediction-controls-compact .compact-select {
    border-radius: 4px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    height: auto;
    min-height: 32px;
}

.prediction-controls-compact .compact-input:focus,
.prediction-controls-compact .compact-select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.prediction-controls-compact .compact-select {
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.prediction-controls-compact .compact-btn {
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prediction-controls-compact .compact-btn:hover {
    transform: translateY(-1px);
}

.prediction-controls-compact .btn-primary {
    background: linear-gradient(45deg, #2a5298, #20B2AA);
    border: none;
}

.prediction-controls-compact .btn-primary:hover {
    background: linear-gradient(45deg, #1e3c72, #1E90FF);
    box-shadow: 0 2px 6px rgba(42, 82, 152, 0.3);
}

.prediction-controls-compact .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.prediction-controls-compact .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.prediction-controls-compact .text-muted {
    font-size: 0.8rem;
    font-weight: 500;
}

.prediction-controls-compact .gap-2 {
    gap: 0.5rem !important;
}

.prediction-controls-compact .gap-1 {
    gap: 0.25rem !important;
}

/* Prediction Result Styling */
[id^="prediction_result_"] .alert {
    border-radius: 8px;
    border: none;
    margin-top: 1rem;
}

[id^="prediction_result_"] .alert-success {
    background-color: #e0f2f1;
    color: #00695c;
    border-left: 4px solid #20B2AA;
}

[id^="prediction_result_"] .alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

[id^="prediction_result_"] .alert-warning {
    background-color: #fff8e1;
    color: #f57c00;
    border-left: 4px solid #ff9800;
}

[id^="prediction_result_"] .alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Compact Prediction Result Styling */
.prediction-result-compact {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    border: 1px solid #b2dfdb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.prediction-result-compact .result-item {
    color: #00695c;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.prediction-result-compact .result-label {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-result-compact .change-item {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.95) !important;
}

.prediction-result-compact .change-item .change-value {
    color: #495057 !important;
}

.prediction-result-compact .change-item i {
    font-size: 0.7rem;
    margin-right: 0.2rem;
}

.prediction-result-compact .change-item small {
    font-size: 0.65rem;
    opacity: 0.8;
}

.prediction-result-compact .result-location {
    color: #6c757d;
    font-size: 0.8rem;
}

.warning-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #f57c00;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin-top: 0.5rem;
}

.warning-compact i {
    font-size: 0.7rem;
}

.result-explanation {
    border-top: 1px solid rgba(0, 105, 92, 0.2);
    padding-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.result-explanation i {
    color: #2a5298;
    margin-right: 0.25rem;
}

.result-explanation strong {
    color: #00695c;
}

/* Responsive adjustments for prediction controls */
@media (max-width: 768px) {
    .prediction-controls .row {
        margin: 0;
    }
    
    .prediction-controls .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .prediction-controls .col-md-3:last-child {
        margin-bottom: 0;
    }
    
    .prediction-result-compact .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .prediction-result-compact .result-item {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Enhanced visual feedback for form elements */
.form-control:hover,
.form-select:hover {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.1rem rgba(42, 82, 152, 0.1);
}

.form-check-input:hover {
    border-color: #2a5298;
}

/* Enhanced button hover effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced card hover effects */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Enhanced metric card hover effects */
.metric-card:hover .metric-description {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: #1e3c72;
}

/* Enhanced form help text styling */
.form-text {
    background: rgba(42, 82, 152, 0.05);
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-left: 3px solid #2a5298;
}

/* Enhanced scenario and metrics controls */
.scenario-controls,
.metrics-controls {
    transition: all 0.3s ease;
}

.scenario-controls:hover,
.metrics-controls:hover {
    box-shadow: 0 2px 8px rgba(42, 82, 152, 0.1);
    border-color: #2a5298;
}

/* Enhanced loading animation */
.loading {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.loading p {
    color: #1e3c72;
    font-weight: 500;
    margin-top: 1rem;
}

/* Enhanced alert styling */
.alert {
    border-left-width: 4px;
    font-weight: 500;
}

.alert i {
    margin-right: 0.5rem;
}

/* Enhanced header styling */
.content-area header h3 {
    color: #1e3c72;
    font-weight: 600;
}

.content-area header p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Enhanced sidebar header */
.sidebar header p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Enhanced information card */
.card .row {
    margin: 0;
}

.card .col-6 {
    padding: 0.5rem;
}

.card .col-6 h6 {
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.card .col-6 p {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Enhanced tooltip positioning */
.tooltip.show {
    opacity: 1;
}

/* Enhanced form validation feedback */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Enhanced accessibility */
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

/* Enhanced mobile responsiveness */
@media (max-width: 576px) {
    .metric-description {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .form-text {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
    
    .prediction-result-compact {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .prediction-result-compact .result-item {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
} 

/* Compact window controls */
.sidebar #windowControls {
    margin-bottom: 0.5rem;
}

.sidebar #windowControls .mb-2 {
    margin-bottom: 0.5rem !important;
}

.sidebar #windowControls .form-control {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.sidebar #windowControls .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

/* Make scenario dropdown longer */
.prediction-controls-compact .compact-select {
    min-width: 120px;
    width: auto;
}

.prediction-controls-compact .compact-input {
    min-width: 80px;
    width: auto;
}

/* Forecast Explanation Box Styles */
.forecast-explanation-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-top: 20px;
}

.forecast-explanation-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.explanation-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.explanation-header h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0;
    flex: 1;
}

.explanation-header h6 i {
    color: #ffc107;
    margin-right: 8px;
}

.explanation-content {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.explanation-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
    text-align: left;
}

.explanation-text h6 {
    color: #2a5298;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.explanation-text strong {
    color: #1e3c72;
    font-weight: 600;
}

.explanation-text em {
    color: #6c757d;
    font-style: italic;
}

.explanation-text br {
    margin-bottom: 8px;
}

/* Responsive adjustments for explanation box */
@media (max-width: 768px) {
    .forecast-explanation-box {
        margin-top: 15px;
        padding: 15px;
    }
    
    .explanation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .explanation-header h6 {
        margin-bottom: 5px;
    }
    
    .explanation-text {
        font-size: 0.85rem;
    }
    
    .explanation-header h6 {
        font-size: 0.9rem;
    }
    
    .explanation-content {
        min-height: 100px;
    }
}

@media (max-width: 576px) {
    .forecast-explanation-box {
        padding: 15px;
        margin-top: 10px;
    }
    
    .explanation-text {
        font-size: 0.8rem;
    }
} 

/* Explanation and Streaming Styles */
.explanation-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.explanation-loading .spinner-border {
    color: #0d6efd;
}

.explanation-text {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.explanation-text h6 {
    color: #1e3c72;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.explanation-text strong {
    color: #2a5298;
    font-weight: 600;
}

.explanation-text em {
    color: #6c757d;
    font-style: italic;
}

.explanation-streaming-indicator {
    text-align: center;
    margin-top: 0.5rem;
}

.explanation-streaming-indicator .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Explanation container improvements */
.explanation-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.explanation-container .btn {
    transition: all 0.3s ease;
}

.explanation-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
} 