/* Modern card styling */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Better input styling */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced button styling */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Modern typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Success/Warning indicators */
.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #d97706 !important; /* Darker orange instead of yellow for better contrast */
}

.text-danger {
    color: #dc3545 !important;
}

/* Column distinction styling */
.parameters-column {
    border-right: 2px solid #dee2e6;
    border-radius: 8px 0 0 8px;
}

.results-column {
    border-left: 1px solid #dee2e6;
    border-radius: 0 8px 8px 0;
}

/* Enhanced card styling for different sections */
.parameters-card .card-header {
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%) !important;
    color: white;
}

.results-card .card-header {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%) !important;
    color: white;
}

.sensitivity-card .card-header {
    background: linear-gradient(90deg, #ffc107 0%, #d97706 100%) !important;
    color: white;
}

/* Reduce vertical space in parameters card */
.parameters-card .card-body {
    padding: 1rem;
}

.parameters-card .card-body > * {
    margin-bottom: 0.75rem !important;
}

.parameters-card .card-body > *:last-child {
    margin-bottom: 0 !important;
}

.parameters-card hr {
    margin: 0.5rem 0 !important;
}

.parameters-card h5 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.95rem !important;
}

/* Tighter input group spacing */
.parameters-card .align-items-center {
    margin-bottom: 0.5rem !important;
}

/* Compact slider styling */
.parameters-card .rc-slider {
    margin: 0.25rem 0 0.5rem 0 !important;
}

