:root {
    /** plotly colors**/
    --red: #EF553B;
    --pink: #FF6692;
    --blue: #636EFA;
    --green: #00CC96;
    --yellow: #FECB52;
    --purple: #AB63FA;

    --rf-bg-main: #243746;
    --rf-bg-header: #243746;
    --rf-bg-panel: #B8B9BA;
    --rf-bg-panel-secondary: #DCDEDF;
    --rf-bg-lightgray: #EAEBED;
    --rf-primary: #2563EB;
    --rf-primary-hover: #1D4ED8;
    --rf-success: #16A34A;
    --rf-danger: #DC2626;
    --rf-text-dark: #111827;
    --rf-text-muted: #6f7271;
    --rf-border: #E5E7EB;
}
/** bootstrap override **/
.bg-dark {
    background-color: #243746 !important;
}

@font-face {
    font-family: 'Quincy CF';
    src: url('/html/fonts/QuincyCF-Regular/QuincyCF-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* recommended for performance */
}

@font-face {
    font-family: 'Avenir Next Cyr';
    src: url('/html/fonts/AvenirNextCyr-Regular/AvenirNextCyr-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* recommended for performance */
}

body {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0;
    margin: 0;
    padding: 20px;
    font-family: Inter, sans-serif;
}

main {
    margin-top: 1.5em;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #425CC7;
    --bs-btn-border-color: #425CC7;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0b5ed7;
    --bs-btn-hover-border-color: #0a58ca;
    --bs-btn-focus-shadow-rgb: 49,132,253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0a58ca;
    --bs-btn-active-border-color: #0a53be;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0d6efd;
    --bs-btn-disabled-border-color: #0d6efd;
}

.rf-text-muted {
    color: var(--rf-text-muted) !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container > div:first-child {
    display: flex;
    align-items: center;
    gap: 1em;
}

.header-container img {
    display: block;
    margin: 0;
    padding: 0;
}

.header-container h1 {
    margin: 0;
    line-height: 1.1;
}

.header-container .secondary {
    font-size: 0.9em;
    color: #555;
    margin-left: 0.5em;
}

/* Custom CSS to make the modal backdrop darker */
.modal-backdrop.show {
    opacity: 0.9; /* Increase opacity for darker backdrop */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-top:1em;
}

.chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;              /* space between charts */
    margin-top: 1.5em;
}

.chart {
    /* make chart fill its grid cell */
    width: 100%;
    /* whatever height you like: */
    min-height: 400px;
    box-sizing: border-box; /* include padding & border in the width */
    border: 1px solid grey;
    padding: 0.5em;
    border-radius: 0.5em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

  /* 1) Make the .chart container “positioned” and clip overflow */
.chart {
    position: relative;
    overflow: hidden;           /* hide anything that spills over */
  }

/* 2) Tell Plotly’s root DIV to always be 100%×100% of its parent .chart */
.chart .js-plotly-plot {
    width: 100% !important;     /* override Plotly’s inline width */
    height: 100% !important;    /* override Plotly’s inline height */
}

/* Optional: ensure the SVG inside Plotly also doesn’t exceed */
.chart .js-plotly-plot svg {
    max-width: 100%;
    max-height: 100%;
}

.table-container {
    max-width: 100% !important;
    font-size:0.8em;
    border: 1px solid grey;
    padding: 1em;
    margin: 0.5em;
    border-radius: 0.5em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-box {
    font-size: 1.2em;
    font-weight:900;
    border: 2px solid #BBBBBB;
    /* Stylish blue border */
    background-color: #f0eeea;
    /* Light gray background for contrast */
    padding: 1em;
    border-radius: 10px;
    /* Rounded corners */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: top;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for 3D effect */
    color: #243746;
    /* Dark gray text color for readability */
    margin: 0.1em;
    /* Space around the box */
}

/** some .stat-box overrides to allow the indicator to fill the div **/
#stat-box-conversion-stats {
    padding:0.1em;
}

#stat-box-conversion-stats span{
    margin-left:1em;
}

.stat-title {
    font-size: 18px;
    /* Larger text for title */
    font-weight: 900;
    margin-bottom: 10px;
    /* Space between title and value */
}

.stat-value {
    font-size: 24px;
    /* Even larger text for value */
    color: #5887DA;
    /* Blue text to match the border */
    font-weight: bold;
}

.date-picker-container {
    display: flex;
    align-items: start;
    justify-content: start;
}

.date-picker-container > div {
    margin-right: 10px;
}

section {
    max-width:100%;
}

#allQuotesTable, #allSalesorderTable {
    table-layout: fixed;
    word-wrap:break-word;
}

.trendUp {
    color: green !important;
}

.trendDown {
    color: red !important;
}

table thead th {
    background-color: #4472C4;
    color: white;
    font-size:1.1em;
}

#backlogTable {
    font-size:0.8em;
}

