﻿#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(20px);
    z-index: 999;
}

    #backToTop.show {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    #backToTop:hover {
        background: #555;
    }

/* Overlay container */
.loading-overlay {
    position: fixed; /* or absolute if used inside a component */
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    /*backdrop-filter: blur(2px);*/
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9999;
}

    /* Visible state */
    .loading-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


.loading-container {
    display: flex;
    align-items: center;
    gap: 8px; /* space between spinner and text */
}

.loading {
    width: 20px;
    height: 20px;
    /*border: 5px solid rgba(255, 255, 255, 0.3);*/
    border: 5px solid var(--breadcrumb-hover-bg);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}





.login-container {
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
    padding: 1rem;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: system-ui, sans-serif;
}
    .login-container .title {
        font-weight: 700;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 0.5rem;
        text-align: center;
    }


.form-group {
    margin-bottom: 1rem;
}

.title-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.user-input {
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

    .user-input:focus {
        border-color: #0078d4;
        outline: none;
    }

.action-button {
    padding: 0.35rem .75rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    background: var(--primaryButtonBg);
    color: var(--primaryButtonText);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}
    .action-button.secondary {
        background: var(--secondaryButtonBg);
        color: var(--secondaryButtonText);
    }
        .action-button.secondary:hover {
            background: var(--secondaryButtonBgHover);
        }

    .action-button:hover {
        background: var(--primaryButtonBgHover);
    }
    .hover-button:hover {
        background: var(--primaryButtonBgHover);
    }

.error {
    color: #d93025;
    font-size: 0.85rem;
}
.required-field {
    color: var(--error-text);
    font-weight: bold;
}

    .required-field.nowrap {
        white-space: nowrap;
    }

.success {
    color: var(--success-text);
}


.hidden {
    display: none;
}

a {
    color: var(--main-anchors);
    text-decoration: none
}

    a:visited {
        color: var(--main-anchors-visited);
        text-decoration: none
    }

    a:hover {
        color: var(--main-anchors-hover);
        text-decoration: underline
    }

    a.white-link {
        color: #ffffff;
        text-decoration: none
    }

        a.white-link:visited {
            color: #ffffff;
            text-decoration: none
        }

        a.white-link:hover {
            color: #d6e3ff;
            text-decoration: underline
        }
.link-button {
    color: var(--main-anchors);
    background: none !important;
    border: none;
    padding: 0 !important;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

    .link-button:hover {
        color: var(--main-anchors-hover);
        text-decoration: underline;
    }

    .link-button.white {
        color: var(--lightText);
    }

        .link-button.white:hover {
            color: #E6F2FF;
            text-decoration: underline;
        }

.under-line-row {
    border-bottom: var(--border-color) 1px solid;
}

    .under-line-row.white {
        border-bottom: #ffffff 1px solid;
    }

    .under-line-row.bottom {
        border-bottom: var(--border-color) 1px solid;
    }

        .under-line-row.bottom.thick {
            border-bottom: var(--border-color) 2px solid;
        }

        .under-line-row.bottom.three {
            border-bottom: var(--border-color) 3px solid;
        }

    .under-line-row.top {
        border-bottom: 0px;
        border-top: var(--border-color) 1px solid;
    }

        .under-line-row.top.thick {
            border-bottom: 0px;
            border-top: var(--border-color) 2px solid;
        }

        .under-line-row.top.three {
            border-bottom: 0px;
            border-top: var(--containerHeaderBottom) 3px solid;
        }



.breadcrumb-bar {
    background: var(--breadcrumb-background);
    padding: 0.3rem .5rem;
    box-shadow: var(--breadcrumb-shadow);
    font-family: system-ui, sans-serif;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

    .breadcrumb-list li {
        display: flex;
        align-items: center;
        font-size: 0.95rem;
        color: var(--breadcrumb-crumb-color);
    }

        .breadcrumb-list li:not(:last-child)::after {
            content: "›";
            margin-left: 0.5rem;
            color: var(--breadcrumb-crumb-color);
            font-weight: 500;
        }

    .breadcrumb-list a {
        text-decoration: none;
        color: var(--breadcrumb-crumb-color);
        padding: 0.1rem 0.4rem;
        border-radius: 4px;
        transition: background 0.2s, color 0.2s;
    }

        .breadcrumb-list a:hover,
        .breadcrumb-list a:focus {
            background: var(--breadcrumb-hover-bg);
            color: var(--breadcrumb-crumb-active);
        }

    .breadcrumb-list li[aria-current="page"] {
        font-weight: 600;
        color: var(--breadcrumb-crumb-active);
    }


.collapse-panel {
    border-radius: 8px;
    background: var(--collapse-panel-bg);
    box-shadow: var(--collapse-panel-shadow);
    overflow: hidden;
    font-family: system-ui, sans-serif;
}

/* Header */
.collapse-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: .5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--collapse-panel-text);
    transition: background 0.2s;
}
    .collapse-header.smaller {
        padding: .35rem .25rem;
    }
    .collapse-header:hover,
    .collapse-header:focus-visible {
        background: var(--collapse-panel-hover);
    }

/* Icon rotation 
.collapse-icon {
    display: inline-block;
    transition: transform 0.25s ease;
}*/

/* SVG icon */
.collapse-icon {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.collapse-header[aria-expanded="true"] .collapse-icon {
    transform: rotate(90deg);
}

/* Content animation container */
.collapse-content {
    border-top: 1px solid var(--border-color);
    padding: .5rem;
    color: var(--collapse-panel-text);
    animation: slideDown 0.25s ease forwards;
}

/* Keyframes for smooth reveal */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout for title + description */
.collapse-header-text {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 1rem;
}

/* Description styling */
.collapse-desc {
    font-size: 0.85rem;
    color: var(--collapse-panel-desc);
    transition: opacity 0.2s ease;
    font-weight: normal;
}

/* Hide description when expanded */
.collapse-header[aria-expanded="true"] .collapse-desc {
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}


.action-tile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .45rem;
    border-radius: 10px;
    border: none;
    text-align: left;
    cursor: pointer;
    background: var(--action-tile-bg);
    color: var(--action-tile-text);
    box-shadow: var(--action-tile-box-shadow);
    text-decoration: none; /* for <a> */
    font-family: system-ui, sans-serif;
    transition: background 0.2s, box-shadow 0.2s;
}
    .action-tile.small {
        width: auto;
    }

    .action-tile:hover {
        background: var(--action-tile-hover);
    }

    .action-tile:focus-visible {
        outline: 2px solid var(--action-tile-focus-ring);
        outline-offset: 3px;
    }

/* PNG icon */
.action-tile-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.action-tile:hover .action-tile-icon {
    transform: translateX(3px);
}

/* Text block */
.action-tile-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.action-tile-title {
    font-size: 1rem;
    font-weight: 600;
}
.action-tile-separator {
    height: 1px;
    width: 100%;
    background: var(--action-tile-separator);
    margin: 0.15rem 0;
}
.action-tile-desc {
    font-size: 0.85rem;
    color: var(--action-tile-desc);
}



.action-tile-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: var(--action-tile-bg);
    color: var(--action-tile-text);
    box-shadow: var(--action-tile-box-shadow);
    font-family: system-ui, sans-serif;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s ease;
    /* NEW: allow tiles to sit side-by-side */
    width: auto;
     min-width: 120px; /* optional */
     /*max-width: 160px;  optional */
}
    .action-tile-vertical.autosize {
        min-width: revert;
    }

    .action-tile-vertical:hover {
        background: var(--action-tile-hover);
        transform: translateY(-2px);
    }

    .action-tile-vertical:focus-visible {
        outline: 2px solid var(--action-tile-focus-ring);
        outline-offset: 3px;
    }