.longitudinal-page {
    --longitudinal-ink: #0f172a;
    --longitudinal-muted: #52607a;
    --longitudinal-surface: linear-gradient(180deg, #f9fbff 0%, #f3f7fc 100%);
    --longitudinal-outline: rgba(15, 23, 42, 0.08);
    --longitudinal-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.lateral-page {
    --longitudinal-ink: #0f172a;
    --longitudinal-muted: #52607a;
    --longitudinal-surface: linear-gradient(180deg, #fbfdfb 0%, #f2f8f4 100%);
    --longitudinal-outline: rgba(15, 23, 42, 0.08);
    --longitudinal-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.longitudinal-page .card,
.lateral-page .card {
    box-shadow: var(--longitudinal-shadow);
}

.longitudinal-page .card:hover,
.lateral-page .card:hover {
    transform: translateY(-3px);
}

.longitudinal-hero {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.24), transparent 28%),
        linear-gradient(135deg, #0a74ff 0%, #0f5bd8 48%, #0b275f 100%);
    box-shadow: 0 14px 34px rgba(10, 116, 255, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.longitudinal-context-card {
    background: linear-gradient(135deg, #fbfdff 0%, #f4f8fd 100%);
}

.lateral-hero {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.22), transparent 28%),
        linear-gradient(135deg, #169c5f 0%, #0f7b53 45%, #08392a 100%);
    box-shadow: 0 14px 34px rgba(22, 156, 95, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.lateral-context-card {
    background: linear-gradient(135deg, #fcfefc 0%, #f3faf5 100%);
}

.longitudinal-parameters-column {
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px 0 0 18px;
}

.longitudinal-results-column {
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0 18px 18px 0;
}

.lateral-parameters-column {
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px 0 0 18px;
}

.lateral-results-column {
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0 18px 18px 0;
}

.longitudinal-parameters-card .card-body,
.longitudinal-results-card .card-body {
    background: var(--longitudinal-surface);
}

.lateral-parameters-card .card-body,
.lateral-results-card .card-body,
.lateral-sensitivity-card .card-body {
    background: var(--longitudinal-surface);
}

.overview-parameter-card {
    position: relative;
    z-index: 1;
    overflow: visible;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.overview-input-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
}

.overview-input-card .card-header {
    background: linear-gradient(90deg, rgba(10, 116, 255, 0.12), rgba(10, 116, 255, 0.04));
    color: #0f172a;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.overview-field-block {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.overview-field-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.overview-field-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.overview-field-copy {
    font-size: 0.84rem;
    line-height: 1.45;
    color: #64748b;
}

.overview-field-input-wrap {
    flex-shrink: 0;
    width: 6rem;
    min-width: 6rem;
}

.overview-field-input-wrap--wide {
    width: 12rem;
    min-width: 12rem;
}

.overview-field-input-wrap .form-control,
.overview-field-input-wrap input {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.overview-parameter-summary {
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    background: rgba(10, 116, 255, 0.06);
    border: 1px solid rgba(10, 116, 255, 0.08);
}

.overview-results-card {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

.overview-results-card .card-header {
    background: linear-gradient(
        90deg,
        rgba(10, 116, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.96) 65%
    ) !important;
    border-bottom: 1px solid rgba(10, 116, 255, 0.25) !important;
}

.overview-results-card .card-body {
    padding: 1rem 1.05rem;
}

.overview-risk-value {
    font-variant-numeric: tabular-nums;
}

/* Result tables: make Risk Overview cards feel more premium */
.overview-table-card {
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

.overview-table-card--same {
    --overview-accent-rgb: 10, 116, 255;
}

.overview-table-card--opposite {
    --overview-accent-rgb: 22, 156, 95;
}

.overview-table-card:hover {
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.12);
}

.overview-table-card .card-header {
    background: linear-gradient(
        90deg,
        rgba(var(--overview-accent-rgb), 0.14) 0%,
        rgba(255, 255, 255, 0.96) 70%
    ) !important;
    border-bottom: 1px solid rgba(var(--overview-accent-rgb), 0.28) !important;
}

.overview-results-table thead th {
    background: rgba(var(--overview-accent-rgb), 0.1) !important;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.86rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12) !important;
}

.overview-results-table.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(var(--overview-accent-rgb), 0.055) !important;
}

.overview-results-table.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(255, 255, 255, 0.96) !important;
}

.overview-results-table tbody tr:hover > * {
    background-color: rgba(var(--overview-accent-rgb), 0.14) !important;
}

.overview-risk-tooltip .tooltip-inner {
    background: rgba(15, 23, 42, 0.96) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.overview-compare-button {
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-weight: 600;
}

.overview-selection-pane {
    position: relative;
    z-index: 2;
    overflow: visible;
    height: 100%;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.overview-selection-pane--accent {
    background: linear-gradient(180deg, rgba(10, 116, 255, 0.05), rgba(255, 255, 255, 0.94));
}

.overview-model-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.overview-model-dropdown .Select-control,
.overview-model-dropdown .Select-menu-outer,
.overview-model-dropdown .VirtualizedSelectFocusedOption {
    border-radius: 12px;
}

.overview-model-dropdown .Select {
    position: relative;
    z-index: 3;
}

.overview-model-dropdown .Select.is-open {
    z-index: 1200;
}

.overview-model-dropdown .Select-control {
    min-height: 2.7rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.96);
}

.overview-model-dropdown .Select-menu-outer {
    z-index: 1210;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.overview-model-dropdown .Select-menu {
    background: #ffffff;
}

.overview-model-dropdown .VirtualizedSelectOption,
.overview-model-dropdown .VirtualizedSelectFocusedOption {
    background-color: #ffffff;
}

.overview-compact-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.overview-compact-label {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.overview-compact-input {
    min-height: 2.7rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.96);
}

/* Override Bootstrap's default tooltip max-width (276px) so text fits */
.tooltip-inner {
    max-width: 600px !important;
    min-width: 360px;
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.parameters-intro {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(10, 116, 255, 0.12);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(10, 116, 255, 0.08), rgba(255, 255, 255, 0.92));
}

.parameter-kicker {
    display: inline-block;
    margin-bottom: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0b5ed7;
    background: rgba(10, 116, 255, 0.12);
}

.parameter-section {
    margin-bottom: 1rem;
    border: 1px solid var(--longitudinal-outline);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    overflow: visible;
}

.parameter-section-header {
    padding: 0.95rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.parameter-section-title {
    color: var(--longitudinal-ink);
    font-size: 1rem;
}

.parameter-section-copy {
    color: var(--longitudinal-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.parameter-section-body {
    padding: 1rem 1rem 0.25rem;
}

.comparison-accent {
    background: linear-gradient(90deg, rgba(10, 116, 255, 0.12), rgba(10, 116, 255, 0.02));
}

.global-accent {
    background: linear-gradient(90deg, rgba(15, 135, 95, 0.12), rgba(15, 135, 95, 0.02));
}

.scenario-a-accent {
    background: linear-gradient(90deg, rgba(255, 179, 0, 0.16), rgba(255, 179, 0, 0.03));
}

.scenario-b-accent {
    background: linear-gradient(90deg, rgba(183, 85, 46, 0.12), rgba(183, 85, 46, 0.03));
}

.parameter-label {
    font-weight: 700;
    color: var(--longitudinal-ink);
}

.longitudinal-model-dropdown .Select-control,
.longitudinal-model-dropdown .VirtualizedSelectFocusedOption {
    border-radius: 12px;
}

/* Keep Dash dropdown menus from being clipped by parameter cards/sections. */
.longitudinal-page .Select,
.lateral-page .Select {
    position: relative;
}

.longitudinal-page .Select.is-open,
.lateral-page .Select.is-open {
    z-index: 1050;
}

.longitudinal-page .Select-menu-outer,
.lateral-page .Select-menu-outer {
    z-index: 1060;
}

.selection-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 0.92rem;
    color: #0b275f;
    background: rgba(10, 116, 255, 0.08);
    border: 1px solid rgba(10, 116, 255, 0.12);
}

.assumptions-panel {
    padding: 1rem 1rem 0.1rem;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(245, 248, 252, 0.9), rgba(255, 255, 255, 0.96));
}

.longitudinal-summary-card {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.94));
}

.summary-color-dot {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.04);
}

.summary-model-name {
    font-weight: 700;
    color: var(--longitudinal-ink);
}

.summary-status-badge {
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-weight: 700;
}

.summary-metrics-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.summary-metric-block {
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
}

.summary-metric-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--longitudinal-muted);
}

.summary-metric-value {
    color: var(--longitudinal-ink);
}

.summary-status-text,
.summary-driver-text {
    color: var(--longitudinal-muted);
}

@media (max-width: 991px) {
    .longitudinal-parameters-column,
    .longitudinal-results-column,
    .lateral-parameters-column,
    .lateral-results-column {
        border: none;
        border-radius: 18px;
    }
}

@media (max-width: 768px) {
    .parameter-section-body {
        padding-bottom: 0.6rem;
    }

    .summary-metrics-row {
        grid-template-columns: 1fr;
    }

    .selection-summary-chip {
        width: 100%;
    }
}
