html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    background-image: url(../images/mesorepo.png);
    width: 180px;
    height: 24px;
    background-position: left;
    background-size: contain;
    background-repeat: no-repeat;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

/* ============================================
   Spotlight Search Overlay (Ctrl+K)
   ============================================ */

.spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
}

.spotlight-popup {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.3);
    width: 620px;
    max-width: 90vw;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: spotlight-appear 0.15s ease-out;
}

@media (min-width: 1400px) {
    .spotlight-popup {
        width: 750px;
    }
}

@media (min-width: 1800px) {
    .spotlight-popup {
        width: 900px;
    }
}

@keyframes spotlight-appear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    gap: 10px;
}

.spotlight-search-icon {
    color: #9ca3af;
    flex-shrink: 0;
}

.spotlight-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: #1f2937;
    background: transparent;
}

.spotlight-input::placeholder {
    color: #9ca3af;
}

.spotlight-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spotlight-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes spotlight-spin {
    to { transform: rotate(360deg); }
}

.spotlight-results {
    overflow-y: auto;
    padding: 6px 0;
    max-height: calc(60vh - 60px);
}

.spotlight-group-separator {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 4px;
}

.spotlight-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
}

.spotlight-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.spotlight-category-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.spotlight-result-item {
    display: flex;
    align-items: center;
    padding: 7px 16px 7px 20px;
    cursor: pointer;
    transition: background-color 0.1s;
    gap: 10px;
    border-left: 3px solid transparent;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: #f8fafc;
}

.spotlight-result-item.selected {
    background: #f0f4ff;
}

.spotlight-result-item:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    border-radius: 4px;
}

.spotlight-result-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.4;
}

.spotlight-result-text {
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category color themes */
.cat-table .spotlight-result-dot,
.spotlight-category-badge.cat-table { color: #2563eb; background: #eff6ff; }
.spotlight-result-item.cat-table.selected,
.spotlight-result-item.cat-table:hover { background: #eff6ff; border-left-color: #2563eb; }

.cat-column .spotlight-result-dot,
.spotlight-category-badge.cat-column { color: #0891b2; background: #ecfeff; }
.spotlight-result-item.cat-column.selected,
.spotlight-result-item.cat-column:hover { background: #ecfeff; border-left-color: #0891b2; }

.cat-version .spotlight-result-dot,
.spotlight-category-badge.cat-version { color: #7c3aed; background: #f5f3ff; }
.spotlight-result-item.cat-version.selected,
.spotlight-result-item.cat-version:hover { background: #f5f3ff; border-left-color: #7c3aed; }

.cat-kb .spotlight-result-dot,
.spotlight-category-badge.cat-kb { color: #d97706; background: #fffbeb; }
.spotlight-result-item.cat-kb.selected,
.spotlight-result-item.cat-kb:hover { background: #fffbeb; border-left-color: #d97706; }

.cat-whitepaper .spotlight-result-dot,
.spotlight-category-badge.cat-whitepaper { color: #059669; background: #ecfdf5; }
.spotlight-result-item.cat-whitepaper.selected,
.spotlight-result-item.cat-whitepaper:hover { background: #ecfdf5; border-left-color: #059669; }

.cat-help .spotlight-result-dot,
.spotlight-category-badge.cat-help { color: #dc2626; background: #fef2f2; }
.spotlight-result-item.cat-help.selected,
.spotlight-result-item.cat-help:hover { background: #fef2f2; border-left-color: #dc2626; }

.cat-ticket .spotlight-result-dot,
.spotlight-category-badge.cat-ticket { color: #db2777; background: #fdf2f8; }
.spotlight-result-item.cat-ticket.selected,
.spotlight-result-item.cat-ticket:hover { background: #fdf2f8; border-left-color: #db2777; }

.cat-default .spotlight-result-dot,
.spotlight-category-badge.cat-default { color: #6b7280; background: #f3f4f6; }
.spotlight-result-item.cat-default.selected,
.spotlight-result-item.cat-default:hover { background: #f3f4f6; border-left-color: #6b7280; }

.spotlight-result-total {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.spotlight-highlight {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.spotlight-more-hint {
    padding: 10px 16px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    font-style: italic;
    border-top: 1px solid #f3f4f6;
}

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    font-size: 11px;
    color: #9ca3af;
}

.spotlight-footer-key {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spotlight-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    min-width: 20px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid #d1d5db;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.4;
    color: #374151;
    box-shadow: 0 1px 0 #d1d5db;
}

.spotlight-empty {
    padding: 24px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.spotlight-hint {
    font-style: italic;
    font-size: 13px;
}

.spotlight-ai-category {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 10px;
    color: #7c3aed;
}

/* Ctrl+K hint pill — fixed bottom-right, avoids XAF toolbar overlap */
.spotlight-hint-pill {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.85);
    border: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.spotlight-hint-pill:hover {
    background: #fff;
    border-color: #9ca3af;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.spotlight-hint-pill kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    font-family: inherit;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

/* ============================================
   Custom Reconnect UI
   ============================================ */

.components-reconnect-hide > .reconnect-overlay {
    display: none;
}

.components-reconnect-show > .reconnect-overlay,
.components-reconnect-rejected > .reconnect-overlay,
.components-reconnect-failed > .reconnect-overlay {
    display: flex;
}

.reconnect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
}

.reconnect-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    padding: 32px 40px;
    text-align: center;
    max-width: 380px;
    width: 90vw;
    animation: spotlight-appear 0.2s ease-out;
}

.reconnect-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spotlight-spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

.reconnect-message {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.reconnect-retry {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: #3b82f6;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 8px;
}

.reconnect-retry:hover {
    background: #2563eb;
}

.reconnect-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.components-reconnect-rejected > .reconnect-overlay .reconnect-spinner,
.components-reconnect-failed > .reconnect-overlay .reconnect-spinner {
    border-top-color: #ef4444;
    animation: none;
}

.components-reconnect-rejected > .reconnect-overlay .reconnect-message,
.components-reconnect-failed > .reconnect-overlay .reconnect-message {
    color: #dc2626;
}