/* PNG icon */
.action-tile-vertical-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
    .action-tile-vertical-icon.small {
        width: 16px;
        height: 16px;
    }
.action-tile-vertical:hover .action-tile-vertical-icon {
    transform: scale(1.05);
}

/* Label */
.action-tile-vertical-label {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: var(--action-tile-text);
}
.action-tile-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.simple-flex {
    display: flex;
    align-items: center;
    gap: .2rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    display: flex; /* NEW */
    align-items: stretch; /* NEW */
}

.search-input {
    flex: 1;
    width: 100%;
    padding: 10px 40px 10px 14px;
    font-size: 15px;
    border-radius: 8px 0 0 8px;
    border: 1px solid var(--search-border);
    background: var(--search-bg);
    color: var(--search-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px var(--search-shadow);
}

    .search-input::placeholder {
        color: var(--search-placeholder);
    }

    .search-input:focus {
        border-color: var(--search-focus-border);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--search-focus-border) 30%, transparent);
    }

.search-btn {
    min-width:44px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--search-border);
    border-left: none; /* merge with input */
    background: var(--search-bg);
    border-radius: 0 8px 8px 0; /* rounded only on right side */
    cursor: pointer;
    transition: background-color 0.2s ease;
}
    .search-btn:hover {
        background-color: color-mix(in srgb, var(--search-icon-hover) 15%, transparent);
    }

    .search-btn .icon {
        width: 20px;
        height: 20px;
        fill: var(--search-icon);
        pointer-events: none;
        transition: fill 0.2s ease;
    }
    .search-btn:hover .icon {
        fill: var(--search-icon-hover);
    }
    .search-btn span {
        padding-left: 5px;
        padding-right: 10px;
        color: var(--search-text);
    }

.clear-btn {
    position: absolute;
    right: 55px;
    top: 25%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    color: var(--search-text);
}
.search-wrapper.has-text .clear-btn {
    opacity: 1;
    pointer-events: auto;
}

