/* Default desktop style */
.app-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-switch {
    position: absolute;        /* use fixed instead of absolute */
    right: 400px;           /* distance from the right edge of the viewport */
    z-index: 101;            /* stack on top */
    padding: 2px;           /* internal spacing */
    border-radius: 5px;     /* rounded corners */
}


.details-toast {
    position: fixed;
    top: 60px;
    left: 4px;              /* left-aligned on desktop */
    z-index: 10000;
    max-height: calc(100dvh - 72px);
    min-height: 200px;
    overflow: auto;
    resize: vertical;
    width: 400px;
    max-width: 400px;
    padding: 10px;
    box-sizing: border-box;
    --bs-toast-bg: rgba(250, 252, 254, 0.955);
    --bs-toast-header-bg: rgba(250, 252, 254, 0.78);
    --bs-toast-border-color: rgba(255, 255, 255, 0.72);
    background-color: rgba(250, 252, 254, 0.955);
    backdrop-filter: blur(8px) saturate(115%);
    -webkit-backdrop-filter: blur(8px) saturate(115%);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 13px;
    box-shadow: 8px 8px 24px rgba(31, 78, 121, 0.12);
    transition: box-shadow 0.3s ease;
}

.blank-node-warning-toast,
.load-limit-warning-toast,
.type-node-warning-toast {
    position: fixed;
    top: 60px;
    left: 412px;
    z-index: 10010;
    width: 400px;
    max-width: calc(100vw - 420px);
    background: #fff3cd;
    border-color: #e6c35c;
    color: #664d03;
    font-size: 0.84em;
}

.notification-toast-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

#graph-loading-pill.loading-pill-attention {
    animation: loading-pill-attention 0.45s ease-out;
}

#graph-loading-pill {
    z-index: 10020;
}

.quick-controls-window {
    position: fixed;
    top: 118px;
    right: 24px;
    z-index: 10005;
    width: 250px;
    color: #30475b;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.68),
        rgba(225, 241, 252, 0.48)
    );
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 17px;
    box-shadow:
        0 16px 38px rgba(31, 78, 121, 0.18),
        0 3px 9px rgba(31, 78, 121, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.86),
        inset 0 0 0 1px rgba(117, 174, 210, 0.12);
    backdrop-filter: blur(22px) saturate(155%);
    -webkit-backdrop-filter: blur(22px) saturate(155%);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.quick-controls-window.side-panel-open {
    transform: translateX(var(--quick-controls-panel-shift, 0px));
}

@keyframes quick-controls-panel-overshoot {
    0% { transform: translateX(var(--quick-controls-start-shift, 0px)); }
    68% { transform: translateX(var(--quick-controls-overshoot-shift, 0px)); }
    100% { transform: translateX(var(--quick-controls-panel-shift, 0px)); }
}

.quick-controls-window.side-panel-opening {
    transition: none;
    animation: quick-controls-panel-overshoot 0.8s
        cubic-bezier(0.22, 0.75, 0.35, 1) both;
}

.quick-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 7px 7px 12px;
    color: #1f4e79;
    font-weight: 600;
    cursor: move;
    touch-action: none;
    user-select: none;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.54),
        rgba(214, 237, 251, 0.34)
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.62);
}

.quick-controls-header > span {
    white-space: nowrap;
}

.quick-controls-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

#quick-controls-collapse,
#quick-settings-pane-toggle,
#quick-controls-auto-expand {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #1f4e79;
    background: rgba(255, 255, 255, 0.20);
    line-height: 22px;
}

#quick-controls-auto-expand {
    width: auto;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#quick-controls-auto-expand.is-active {
    color: #fff;
    background: rgba(47, 164, 231, 0.82);
    box-shadow: 0 1px 4px rgba(31, 111, 162, 0.22);
}

#quick-settings-pane-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-panel-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 13px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    box-sizing: border-box;
}

.quick-panel-icon::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    border-left: 1.5px solid currentColor;
    background: rgba(47, 164, 231, 0.18);
    border-radius: 0 2px 2px 0;
    box-sizing: border-box;
}

#quick-controls-collapse:hover,
#quick-settings-pane-toggle:hover,
#quick-controls-auto-expand:hover {
    background: rgba(255, 255, 255, 0.64);
    box-shadow: inset 0 0 0 1px rgba(47, 164, 231, 0.18);
}

#quick-controls-auto-expand.is-active:hover {
    color: #fff;
    background: rgba(35, 145, 207, 0.94);
}

.quick-controls-body {
    padding: 9px 12px 11px;
    max-height: 260px;
    opacity: 1;
    visibility: visible;
    transition:
        max-height 0.3s ease,
        opacity 0.3s ease,
        padding 0.3s ease,
        visibility 0s linear 0s;
}

