/* Search Autocomplete Dropdown Styles */

.search-area, .search-group {
    position: relative;
}

.search-dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 420px;
    overflow-y: auto;
    z-index: 99999;
    padding: 12px 0;
    display: none; /* Controlled by JS */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

/* Scrollbar customization */
.search-dropdown-results::-webkit-scrollbar {
    width: 6px;
}
.search-dropdown-results::-webkit-scrollbar-track {
    background: #f8fafc;
}
.search-dropdown-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Category Sections */
.search-results-section {
    padding-bottom: 8px;
}
.search-results-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.search-results-section + .search-results-section {
    margin-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 8px;
}

.search-section-header {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    padding: 6px 16px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-section-header span.section-count {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

/* Result Items */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.keyboard-active {
    background-color: #f8fafc;
    outline: none;
}

.search-result-item:hover .item-title,
.search-result-item.keyboard-active .item-title {
    color: #f89b20; /* Primary brand color */
}

/* Icons & Badges */
.item-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
}

/* Type Specific Styling */
.item-icon-wrapper.type-trek {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
}
.item-icon-wrapper.type-tour {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}
.item-icon-wrapper.type-page {
    background-color: rgba(168, 85, 247, 0.1);
    color: #7e22ce;
}

.item-content {
    flex-grow: 1;
    min-width: 0; /* Enable text truncation */
}

.item-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.item-desc {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

/* Matching Text Highlight */
.search-highlight {
    font-weight: 800;
    color: #0f172a;
    background-color: rgba(248, 155, 32, 0.15);
    padding: 0 2px;
    border-radius: 2px;
}

/* Loading & Empty States */
.search-dropdown-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #64748b;
    font-size: 14px;
    gap: 8px;
}

.search-dropdown-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-top-color: #f89b20;
    border-radius: 50%;
    animation: search-spin 0.8s linear infinite;
}

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

.search-dropdown-empty {
    text-align: center;
    padding: 30px 16px;
    color: #64748b;
}

.search-dropdown-empty i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #94a3b8;
    display: block;
}

.search-dropdown-empty p {
    font-size: 13px;
    margin: 0;
}
