/* ============================================================== */
/* STEER base stylesheet (steer-app-kit)                          */
/* Shared typography, brand chrome, and component styling for all */
/* STEER Dash apps. Loads before each app's own assets/style.css, */
/* so apps can override anything here locally.                    */
/* ============================================================== */

/* Self-hosted Inter (variable font, weights 100-900).
   Served from the steer-app-kit package - no render-blocking CDN request. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('./fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('./fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* App-wide sizing via root font-size only (a body zoom hack causes
   positioning bugs with tooltips and Plotly hover layers). */
html {
    font-size: 13px;
    overflow-x: auto;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f4f6f8;
    color: #1a1d21;
    letter-spacing: -0.01em;
}

/* Consistent focus treatment (keyboard-friendly) */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.25);
}

svg {
  shape-rendering: geometricPrecision;
}

/* Scale components individually for better control */
.container-fluid {
    max-width: 98%;
    margin: 0 auto;
}

/* Compact spacing */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.col {
    padding-left: 8px;
    padding-right: 8px;
}

/* Scale dash components appropriately */
.dash-table-container {
    font-size: 0.9rem;
}

.dash-graph {
    margin: 0.5rem 0;
}

/* Keep sliders at normal proportions to maintain tooltip positioning */
.rc-slider {
    margin: 0.5rem 0;
}

.rc-slider-tooltip {
    font-size: 0.5rem;
}

/* Scale input fields */
input[type="number"],
.dash-input {
    font-size: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:hover,
.dash-input:hover {
    border-color: #cbd5e1;
}

input[type="number"]:focus,
.dash-input:focus {
    border-color: #8B2635;
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.15);
}

/* Scale buttons */
button,
.btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.15s ease;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Scale dropdowns */
.dash-dropdown {
    font-size: 0.9rem;
}

/* dcc.Dropdown (react-select) modern styling */
.Select-control {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease !important;
}

.Select-control:hover {
    border-color: #cbd5e1 !important;
}

.is-focused .Select-control {
    border-color: #8B2635 !important;
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.15) !important;
}

.Select-menu-outer {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    margin-top: 4px !important;
}

.Select-option.is-focused {
    background-color: #f1f5f9 !important;
}

.Select-option.is-selected {
    background-color: #8B2635 !important;
    color: white !important;
}

/* Compact margins */
.mb-3 {
    margin-bottom: 0.8rem !important;
}

.p-3 {
    padding: 0.8rem !important;
}

/* Modern slider styling with accent color */
.rc-slider-rail {
    background-color: #e2e8f0;
    height: 6px;
    border-radius: 3px;
}