.quick-controls-window.is-collapsed .quick-controls-body {
    display: none;
}

.quick-controls-window.auto-expand:hover .quick-controls-body,
.quick-controls-window.auto-expand:focus-within .quick-controls-body,
.quick-controls-window.auto-expand.is-dragging .quick-controls-body {
    display: block;
    max-height: 260px;
    padding-top: 9px;
    padding-bottom: 11px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        max-height 0.3s ease,
        opacity 0.3s ease,
        padding 0.3s ease,
        visibility 0s linear 0s;
}

.quick-controls-window.auto-expand.is-collapsed .quick-controls-body {
    display: block;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        max-height 1s ease,
        opacity 1s ease,
        padding 1s ease,
        visibility 0s linear 1s;
}

.quick-controls-window.auto-expand.is-collapsed:hover .quick-controls-body,
.quick-controls-window.auto-expand.is-collapsed:focus-within .quick-controls-body,
.quick-controls-window.auto-expand.is-collapsed.is-dragging .quick-controls-body {
    display: block;
    max-height: 260px;
    padding-top: 9px;
    padding-bottom: 11px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        max-height 0.3s ease,
        opacity 0.3s ease,
        padding 0.3s ease,
        visibility 0s linear 0s;
}

.quick-controls-window.auto-expand #quick-controls-collapse {
    opacity: 0.35;
    cursor: default;
}

.quick-controls-window.is-collapsed .quick-controls-header {
    border-bottom: 0;
}

.quick-controls-window.auto-expand:hover .quick-controls-header,
.quick-controls-window.auto-expand:focus-within .quick-controls-header,
.quick-controls-window.auto-expand.is-dragging .quick-controls-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.62);
}

.quick-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
    font-size: 0.88rem;
}

.quick-control-row label {
    margin: 0;
}

#quick-hop-connection-limit {
    width: 66px;
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 8px;
    color: #30475b;
    background: rgba(255, 255, 255, 0.46);
    box-shadow:
        inset 0 1px 2px rgba(31, 78, 121, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.55);
    outline: none;
}

#quick-hop-connection-limit:focus {
    border-color: rgba(47, 164, 231, 0.58);
    box-shadow:
        0 0 0 3px rgba(47, 164, 231, 0.12),
        inset 0 1px 2px rgba(31, 78, 121, 0.06);
}