.ui-field {
    appearance: none;
    width: 100%;
    padding: var(--ui-padding-y) var(--ui-padding-x);
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    color: var(--ui-text);
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: var(--ui-shadow-inset);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .ui-field:hover {
        border-color: var(--ui-border-hover);
    }

    .ui-field:focus {
        outline: none;
        border-color: var(--ui-border-focus);
        box-shadow: 0 0 0 3px rgba(74, 139, 255, 0.25), var(--ui-shadow-inset);
    }

    /* Remove the ugly blue glow on Firefox */
    .ui-field:-moz-focusring {
        outline: none;
    }


.ui-select {
    background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 1px), calc(100% - 13px) calc(50% - 1px);
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2rem;
    cursor: pointer;
}






/* Root theme variables */
.tree,
.tree ul {
    list-style: none;
    margin: 0;
    padding-left: 0.75rem; /* GitHub indentation */
}

.tree {
    font-size: 0.875rem;
    color: var(--tree-text);
}

    /* Each row */
    .tree li {
        position: relative;
        padding: 2px 0 2px 0.25rem;
        border-left: 1px solid var(--tree-border);
    }

    /* Remove border for top-level */
    .tree > li {
        border-left: none;
    }

    /* Summary row */
    .tree summary {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 2px 4px;
        border-radius: 4px;
    }

        /* Hover row */
        .tree summary:hover,
        .tree li:hover > summary {
            background: var(--tree-bg-hover);
        }

        /* GitHub-style disclosure arrow */
        .tree summary::before {
            content: "▷";
            font-size: 0.8rem;
            color: var(--tree-accent);
            display: inline-block;
            transform: rotate(0deg);
            transition: transform 0.15s ease;
            margin-right: 4px;
        }

/* Rotate arrow when open */
details[open] > summary::before {
    transform: rotate(90deg);
}

/* Child UL spacing */
.tree ul {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}


.node {
    display: block;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}

    .node:hover {
        background: var(--tree-bg-hover);
    }

    .node.selected {
        background: var(--tree-bg-hover);
        outline: 1px solid var(--tree-border);
    }


.ui-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    background: var(--toolbar-bg, #f7f7f7);
    border-bottom: 1px solid var(--toolbar-border, #ddd);
}

.tb-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .75rem;
    background: var(--toolbar-btn-bg, #fff);
    border: 1px solid var(--toolbar-btn-border, #ccc);
    border-radius: .4rem;
    cursor: pointer;
    font-size: .9rem;
    transition: background .15s, border-color .15s;
    color: var(--toolbar-btn-text, #fff);
}

    .tb-btn.noborder {
        border: 1px solid var(--toolbar-btn-bg, #fff);
    }

    .tb-btn img {
        width: 17px;
    }

    .tb-btn.noborder {
        border: none;
    }

    .tb-btn:hover {
        background: var(--toolbar-btn-hover-bg, #f0f0f0);
        border-color: var(--toolbar-btn-hover-border, #bbb);
    }

    .tb-btn.selected {
        background: var(--toolbar-btn-hover-bg, #f0f0f0);
        border-color: var(--toolbar-btn-hover-border, #bbb);
    }

    .tb-btn:active {
        background: var(--btn-active-bg, #e5e5e5);
    }

.tb-icon {
    color: var(--toolbar-btn-text, #fff);
    font-size: 1.1rem;
    line-height: 1;
}

.tb-label {
    color: var(--toolbar-btn-text, #fff);
    white-space: nowrap;
}

.tb-separator {
    width: 1px;
    height: 1.5rem;
    background: var(--toolbar-border, #ddd);
    margin: 0 .25rem;
}

.multi-item-div {
    display: flex;
    align-items: center;
    gap: 6px;
    /*    border: 1px solid var(--toolbar-btn-border);*/
    border-radius: 4px;
    white-space: nowrap;
}

    .multi-item-div span {
        display: flex;
        align-items: center;
        padding: 0px 0px 0px 5px;
        white-space: nowrap;
        border: 1px solid var(--toolbar-btn-border);
        background: var(--toolbar-btn-bg, #fff);
        border-radius: .4rem;
    }

.chevron::before {
    border-style: solid;
    border-width: 0.1em 0.1em 0 0;
    content: '';
    display: inline-block;
    height: 0.45em;
    left: 0.15em;
    position: relative;
    top: 0.15em;
    transform: rotate(-45deg);
    vertical-align: central;
    width: 0.45em;
    transition: all .3s ease;
}

.chevron.right:before {
    /*left: 0;*/
    top: -.1em;
    transform: rotate(45deg);
}

.chevron.bottom:before {
    top: -.2em;
    transform: rotate(135deg);
    transition: all .3s ease;
}

.chevron.left:before {
    /*left: 0.25em;*/
    transform: rotate(-135deg);
}


.grid-field-name {
    color: var(--action-tile-desc);
}

    .grid-field-name.nowrap {
        white-space: nowrap;
    }