﻿html {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    height: 100%;
    margin: 0;
}

body {
    background-color: #F8F5EE;
    height: 100%;
    margin: 0;
    overflow: visible;
}

/* min-height, not height: a fixed 100vh box cannot grow, so a page longer than the viewport (the query
   task list, once there are a few registrations) overflowed it while the footer stayed pinned inside the
   box - printing the copyright line straight over the content. Growing the box keeps the footer after the
   content, and .main's flex:1 still holds it at the bottom of the window on a short page. */
#app {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    flex-direction: column;
    overflow: visible;
    background-color: #F8F5EE;
}

hr {
    border: 1px solid #ccc;
    margin: 5px 0;
}

h1 {
    font-size: 20px;
    text-align: center;
}

h1:focus {
    outline: none;
}

h3 {
    font-size: 16px;
    text-align: center;
}

p {
    font-size: 14px;
    text-align: center;
}

a, .btn-link {
    color: #0071c1;
}

.btn div {
    font-size:x-small;
    width: 80px;
}

.btn.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn.btn-primary.nav-addin {
    padding: 0;
}

/* Takes the slack inside #app so the footer sits at the bottom of a short page, without forcing a
   viewport-tall block that a longer page then has to overflow. */
.main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.logo {
    width: 60px;
    height: auto; /* Maintains aspect ratio */
}

.hyperlink {
    font-weight: bold;
    color: #2A5DB0;
    text-decoration: none;
}

header {
    background-size: cover;
    width: 100vw;
    height: 10rem; /* Header height */
    flex-direction: column;
}

    header img {
        width: 25%;
        max-width: 150px;
    }