.quick-control-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.quick-control-actions .btn {
    white-space: normal;
    line-height: 1.15;
    color: #176b9f;
    background: rgba(255, 255, 255, 0.40);
    border: 1px solid rgba(47, 164, 231, 0.12);
    border-radius: 9px;
    box-shadow:
        0 2px 5px rgba(31, 78, 121, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.quick-control-actions .btn:hover:not(:disabled) {
    color: #0f5f91;
    background: rgba(222, 242, 254, 0.68);
    border-color: rgba(47, 164, 231, 0.24);
}

.quick-control-actions .btn:disabled {
    color: rgba(48, 71, 91, 0.48);
    background: rgba(255, 255, 255, 0.24);
    opacity: 0.72;
}

@keyframes loading-pill-attention {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 3px 10px rgba(31, 78, 121, 0.14);
    }
    45% {
        transform: translateX(-50%) scale(1.045);
        box-shadow: 0 3px 16px rgba(47, 164, 231, 0.42);
    }
}

/* A small five-second progress ring.  Alternating animation names lets a
   repeated notification restart the countdown even when its text is the same. */
@property --notification-progress {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 100%;
}

.notification-countdown {
    width: 17px;
    height: 17px;
    display: inline-block;
    border-radius: 50%;
    background: conic-gradient(#2fa4e7 var(--notification-progress), #d8e3ec 0);
    -webkit-mask: radial-gradient(transparent 52%, #000 55%);
    mask: radial-gradient(transparent 52%, #000 55%);
}

.notification-refresh-a .notification-countdown {
    animation: notification-countdown-a 5s linear forwards;
}

.notification-refresh-b .notification-countdown {
    animation: notification-countdown-b 5s linear forwards;
}

/* Ordinary three-second success/failure toasts restart their animation each
   time Bootstrap toggles the visible .show class. */
.notification-duration-3.show .notification-countdown {
    animation: notification-countdown-short 3s linear forwards;
}

@keyframes notification-countdown-a {
    from { --notification-progress: 100%; }
    to { --notification-progress: 0%; }
}

@keyframes notification-countdown-b {
    from { --notification-progress: 100%; }
    to { --notification-progress: 0%; }
}

@keyframes notification-countdown-short {
    from { --notification-progress: 100%; }
    to { --notification-progress: 0%; }
}



.toggle-div {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    z-index: 101;
    width: 20px;
    height: 60px;

    background-color: rgba(255, 255, 255, 0.85);
    color: #2c3e50;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(44, 62, 80, 0.15);

    display: flex;
    justify-content: center;  /* horizontal */
    align-items: center;      /* vertical */

    cursor: pointer;
    border-radius: 4px;
    padding: 2px;
    transition: right 0.3s ease;
}


.toggle-div.closed {
    right: 0px;
}

.toggle-div.open {
    right: min(80vw, var(--settings-pane-width, 600px));
}



.settings_pane {
    position: absolute;
    top: 56px;
    right: 0;

    width: min(80vw, 600px);
    height: calc(100dvh - 56px);

    overflow-y: auto;
    box-sizing: border-box;

    border-left: 1px solid lightgrey;
    background: white;

    transition: opacity 0.3s ease, width 0.3s ease;
}
.settings-pane {
        height: calc(100dvh - 56px);
        width: min(80vw, var(--settings-pane-width, 600px));
        min-width: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        background: rgba(250, 252, 254, 0.955);
        backdrop-filter: blur(8px) saturate(115%);
        -webkit-backdrop-filter: blur(8px) saturate(115%);
        border-left-color: rgba(255, 255, 255, 0.72);
        box-shadow: -8px 0 24px rgba(31, 78, 121, 0.10);
}

/* Persistent graph-side control for the radius used by Shift-drag group
   movement.  Its right offset follows the resizable settings pane. */
.group-move-radius-control {
    position: fixed;
    right: calc(min(80vw, var(--settings-pane-width, 600px)) + 16px);
    bottom: 16px;
    z-index: 101;
    width: 20px;
    cursor: help;
    opacity: 0.42;
    transition: opacity 0.12s ease;
}

.group-move-radius-control:hover,
.group-move-radius-control:focus-within {
    opacity: 0.68;
}

.group-move-radius-control.is-adjusting {
    opacity: 1;
}

.group-move-radius-control::after {
    content: "Shift-drag selection radius";
    position: absolute;
    right: 28px;
    bottom: 0;
    width: max-content;
    padding: 4px 7px;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #c8d8e8;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
    font-size: 0.78em;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.group-move-radius-control:hover::after,
.group-move-radius-control:focus-within::after {
    opacity: 1;
}

/* Dash adds a focus outline to slider thumbs.  For this graph-overlay control
   it reads as an unwanted second ring while dragging. */
.group-move-radius-control .dash-slider-thumb:focus {
    outline: none;
    transform: none;
    box-shadow: 0 1px 3px 0 var(--Dash-Shading-Weak);
}

.group-move-radius-control-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* The value bubble is useful while adjusting, but should not remain a visual
   fixture on the graph once the pointer leaves the compact control. */
.group-move-radius-control .dash-slider-tooltip {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.08s ease !important;
}

/* This class is set by the pointer lifecycle, rather than relying on the
   slider library's focus state, which can linger after a drag. */
.group-move-radius-control.is-adjusting .dash-slider-tooltip {
    opacity: 0.82 !important;
    visibility: visible;
}

/* Keep the connection-limit explanation deliberately quiet: it is supporting
   information beside a compact control, not an error or modal prompt. */
.soft-info-tooltip {
    z-index: 10001;
    --bs-tooltip-bg: rgba(238, 241, 245, 0.96);
    --bs-tooltip-color: #4b5563;
    --bs-tooltip-opacity: 1;
    --bs-tooltip-max-width: 280px;
}

/* The two data-loading sections in Connect collapse independently.  A custom
   marker makes that affordance visible even in browsers that hide the native
   <details> disclosure triangle. */
.connect-section-disclosure > summary {
    list-style: none;
    font-size: 1em;
    line-height: 1.25;
}

.connect-section-disclosure > summary::-webkit-details-marker {
    display: none;
}

.connect-section-disclosure > summary::before {
    content: "▾";
    display: inline-block;
    width: 1.15em;
    color: #ff8800;
}

.connect-section-disclosure:not([open]) > summary::before {
    content: "▸";
}

/* Dash hides inactive DataTable filter placeholders until hover. Keep the
   three Custom CONSTRUCT filters visible so their purpose is obvious. */
#custom-construct-result-table .dash-filter input::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

.custom-construct-table-resize-container {
    display: flex;
    flex-direction: column;
    height: min(360px, 45vh);
    min-height: 160px;
    max-height: 70vh;
    margin-top: 6px;
}

.custom-construct-table-resize-container > #custom-construct-result-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.custom-construct-table-resize-handle {
    flex: 0 0 12px;
    position: relative;
    cursor: ns-resize;
    touch-action: none;
}

.custom-construct-table-resize-handle::after {
    content: "";
    position: absolute;
    left: 35%;
    right: 35%;
    top: 5px;
    height: 2px;
    border-radius: 2px;
    background: #8793a0;
}

.custom-construct-table-resize-handle:hover::after,
.custom-construct-table-resize-handle.is-resizing::after {
    background: #2fa4e7;
}

.soft-info-tooltip .tooltip-inner {
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* A non-blocking tutorial window that can remain open beside the graph. */
.tutorial-window {
    position: fixed;
    z-index: 1100;
    top: 50%;
    left: 50%;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 80px);
    overflow: auto;
    transform: translate(-50%, -50%);
    color: #3f4852;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #aebdcb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
}

.tutorial-window-hidden {
    display: none;
}

.tutorial-drag-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 10px 0 14px;
    color: white;
    background: #2fa4e7;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.tutorial-drag-handle.is-dragging {
    cursor: grabbing;
}

.tutorial-window-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 600;
}

.tutorial-window-title small {
    font-weight: 400;
    opacity: 0.82;
}

.tutorial-window-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: white;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.tutorial-window-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.tutorial-window-body {
    padding: 14px 16px;
    font-size: 0.9em;
    line-height: 1.4;
}

.tutorial-window-body p {
    margin: 0 0 12px;
}

.tutorial-window-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 16px 14px;
    border-top: 1px solid #e4e9ef;
}

@media (max-width: 480px) {
    .tutorial-window {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 72px);
    }

    .tutorial-window-title small {
        display: none;
    }
}