.rc-slider-track {
    background: linear-gradient(90deg, #8B2635, #A53545);
    height: 6px;
    border-radius: 3px;
}

.rc-slider-handle {
    border: 2px solid #8B2635;
    background-color: #ffffff;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(139, 38, 53, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rc-slider-handle:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(139, 38, 53, 0.3);
}

.rc-slider-dot {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.rc-slider-dot-active {
    border-color: #8B2635;
    background-color: #8B2635;
}

.rc-slider-handle:focus,
.rc-slider-handle:active {
    border-color: #8B2635;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 38, 53, 0.2);
    outline: none;
}

/* Reduce repaints during dragging */
.rc-slider {
    will-change: transform;
}

.rc-slider-handle {
    will-change: transform;
}

/* Optimize slider rendering */
.slider-container {
    will-change: transform;
    contain: layout style;
}

/* Optimize input field updates */
input[type="number"] {
    will-change: contents;
}

/* Modern segmented tabs */
.tab-style {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 2px;
    font-weight: 600;
    position: relative;
    white-space: nowrap;
}

/* Hover effect */
.tab-style:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

/* Selected tab */
.tab-selected-style {
    color: #8B2635;
    background-color: #ffffff;
    box-shadow: inset 0 -2px 0 #8B2635, 0 1px 4px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}

/* Modern tabs container */
.dash-tabs {
    border-bottom: none;
    margin-bottom: 16px;
    background: #f8fafc;
    padding: 5px;
    border-radius: 12px;
    display: inline-flex;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Modern cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* Brand-tinted text selection */
::selection {
    background-color: rgba(139, 38, 53, 0.15);
}

/* Thin, subtle scrollbars (WebKit); Firefox handled per-container */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Primary buttons everywhere - override Bootstrap theme */
.btn-primary {
    background: #8B2635 !important;
    border: none !important;
    font-weight: 600;
    border-color: #8B2635 !important;
    color: #f1f5f9 !important;
}

.btn-primary:hover {
    background: #6D1E29 !important;
    border-color: #6D1E29 !important;
    color: #f1f5f9 !important;
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.3) !important;
    border-color: #8B2635 !important;
}

.btn-primary:active {
    background: #6D1E29 !important;
    border-color: #6D1E29 !important;
}

/* Outline primary buttons */
.btn-outline-primary {
    color: #8B2635 !important;
    border-color: #8B2635 !important;
}

.btn-outline-primary:hover {
    background-color: #8B2635 !important;
    border-color: #8B2635 !important;
    color: #f1f5f9 !important;
}

.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: #6D1E29 !important;
    border-color: #6D1E29 !important;
    color: #f1f5f9 !important;
}

/* Form controls */
.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control:focus {
    border-color: #8B2635;
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.15);
}

/* ============================== */
/* Unified Modal Styles           */
/* ============================== */

/* Base modal styling - applies to all STEER modals */
.steer-modal .modal-content {
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
}

.steer-modal .modal-header {
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 18px 20px;
}

.steer-modal .modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.steer-modal .modal-body {
    padding: 20px;
}

.steer-modal .modal-footer {
    border-top: 1px solid #f1f5f9;
    background: transparent;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 14px 20px;
}

.steer-modal .btn-close {
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.steer-modal .btn-close:hover {
    opacity: 1;
}

/* Modal buttons */
.steer-modal .btn {
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.steer-modal .btn-secondary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.steer-modal .btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.steer-modal .btn-primary {
    background: linear-gradient(135deg, #8B2635, #A53545) !important;
    border: none !important;
}

.steer-modal .btn-primary:hover {
    background: linear-gradient(135deg, #6D1E29, #8B2635) !important;
}

.steer-modal .btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
}

.steer-modal .btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.steer-modal .btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
}

.steer-modal .btn-success:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

/* Modal form inputs */
.steer-modal .form-control,
.steer-modal input[type="text"],
.steer-modal input[type="number"],
.steer-modal select {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.steer-modal .form-control:focus,
.steer-modal input[type="text"]:focus,
.steer-modal input[type="number"]:focus,
.steer-modal select:focus {
    border-color: #8B2635;
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.15);
    outline: none;
}

.steer-modal .form-control:hover,
.steer-modal input[type="text"]:hover,
.steer-modal input[type="number"]:hover,
.steer-modal select:hover {
    border-color: #cbd5e1;
}

/* Modal error messages */
.steer-modal .modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
}

/* Modal labels */
.steer-modal label {
    font-weight: 700;
    color: #695C47;
    margin-bottom: 6px;
}

/* Modal help text */
.steer-modal .modal-help-text {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 8px;
}

/* Standard modal size (small to medium content) */
.steer-modal.steer-modal-sm .modal-dialog {
    max-width: 420px;
}

/* Large modal (for complex forms) */
.steer-modal.steer-modal-lg .modal-dialog {
    max-width: 800px;
}

/* Extra large modal (for material modals with graphs) */
.steer-modal.steer-modal-xl .modal-dialog {
    max-width: 1140px;
}

/* Modal section dividers */
.steer-modal hr {
    margin: 16px 0;
    border-color: #e2e8f0;
    opacity: 1;
}

/* Modal section headers */
.steer-modal h5 {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
}

/* Modal disabled button state */
.steer-modal .btn:disabled,
.steer-modal .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Upload area styling for modals */
.steer-modal .upload-area {
    width: 100%;
    height: 64px;
    line-height: 64px;
    border-width: 1px;
    border-style: dashed;
    border-color: #e2e8f0;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 10px;
    background-color: #f8fafc;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.steer-modal .upload-area:hover {
    border-color: #8B2635;
    background-color: #fef7f7;
}

/* Color picker styling for modals */
.steer-modal input[type="color"] {
    width: 72px;
    height: 40px;
    padding: 2px;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Preview container styling for modals */
.steer-modal .preview-container {
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    padding: 10px;
}

/* ============================================================== */
/* Top-right action menu (generic dropdown chrome)                */
/* ============================================================== */

.top-right-action-menu .btn,
.top-right-action-menu.btn {
    min-width: 140px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    transition: all 0.15s ease;
}

.top-right-action-menu .btn:hover,
.top-right-action-menu.btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.top-right-action-menu .btn:focus,
.top-right-action-menu.btn:focus {
    box-shadow: 0 0 0 3px rgba(139, 38, 53, 0.2);
    border-color: #8B2635;
}

.top-right-action-menu .dropdown-menu {
    min-width: 220px;
    padding: 6px;
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.top-right-action-menu .dropdown-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #1e293b;
    border-radius: 6px;
    transition: all 0.1s ease;
    margin: 2px 0;
}

.top-right-action-menu .dropdown-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.top-right-action-menu .dropdown-item:active {
    background-color: #e2e8f0;
    color: #0f172a;
}

.top-right-action-menu .dropdown-item.disabled {
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.5;
}

.top-right-action-menu .dropdown-item.disabled:hover {
    background-color: transparent;
    color: #adb5bd;
}

.top-right-action-menu .dropdown-divider {
    margin: 6px 0;
}
