/* Search Autocomplete Dropdown */
.search-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 420px;
    overflow-y: auto;
    z-index: 1050;
    animation: searchDropdownIn 0.15s ease-out;
}

@keyframes searchDropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sections */
.search-ac-section {
    padding: 4px 0;
}

.search-ac-section:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.search-ac-section-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.search-ac-section-title i {
    margin-right: 4px;
    font-size: 11px;
}

/* Items */
.search-ac-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.1s;
    gap: 12px;
}

.search-ac-item:hover,
.search-ac-item.active {
    background-color: #f8f6f1;
}

/* Icon container */
.search-ac-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
}

/* Trail type icon (mask-image based) */
.search-ac-trail-icon {
    width: 18px;
    height: 18px;
    background-color: var(--categ-color, #666);
    mask-image: var(--mask-image);
    -webkit-mask-image: var(--mask-image);
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

/* Peak icon coloring */
.search-ac-icon--peak {
    background: #e8f5e9;
    color: #2e7d32;
}

.search-ac-icon--cabin {
    background: #fff3e0;
    color: #e65100;
}

.search-ac-icon--location {
    background: #e3f2fd;
    color: #1565c0;
}

.search-ac-icon--trail {
    background: #f5f5f5;
    color: #666;
}

/* Text content */
.search-ac-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-ac-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-ac-name mark {
    background: transparent;
    color: #dd9304;
    font-weight: 700;
    padding: 0;
}

.search-ac-detail {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer (search all) */
.search-ac-footer {
    border-top: 1px solid #f0f0f0;
    padding: 4px 0;
}

.search-ac-search-all .search-ac-name {
    color: #dd9304;
    font-weight: 600;
}

/* Empty state */
.search-ac-empty {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-ac-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Prompt state (click/focus with no query) */
.search-ac-prompt {
    padding: 14px 16px;
    font-size: 13px;
    color: #aaa;
}

.search-ac-prompt i {
    display: inline-block;
    font-size: 14px;
    margin-right: 6px;
    margin-bottom: 0;
    vertical-align: middle;
    opacity: 0.6;
}

/* Loading state */
.search-ac-loading {
    padding: 16px;
    text-align: center;
}

.search-ac-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9e9e9;
    border-top-color: #dd9304;
    border-radius: 50%;
    animation: searchSpin 0.6s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
.search-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Elevation badge for peaks */
.search-ac-ele {
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    margin-left: 4px;
}