.legend-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.legend-action-buttons > .btn {
    width: 100%;
}

/* Keep the long Custom CONSTRUCT result list visibly scrollable on macOS and
   browsers that otherwise hide inactive scrollbars. */
#custom-construct-result-table {
    scrollbar-width: auto;
    scrollbar-color: #2fa4e7 #e8f0f7;
}

#custom-construct-result-table::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#custom-construct-result-table::-webkit-scrollbar-track {
    background: #e8f0f7;
}

#custom-construct-result-table::-webkit-scrollbar-thumb {
    background: #2fa4e7;
    border: 3px solid #e8f0f7;
    border-radius: 8px;
}

/* Query result tables are read-only: allow ordinary browser text selection
   so complete IRIs and literal values can be copied from individual cells. */
#custom-construct-result-table .dash-cell-value,
#sparql-debug-table .dash-cell-value,
#endpoint-types-table .dash-cell-value {
    -webkit-user-select: text !important;
    user-select: text !important;
    cursor: text;
}

@media (max-width: 480px) {
    .legend-action-buttons {
        grid-template-columns: 1fr;
    }
}

.settings-pane-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -6px;
    width: 12px;
    cursor: col-resize;
    z-index: 102;
}

.settings-pane-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5px;
    width: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.settings-pane-resize-handle:hover::after,
.settings-pane.resizing .settings-pane-resize-handle::after {
    background: rgba(44, 62, 80, 0.4);
}

body.settings-pane-resizing {
    cursor: col-resize;
    user-select: none;
}

/* Dash's react-select menu must sit above the scrollable panel contents. */
.settings-pane .Select-menu-outer {
    z-index: 10030 !important;
}


@media (max-width: 768px) {


    .toggle-div.open {
        right: min(80vw, var(--settings-pane-width, 600px));
            /* right: calc(min(80vw, 400px)); */
    }

    .settings-pane {
        height: calc(100dvh - 56px);
        width: min(80vw, var(--settings-pane-width, 600px));
    }

    .group-move-radius-control {
        right: calc(min(80vw, var(--settings-pane-width, 600px)) + 10px);
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .toggle-div.closed {
        right: 0px;
    }



    .toggle-switch {
    position: fixed;        /* use fixed instead of absolute */
    left: 33px;           /* distance from the right edge of the viewport */
    z-index: 101;            /* stack on top */
    padding: 2px;           /* internal spacing */
    border-radius: 5px;     /* rounded corners */
    }

    .details-toast {
        position: fixed;
        top: 60px;
        left: 50%;                  /* center horizontally */
        transform: translateX(-50%);
        width: calc(100% - 8px);    /* 4px padding each side */
        max-width: 400px;            /* cap width like desktop */
    }

    .blank-node-warning-toast,
    .load-limit-warning-toast,
    .type-node-warning-toast {
        top: 470px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 8px);
        max-width: 400px;
    }
}


.rc-slider-dot-active {
    border-color: #5f6f85;       /* active dot border */
    background-color: red;   /* active dot fill */
}


.rc-slider-dot {
    border-color: #a8c6ff;       /* inactive dot border */
    background-color: red;   /* fill of inactive dot */
}
