﻿/* Tabs container */
.fieldgroup-tabs {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    /* move horizontal scrolling to an inner scroller to not break sticky */
    overflow: visible;
    padding: 6px 8px 0 8px;
    border-bottom: 1px solid var(--ia-border,#e5e5e5);
    margin-bottom: 12px;
/*    position: sticky;*/
    /* stick just below the main navbar; override via CSS variable if needed */
    top: var(--app-navbar-height,64px);
    z-index: 1000;
    background: var(--ia-surface, #fff);
    backdrop-filter: saturate(180%) blur(6px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* optional inner scroller if long tabs */
.fieldgroup-tabs::after { content: ""; }
.fieldgroup-tabs .fieldgroup-tabs-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tab button */
.fieldgroup-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ia-tab-fg, #555);
    font-size: .92rem;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

    .fieldgroup-tab:hover {
        color: var(--ia-tab-fg-hover, #222);
        background: var(--ia-tab-bg-hover, #f6f7f9);
    }

    /* Active state (hook for future logic) */
    .fieldgroup-tab.active {
        color: var(--ia-tab-active-fg, #1a73e8);
        border-color: var(--ia-tab-active, #1a73e8);
        background: var(--ia-tab-active-bg, #eef4ff);
    }

    /* Reduce focus outline but keep accessibility */
    .fieldgroup-tab:focus-visible {
        outline: 2px solid var(--ia-focus, #7aa7ff);
        outline-offset: 2px;
    }
/* Floating Scroll-to-Top button */
.creator-scroll-top {
 position: fixed;
 right:16px;
 bottom:16px;
 width:40px;
 height:40px;
 border-radius:50%;
 border: none;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 background: #1a73e8;
 color: #fff;
 box-shadow:06px16px rgba(0,0,0,.15);
 cursor: pointer;
 z-index:1200;
 opacity: .9;
 transition: opacity .15s ease, transform .15s ease, background .2s ease;
}
.creator-scroll-top:hover { opacity:1; transform: translateY(-1px); background:#1564cf; }
.creator-scroll-top:active { transform: translateY(0); }
.creator-scroll-top:focus-visible { outline:2px solid #7aa7ff; outline-offset:2px; }

.location-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.location-btn {
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .location-btn:hover {
        background: #e6f0ff;
        transform: scale(1.08);
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    .location-btn:active {
        transform: scale(0.95);
    }
/* Formula dropdown (setting modal, HTML generated by settingModalRenderer.js): keep long text on one line, cut with an ellipsis */
.formula-dropdown-list {
    max-width: 100%;
    overflow-x: hidden;
}

    .formula-dropdown-list .category,
    .formula-dropdown-list .sub-category,
    .formula-dropdown-list .formula-descript {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

/* "?" hint next to Default Value in the setting modal (HTML generated by settingModalRenderer.js) */
.defaultValueHintBtn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    flex: 0 0 22px;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid #3498db;
    border-radius: 50%;
    background: #f7f9fa;
    color: #3498db;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .defaultValueHintBtn:hover {
        background: #e6f0ff;
    }

.defaultValueHint {
    border: 1px solid #e3e7e8;
    background: #f7f9fa;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #333;
}

    .defaultValueHint p {
        margin: 0 0 6px;
    }

    .defaultValueHint code {
        white-space: normal;
        word-break: break-word;
    }

/* Formula button row in the setting modal: scrolls sideways with < > arrows when the modal is narrow */
.formulaToolbar {
    align-items: center;
    min-width: 0;
}

.formulaToolbarScroll {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
}

    .formulaToolbarScroll > * {
        flex: 0 0 auto;
        white-space: nowrap;
    }

.formulaScrollBtn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    width: 24px;
    height: 36px;
    border: 1px solid #e3e7e8;
    border-radius: 6px;
    background: #f7f9fa;
    color: #3498db;
    cursor: pointer;
}

    .formulaScrollBtn:hover {
        background: #e6f0ff;
    }

/* Formula "Test" button (inside the textarea's bottom-right corner) and its parameter/result modal - js/formulaTest.js */
.dropdown.custom-class[data-test-enhanced] {
    position: relative;
}

.formulaTestBtn {
    position: absolute;
    right: 26px;
    padding: 2px 12px;
    border: 1px solid #3498db;
    border-radius: 6px;
    background: #fff;
    color: #3498db;
    cursor: pointer;
}

    .formulaTestBtn:hover {
        background: #e6f0ff;
    }

.formulaTestOverlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.formulaTestBox {
    width: min(640px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 16px;
    border-radius: 10px;
    background: #fff;
    color: #000;
    text-align: left;
}

.formulaTestTitle {
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.formulaTestFormula,
.formulaTestResult {
    margin: 0 0 8px;
    padding: 8px;
    max-height: 200px;
    overflow: auto;
    border-radius: 6px;
    background: #f7f9fa;
    white-space: pre-wrap;
    word-break: break-word;
}

.formulaTestOk {
    background: #e8f6ec;
    color: #1e6b34;
}

.formulaTestError {
    background: #fdecea;
    color: #b3261e;
}

.formulaTestParam {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

    .formulaTestParam input {
        flex: 1 1 0;
        min-width: 0;
        height: 34px;
        padding: 0 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
    }

.formulaTestAddParam {
    margin-bottom: 8px;
    border: none;
    background: none;
    color: #3498db;
}

.formulaTestActions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

    .formulaTestActions button {
        padding: 4px 16px;
        border: 1px solid #3498db;
        border-radius: 6px;
        background: #fff;
        color: #3498db;
    }

    .formulaTestActions .formulaTestRun {
        background: #3498db;
        color: #fff;
    }
