/*
 * Linkilo KB — embeddable launcher widget.
 *
 * The floating "?" bubble that opens a search/browse panel on any page.
 * Z-index very high so it sits over theme content.
 */
:root {
    --kb-launcher-primary: #177EE5;
    --kb-launcher-primary-hover: #135bb5;
    --kb-launcher-accent: #1E294D;
    --kb-launcher-soft: #eff6ff;
}

.lkb-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- The floating bubble --- */
.lkb-launcher__bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--kb-launcher-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(23, 126, 229, 0.5),
                0 4px 8px -2px rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 200ms cubic-bezier(.34, 1.56, .64, 1),
                box-shadow 200ms ease;
    font-family: inherit;
}
.lkb-launcher__bubble:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 14px 30px -5px rgba(23, 126, 229, 0.6),
                0 6px 12px -2px rgba(15, 23, 42, 0.12);
}
.lkb-launcher__bubble:active {
    transform: scale(0.97);
}
.lkb-launcher__bubble-icon {
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    transition: opacity 200ms ease, transform 200ms ease;
}
.lkb-launcher__bubble-icon--close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
    font-size: 36px;
}
.lkb-launcher.is-open .lkb-launcher__bubble-icon:first-child {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}
.lkb-launcher.is-open .lkb-launcher__bubble-icon--close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* --- The panel --- */
.lkb-launcher__panel {
    position: absolute;
    bottom: calc(100% + 16px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    max-height: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.25),
                0 8px 20px -4px rgba(15, 23, 42, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.34, 1.56, .64, 1);
}
.lkb-launcher.is-open .lkb-launcher__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Panel header */
.lkb-launcher__header {
    background: linear-gradient(135deg, var(--kb-launcher-primary) 0%, var(--kb-launcher-accent) 100%);
    padding: 22px 22px 18px;
    color: #fff;
}
.lkb-launcher__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.lkb-launcher__tagline {
    margin: 0 0 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}
.lkb-launcher__search {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}
.lkb-launcher__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #64748b;
}
.lkb-launcher__input {
    width: 100%;
    padding: 11px 14px 11px 36px;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: transparent;
}

/* Body */
.lkb-launcher__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px 18px;
}

/* Search results */
.lkb-launcher__results {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lkb-launcher__result {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    transition: background 120ms ease;
}
.lkb-launcher__result:hover,
.lkb-launcher__result.is-active {
    background: var(--kb-launcher-soft);
}
.lkb-launcher__result-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px;
    color: #1e293b;
}
.lkb-launcher__result-excerpt {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.lkb-launcher__result mark {
    background: rgba(59, 130, 246, 0.2);
    padding: 0 2px;
    border-radius: 2px;
}
.lkb-launcher__no-results {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* Browse panel */
.lkb-launcher__browse-category {
    margin-bottom: 14px;
}
.lkb-launcher__browse-cat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lkb-launcher__browse-cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lkb-launcher__browse-cat-icon .dashicons { font-size: 13px; width: 13px; height: 13px; }
.lkb-launcher__browse-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lkb-launcher__browse-link {
    display: block;
    padding: 6px 10px 6px 32px;
    border-radius: 6px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    transition: background 100ms ease, color 100ms ease;
}
.lkb-launcher__browse-link:hover {
    background: var(--kb-launcher-soft);
    color: #1e293b;
}

/* Footer */
.lkb-launcher__footer {
    border-top: 1px solid #e2e8f0;
    padding: 12px 18px;
    text-align: center;
    background: var(--kb-launcher-soft);
}
.lkb-launcher__home-link {
    color: var(--kb-launcher-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.lkb-launcher__home-link:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 500px) {
    .lkb-launcher { bottom: 16px; right: 16px; }
    .lkb-launcher__panel {
        right: -8px;
        left: -8px;
        width: auto;
        max-width: none;
    }
}
