/* assets/style.css */
.tooltip-hide .tooltip {
  display: none;
}

/* Walkthrough carousel indicators */
.wt-indicator {
    background-color: var(--mantine-color-gray-6) !important;
    opacity: 0.5;
    width: 12px;
    height: 6px;
    border: 1px solid var(--mantine-color-gray-7);
    transition: all 250ms ease;
}

.wt-indicator[data-active] {
    background-color: var(--mantine-color-blue-7) !important;
    opacity: 1;
    width: 30px;
}

/* Wider dbc tooltips */
.tooltip-inner {
    max-width: 350px !important;
}


/* Hide Plotly rangeslider on small screens — the external range buttons replace it,
   and hiding it removes the finger-target conflict with the overflow-x scrollbar. */
@media (max-width: 768px) {
    .rangeslider-container {
        display: none !important;
    }
}

/* Accordion control hover highlight (mirrors dbc.Button behaviour) */
.mantine-Accordion-control {
    transition: background-color 150ms ease;
}

.mantine-Accordion-control:not([data-disabled]):hover {
    background-color: var(--mantine-color-blue-8) !important;
}

/* Reduce inner panel content padding (default Mantine is 16px) */
.mantine-Accordion-content {
    padding: 6px;
}


/* ── Walkthrough highlight ───────────────────────────────────────── */
.wt-highlight {
    outline: 3px solid rgba(33, 113, 181, 0.8) !important;
    outline-offset: 4px;
    border-radius: 6px;
}

/* Custom colours for Mantine bars loader (m_870bb79 = bar div element) */
.m_870bb79:nth-of-type(1) { background: #2171b5 !important; }
.m_870bb79:nth-of-type(2) { background: #c6dbef !important; }
.m_870bb79:nth-of-type(3) { background: #fc9272 !important; }

/* Custom colours for Mantine dots loader (m_870c4af = dot div element, 3 dots) */
.m_870c4af:nth-of-type(1) { background: #2171b5 !important; }
.m_870c4af:nth-of-type(2) { background: #c6dbef !important; }
.m_870c4af:nth-of-type(3) { background: #fc9272 !important; }

/* Center all text in the alert-info panel.  The <ul> is made inline-block
   so the bullet block itself is centered within the container. */
#alert-info {
    text-align: center;
}

#alert-info p {
    margin-bottom: 0.15rem;
}

#alert-info ul {
    display: inline-block;
    margin: 0;
}

/* Tabs inside the alert-info panel */
#alert-tabs {
    --tabs-color: #2d7a2d;   /* dark green indicator line */
}
#alert-tabs .mantine-Tabs-tab {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 4px 10px;
}
#alert-tabs .mantine-Tabs-panel {
    padding-top: 6px;
}

/* ── AI Summary floating button ──────────────────────────────────────────────
   Yellow circle sits in the breadcrumb row, pinned to the right.
   Expands leftward on hover to reveal the full label.                      */

.ai-summary-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
}

.ai-summary-btn {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 34px;
    border-radius: 17px;
    background-color: #f5c518;
    border: none;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    width: 34px;
    transition: width 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    user-select: none;
    z-index: 10;
}

.ai-summary-btn:hover {
    width: 310px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

.ai-summary-label {
    opacity: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a1a;
    padding-left: 18px;
    transition: opacity 0.15s ease 0.15s;
}

.ai-summary-btn:hover .ai-summary-label {
    opacity: 1;
}

.ai-summary-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}




/* Map container: horizontal scroll only on small screens.
   On md+ screens overflow is left at the default (visible) so the
   walkthrough CSS outline on child elements is never clipped. */
@media (max-width: 767px) {
    .map-scroll-container {
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;       /* Firefox */
    }
    .map-scroll-container::-webkit-scrollbar {
        display: none;               /* Chrome / Safari */
    }
}

/* Desktop-only figure width floor. On mobile (<768px) the S/M/L control
   (seg-fig-size) owns figure width, so no floor is applied there. */
@media (min-width: 768px) {
    #map-world, #map-country, #lineplot {
        min-width: 500px;
    }
}

/* ── Mobile sidebar drawer ───────────────────────────────────────────────────
   On small screens the accordion sidebar becomes a slide-in drawer from the
   right. position:fixed removes it from the grid flow so the main content
   expands to fill the full width automatically.                             */

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1049;
    cursor: pointer;
}

@media (max-width: 767px) {
    #sidebar-col {
        position: fixed !important;
        top: 0;
        right: 0;
        height: 100vh;
        width: 92vw !important;
        max-width: 400px;
        z-index: 1050;
        background: white;
        overflow: visible !important;  /* allow dropdown menus to escape the container */
        box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
        transform: translateX(105%);
        transition: transform 0.3s ease;
        padding: 12px !important;
    }

    #sidebar-scroll-inner {
        height: 100vh;
        overflow-y: auto;
        padding-bottom: 24px;
        /* Side padding gives the wt-highlight outline room to show without being
           clipped — overflow-y:auto implicitly sets overflow-x:auto per CSS spec. */
        padding-left: 5px;
        padding-right: 5px;
    }

    #sidebar-col.sidebar-open {
        transform: translateX(0);
    }

    #sidebar-overlay.sidebar-open {
        display: block;
    }
}

@media (min-width: 768px) {
    #btn-open-sidebar,
    #btn-close-sidebar {
        display: none !important;
    }
}

/* Mantine portal dropdowns must appear above the sidebar overlay (z-index 1049) */
:root {
    --mantine-z-index-popover: 2000;
    --mantine-z-index-dropdown: 2000;
}

/* On mobile: breadcrumb capped so tune FAB doesn't overlap;
   AI summary button moves to the left and expands rightward */
@media (max-width: 767px) {
    #nav-breadcrumb {
        max-width: 75%;
    }
    .ai-summary-btn {
        right: auto;
        left: 6px;
        flex-direction: row-reverse;  /* icon left, label expands right */
        justify-content: flex-end;
    }
    .ai-summary-btn .ai-summary-label {
        padding-left: 0;
        padding-right: 18px;
    }
    /* Expanded state set by mobile_ui.js on first tap (both AI buttons) */
    .ai-summary-btn.mobile-expanded {
        width: 280px;
    }
    .ai-summary-btn.mobile-expanded .ai-summary-label {
        opacity: 1;
        animation: none;  /* suppress the auto-expand animation on mobile */
    }
}

/* ── Mobile figure scroll buttons ◀ ▶ ──────────────────────────────────────── */
.fig-scroll-controls {
    display: none;   /* hidden by default; shown on mobile below */
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

/* Keep the S/M/L control right-aligned even when the scrollbar track is
   hidden (fig_scroll.js sets it display:none when the figure fits). */
#seg-fig-size {
    margin-left: auto;
}

/* Custom scrollbar track */
#fig-scroll-track {
    flex: 1;
    height: 20px;
    background: #e0e4ea;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
}

/* Thumb — width and left set by JS */
#fig-scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 30px;
    background: #6c94c0;
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
    transition: background 0.15s ease;
}

#fig-scroll-thumb:active {
    background: #4a74a8;
    cursor: grabbing;
}

@media (max-width: 767px) {
    .fig-scroll-controls {
        display: flex;
    }
}