.table-ministats {
    font-size: 0.8em;
}

.table-ministats td , .table-ministats th{
    padding:0.5em;
    border: 1px solid #cccccc;
    background-color: transparent;
}

/* AI metrics grid styling */
.ai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
+
.ai-model-metrics h4 {
    margin-bottom: 8px;
+}

table.dataTable tfoot tr th {
    font-size: 1.3em;
    color: white;
    background-color: #555555 !important;
}

.sub-heading {
    font-size:0.9em;
    font-weight:bold;
}

.conv-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* Optional: Add some space between the columns */
    width: 100%;
    height: 100%; /* Adjust as needed */
    margin-top: 1em;
}
.conv-stats-grid > div {
    border: 1px solid #ccc; /* Optional: Add border to see the divs */
    padding: 10px; /* Optional: Add padding for better visual */
    box-sizing: border-box;

    font-size: 1.2em;
    font-weight:900;
    border: 2px solid #007BFF;
    /* Stylish blue border */
    background-color: #E9ECEF;
    /* Light gray background for contrast */
    padding: 1em;
    border-radius: 10px;
    /* Rounded corners */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for 3D effect */
    color: #333;
    /* Dark gray text color for readability */
    margin: 0.1em;
    /* Space around the box */
}

.data-section {
    background: #eee;
    border-radius: 4px;
    padding: 5px;
    margin-bottom: 5px;
}
.data-section p {
    margin: 5px 0;
    font-size: 14px;
}

#stat-box-ecom-weekly-stats table span {
    background: none;
}

#stat-box-ecom-weekly-stats table {
    font-size: 0.75em;
}

#ecom-stats-container .tab-pane {
    padding: 1.5em;
    border: 1px solid #ccc;
    border-top: none;
}

#page-speed-analytics {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;

}

.charts-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 2em;
    gap: 100px;
}

.chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
}

.chart-wrapper h2 {
    text-align: center;
    margin-bottom: 10px;
}

#pagespeed-ai-analysis {
    width: 100%;
    text-align: center;
}

#pagespeed-ai-analysis .container {
    display: flex;
    width: 100%;
}

#pagespeed-ai-analysis .title {
    font-weight: bold;
    text-decoration: underline;
}

#pagespeed-ai-content,
#pagespeed-ai-worst-urls {
    flex: 1;
    padding: 1.5em;
    box-sizing: border-box; /* Ensures padding is included in the element's width */
}

#pagespeed-ai-worst-urls {
    text-align: left;
}

h2.page-title {
    border-bottom: 1px solid #ccc;
}

table tr.striped {
    background-color: #eee;
}

#weekly-ecommerce-order-stats table td {
    white-space:nowrap;
}

#ecommerce-yoy-ytd {
    font-size: 0.85em;
}

#report-output {
    padding: 2em;
    margin: 2em;
    border: 2px solid #ccc;
    border-radius: 20px;
}

.chart-wrapper {
    width:500px;
}

/* AI Model Metrics Styling */
.ai-section-title {
    color: #243746;
    border-bottom: 3px solid #425CC7;
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-weight: 700;
}

.ai-metric-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.ai-section-header {
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 2px solid #dee2e6;
}

