/* ============================================
   Input Suggestion Widget (QA Suggestion)
   - Upward popup from chat input
   - RWD: PC + Mobile
   - Fuzzy search with highlighting
   ============================================ */

.input-suggestion-wrapper {
    position: fixed;
    z-index: 100;
    left: 0;
    right: 0;
    bottom: 64px;
    display: none;
    pointer-events: none;
    max-width: 928px;
    margin: 0 auto;
    padding: 0 14px;
    box-sizing: border-box;
}

.input-suggestion-wrapper.active {
    display: block;
}

.input-suggestion-list {
    pointer-events: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.input-suggestion-list::-webkit-scrollbar {
    width: 4px;
}

.input-suggestion-list::-webkit-scrollbar-track {
    background: transparent;
}

.input-suggestion-list::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.input-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: inherit;
    line-height: 1.5;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s ease;
    word-break: break-word;
    overflow-wrap: break-word;
}

.input-suggestion-item:last-child {
    border-bottom: none;
}

.input-suggestion-item:hover,
.input-suggestion-item.active {
    background-color: #f0f4ff;
}

.input-suggestion-item .suggestion-highlight {
    color: #007cc5;
    font-weight: 600;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1px 2px;
    border-radius: 2px;
    display: inline;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .input-suggestion-wrapper {
        bottom: 64px;
        padding: 0 8px;
    }

    .input-suggestion-list {
        max-height: 180px;
        border-radius: 10px;
    }

    .input-suggestion-item {
        padding: 9px 14px;
        font-size: inherit;
    }
}

/* When keyboard is detected on mobile - adjust position */
.input-suggestion-wrapper.keyboard-open {
    bottom: 60px;
}
