/**
 * 搜尋自動完成樣式
 */

.autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-suggestions {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f5f5ff;
}

.autocomplete-item-content {
    display: block;
    line-height: 1.6;
    padding-left: 128px;
    text-indent: -128px;
}

.autocomplete-code {
    display: inline;
    font-size: 13px;
    color: #4f46e5;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    margin-right: 8px;
    white-space: nowrap;
}

.autocomplete-name {
    display: inline;
    font-size: 14px;
    color: #333;
}

.autocomplete-name mark {
    background-color: #ffeb3b;
    color: #000;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* 滾動條樣式 */
.autocomplete-container::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.autocomplete-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.autocomplete-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .autocomplete-container {
        max-height: 300px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .autocomplete-item-content {
        padding-left: 110px;
        text-indent: -110px;
    }

    .autocomplete-code {
        font-size: 12px;
        margin-right: 6px;
    }

    .autocomplete-name {
        font-size: 13px;
    }
}