.ai-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.ai-metric-box {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid #6c757d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.ai-metric-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-metric-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

/* Color coding for different metric types using brand palette */
.ai-metric-coverage { border-left-color: #5887DA; }
.ai-metric-coverage .ai-metric-value { color: #5887DA; }

.ai-metric-probability { border-left-color: #769D91; }
.ai-metric-probability .ai-metric-value { color: #769D91; }

.ai-metric-delta { border-left-color: #D79A2B; }
.ai-metric-delta .ai-metric-value { color: #B47F00; }

.ai-metric-prediction { border-left-color: #425CC7; }
.ai-metric-prediction .ai-metric-value { color: #425CC7; }

.ai-metric-value { border-left-color: #0047BA; }
.ai-metric-value .ai-metric-value { color: #0047BA; }

.ai-metric-forecast-optimistic { border-left-color: #41695B; }
.ai-metric-forecast-optimistic .ai-metric-value { color: #41695B; }

.ai-metric-forecast-binary { border-left-color: #E0592A; }
.ai-metric-forecast-binary .ai-metric-value { color: #E0592A; }

.ai-metric-time-optimistic { border-left-color: #A5BCB1; }
.ai-metric-time-optimistic .ai-metric-value { color: #41695B; }

.ai-metric-time-binary { border-left-color: #FF9D6C; }
.ai-metric-time-binary .ai-metric-value { color: #E0592A; }

/* Risk Analysis Section */
.ai-risk-section {
    background: #F8DF8D;
    border: 1px solid #F4B223;
}

.ai-risk-header {
    color: #B47F00;
    border-bottom-color: #F4B223;
}

.ai-risk-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 12px;
}

.ai-risk-table thead th {
    background-color: #243746;
    color: white;
    font-weight: 600;
}

.ai-high-risk { background-color: #FF9D6C; }
.ai-medium-risk { background-color: #FDC99A; }
.ai-low-risk { background-color: #CEDFD7; }

.risk-high {
    color: #E0592A;
    font-weight: bold;
    background: #FF9D6C;
    padding: 4px 8px;
    border-radius: 4px;
}

.risk-medium {
    color: #B47F00;
    font-weight: bold;
    background: #F4B223;
    padding: 4px 8px;
    border-radius: 4px;
}

.risk-low {
    color: #41695B;
    font-weight: bold;
    background: #A5BCB1;
    padding: 4px 8px;
    border-radius: 4px;
}

.dark-theme{
    background: var(--rf-bg-header) !important;
    padding: 0px !important;
}

.dark-theme header {
    background: var(--rf-bg-header) !important;
    padding: 1rem 3rem !important;
}

.dark-theme header .header-browsing-link,
.dark-theme header .header-browsing-link:visited {
    color: #fff !important;
    font-weight: normal !important;
    font-size: 12px !important;
}

.dark-theme header .user-dropdown button{
    background: transparent !important;
    border: 0px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 12px !important;
}

.dark-theme header .user-dropdown button .bi{
    font-size: 20px !important;
}

.dark-theme .main-container {
    background-image: url('../images/Texture-cast-iron.png');
    background-repeat: no-repeat;
    background-size: cover;
    padding: 1.5rem 2.5rem;
    margin: 0px;
    height: calc(100vh - 85px) !important;
    max-width: 100vw !important;
}

.dark-theme .main-container .sidebar-wrapper{
    background: var(--rf-bg-panel) !important;
    border-radius: 10px !important;
    padding: 0.5rem 1rem 1rem 1rem !important;
}

.dark-theme .main-container .sidebar-wrapper .sidebar-item{
    border-bottom: 1px solid #9FA1A3;
    height: 48px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
}

.dark-theme .main-container .sidebar-wrapper .sidebar-item:hover {
    background-color: var(--rf-bg-lightgray) !important;
    border-radius: 10px !important;
    cursor: pointer;
}

.dark-theme .main-container .main-wrapper #chatTitle {
    color: #fff !important;
    font-weight: bold !important;
}

@media screen and (max-width: 900px) {
    .dark-theme header {
        padding: 1rem 1rem !important;
    }

    .dark-theme .main-container {
        padding: 1rem !important;
    }

    .dark-theme .main-container .sidebar-wrapper .sidebar-item {
        height: 32px !important;
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .dark-theme .main-container .sidebar-wrapper .sidebar-item h6 {
        font-size: 12px !important;
    }
}

@media screen and (max-width: 767px) {
    .dark-theme .main-container .main-wrapper{
        margin-top: 2rem !important;
        padding-left: 0px !important;
        padding-right: 0px !important;
    }

    #chatWindow{
        height: 280px !important;
    }
}



@media screen and (max-width: 400px) {
    .dark-theme .main-container .main-wrapper{
        margin-top: 1rem !important;
    }

    #chatWindow{
        height: 230px !important;
    }
}