footer {
    margin-top: 2em;
    flex-direction: column;
    font-weight: bolder;
    font-size: small;
    position: relative;
    left: 0;
    bottom: 0;
    width: 100vw; /* Full width */
    min-height: 5rem; /* Footer height */
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

section.samples {
    margin-top: 20px;
}

    section.samples .ms-Button, section.setup .ms-Button {
        display: block;
        margin-bottom: 5px;
        margin-left: 20px;
        min-width: 80px;
    }

.horizontal-stack {
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center; /* Center items horizontally */
    align-items: flex-start; /* Align items to the top */
    gap: 5vh; /* Add space between items */
    padding-top: 10px; /* Push items slightly off the top */
    box-sizing: border-box; /* Ensure padding doesn't affect total height */
}


.horizontal-stack > * {
    display: flex;
}

.dropdown-container {
    position: relative;
    overflow: visible;
}


/* FavouriteDropdown - a hand rolled combo box over Bootstrap 5, see Blazor.Components/FavouriteDropdown.razor */

.combo-box {
    width: 300px;
}

.combo-input {
    width: 100%;
}

.combo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 60vh;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.combo-item {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 0.25rem 0.75rem;
}

    .combo-item:hover {
        background-color: #f8f9fa;
    }

.combo-item-default {
    background-color: lightgoldenrodyellow;
    color: black;
}

.combo-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combo-item-star {
    color: lightgray;
    cursor: pointer;
}

.combo-item-star-on {
    color: green;
}

.combo-item-delete {
    color: darkred;
    cursor: pointer;
}
/*
    Versions are the first thing support asks for, so they get a panel of their own rather than being
    lost among the body copy. The left edge uses the LemonEdge yellow so the block reads as a callout
    in the narrow task pane without competing with the hyperlinks.
*/
.version-panel {
    max-width: 260px;
    margin: 8px auto;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #E4DFD2;
    border-left: 3px solid #FFE500;
    border-radius: 4px;
}

.version-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.version-label {
    color: #6B6455;
}

/* Tabular figures so the two numbers line up under each other rather than drifting. */
.version-value {
    font-weight: 600;
    color: #1F1B13;
    font-variant-numeric: tabular-nums;
}

.version-value-muted {
    font-weight: 400;
    font-style: italic;
    color: #8A8271;
}

/* Query task registrations panel (QueryTasks.razor). Laid out for the task pane's narrow column:
   one card per registered cell rather than a table that would need horizontal scrolling. */
.registration-panel {
    margin-top: 20px;
}

.registration-title {
    font-size: 18px;
    font-weight: 600;
    color: #1F1B13;
    margin-bottom: 4px;
}

.registration-count,
.registration-empty {
    font-size: 13px;
    color: #6B6455;
}

.registration-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.registration-item {
    margin: 8px 0;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #E4DFD2;
    border-left: 3px solid #FFE500;
    border-radius: 4px;
}

.registration-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

/* The query name leads the card - it is what a user scans the list for. The cell address is how they
   locate it afterwards, so it trails as secondary detail. */
.registration-query {
    font-weight: 600;
    color: #1F1B13;
}

.registration-address {
    font-size: 12px;
    color: #6B6455;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.registration-detail {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.registration-detail dt {
    color: #6B6455;
    font-weight: 400;
}

.registration-detail dd {
    margin: 0;
    color: #1F1B13;
    overflow-wrap: anywhere;
}

.registration-muted {
    font-style: italic;
    color: #8A8271;
}

/* Arguments are raw json, so they stay monospaced and are allowed to wrap mid-token. */
.registration-arguments {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* Task pane tabs (NavMenu.razor). The pane hosts every page of the add-in - the shared runtime allows
   only one task pane source - so these switch between them. Defined here rather than in
   NavMenu.razor.css because index.html links only this stylesheet: Blazor's scoped css bundle
   (LemonEdge.ExcelAddIn.styles.css) is not referenced, so .razor.css files do not load. */
.pane-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #E4DFD2;
    margin-bottom: 12px;
}

.pane-tab {
    padding: 6px 12px;
    font-size: 13px;
    color: #6B6455;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px; /* sit on the strip's border so the active tab can break through it */
}

.pane-tab:hover {
    color: #1F1B13;
    background-color: #F7F5F0;
}

.pane-tab.active {
    color: #1F1B13;
    font-weight: 600;
    background-color: #fff;
    border-color: #E4DFD2;
    border-bottom: 1px solid #fff;
    border-top: 3px solid #FFE500;
}

/* Action button in the task pane panels (QueryTasks.razor). */
.pane-button {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1F1B13;
    background-color: #FFE500;
    border: 1px solid #E4DFD2;
    border-radius: 4px;
    cursor: pointer;
}

.pane-button:hover:enabled {
    background-color: #FFEE55;
}

.pane-button:disabled {
    color: #8A8271;
    background-color: #F2F0EA;
    cursor: default;
}

/* Status line and progress for a registered query task (QueryTasks.razor). */
.registration-status {
    display: inline-block;
    margin-bottom: 6px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
}

.registration-status-idle {
    color: #6B6455;
    background-color: #F2F0EA;
    border-color: #E4DFD2;
}

.registration-status-active {
    color: #1F1B13;
    background-color: #FFF7B8;
    border-color: #FFE500;
}

.registration-status-done {
    color: #1C5B2E;
    background-color: #E6F4EA;
    border-color: #BEE0C8;
}

.registration-status-stale {
    color: #7A4B00;
    background-color: #FDF0DC;
    border-color: #EFD3A6;
}

.registration-status-failed {
    color: #8A1C1C;
    background-color: #FBE9E9;
    border-color: #EEC2C2;
}

.registration-progress {
    height: 6px;
    margin-bottom: 2px;
    background-color: #F2F0EA;
    border: 1px solid #E4DFD2;
    border-radius: 3px;
    overflow: hidden;
}

.registration-progress-bar {
    height: 100%;
    background-color: #FFE500;
}

.registration-progress-label {
    margin-bottom: 6px;
    font-size: 12px;
    color: #6B6455;
    font-variant-numeric: tabular-nums;
}

.registration-failure {
    margin: 0 0 6px;
    font-size: 12px;
    color: #8A1C1C;
}

/* Status line with its Run/Cancel button (QueryTasks.razor). */
.registration-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.registration-status-row .registration-status {
    margin-bottom: 0;
}

.pane-button-small {
    margin-bottom: 0;
    padding: 2px 10px;
    font-size: 12px;
}

.pane-button-cancel {
    color: #8A1C1C;
    background-color: #FBE9E9;
    border-color: #EEC2C2;
}

.pane-button-cancel:hover:enabled {
    background-color: #F7DADA;
}

/* Selection checkbox and the panel's action row (QueryTasks.razor). */
.registration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.registration-select {
    flex: none;
    margin: 0 2px 0 0;
    accent-color: #FFE500;
    cursor: pointer;
}

/* "Out of date" note under the status badge (QueryTasks.razor). */
.registration-stale {
    margin: 0 0 6px;
    font-size: 12px;
    color: #7A4B00;
}

/* The collapsed card's heading doubles as the expand/collapse control (QueryTasks.razor). */
.registration-toggle {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding: 0;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.registration-chevron {
    flex: none;
    width: 10px;
    color: #8A8271;
    font-size: 11px;
    line-height: 1;
}

/* The name takes the room and truncates; the address keeps its full width beside it, since a half
   shown cell reference is no use for finding anything. */
.registration-toggle .registration-query {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.registration-toggle .registration-address {
    flex: none;
}

/* Buttons that navigate the sheet rather than changing the panel (QueryTasks.razor). Styled as links so
   they read as "go here", not as another action alongside Run. */
.registration-link {
    padding: 0;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.registration-link:hover {
    color: #1F1B13;
    text-decoration-style: solid;
}

/* Group headings in the query task list (QueryTasks.razor). */
.registration-group {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 14px 0 4px;
    padding-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #6B6455;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #E4DFD2;
}

.registration-group-count {
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
