/**
 * AJAX Live Search Dropdown Styles
 */

/* Wrapper for positioning */
.asp-live-search-wrapper {
    position: relative;
    width: 100%;
}

/* Dropdown container */
.asp-live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 8px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

/* Section styling */
.asp-live-search-section {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.asp-live-search-section:last-of-type {
    border-bottom: none;
}

.asp-live-search-section-title {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

/* Search item base */
.asp-live-search-item {
    transition: background 0.15s ease;
}

.asp-live-search-item a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
}

.asp-live-search-item:hover,
.asp-live-search-item.selected {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(139, 195, 74, 0.1));
}

/* Park result item */
.asp-live-search-park-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
}

.asp-live-search-park-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asp-live-search-park-info {
    flex: 1;
    min-width: 0;
}

.asp-live-search-park-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a5a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asp-live-search-park-title mark {
    background: rgba(76, 175, 80, 0.25);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.asp-live-search-park-state {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.asp-live-search-park-activities {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

/* State result item */
.asp-live-search-state a {
    justify-content: space-between;
}

.asp-live-search-state-name {
    font-weight: 500;
    color: #333;
}

.asp-live-search-state-name mark {
    background: rgba(76, 175, 80, 0.25);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.asp-live-search-state-count {
    font-size: 0.8rem;
    color: #888;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 12px;
}

/* Loading state */
.asp-live-search-loading {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.asp-live-search-loading .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: asp-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Empty state */
.asp-live-search-empty {
    padding: 32px 24px;
    text-align: center;
}

.asp-live-search-empty-icon {
    font-size: 2rem;
    opacity: 0.5;
    margin-bottom: 8px;
}

.asp-live-search-empty-text {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 4px;
}

.asp-live-search-empty-hint {
    font-size: 0.8rem;
    color: #888;
}

/* Footer with View All */
.asp-live-search-footer {
    padding: 8px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.asp-live-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a5a1a;
    text-decoration: none;
    transition: background 0.2s ease;
}

.asp-live-search-view-all:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #1a5a1a;
}

.asp-live-search-view-all svg {
    width: 16px;
    height: 16px;
}

/* Error state */
.asp-live-search-error {
    padding: 24px;
    text-align: center;
    color: #dc3545;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .asp-live-search-dropdown {
        /* Keep position absolute to stay under search input */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: 12px;
        margin-top: 8px;
    }

    .asp-live-search-park-image {
        width: 40px;
        height: 40px;
    }

    .asp-live-search-popular-tags {
        gap: 6px;
    }

    .asp-live-search-popular-tag {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   POPULAR SEARCHES
   ========================================================================== */

.asp-live-search-popular {
    padding: 16px;
}

.asp-live-search-popular-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.asp-live-search-popular-section {
    margin-bottom: 16px;
}

.asp-live-search-popular-section:last-child {
    margin-bottom: 0;
}

.asp-live-search-popular-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
}

/* Tag-based layout for states and activities */
.asp-live-search-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asp-live-search-popular-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* State tags - dark green */
.asp-popular-state {
    background: linear-gradient(135deg, rgba(26, 90, 26, 0.1), rgba(45, 125, 45, 0.08));
    color: #1a5a1a;
    border: 1px solid rgba(26, 90, 26, 0.15);
}

.asp-popular-state:hover {
    background: #1a5a1a;
    color: white;
    transform: translateY(-1px);
}

.asp-popular-state .tag-count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 2px;
}

/* Activity tags - lighter green */
.asp-popular-activity {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.08));
    color: #2d7d2d;
    border: 1px solid rgba(76, 175, 80, 0.15);
}

.asp-popular-activity:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-1px);
}

/* Featured park links */
.asp-live-search-popular-park {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.asp-live-search-popular-park:hover {
    background: rgba(76, 175, 80, 0.08);
}

.popular-park-name {
    font-weight: 500;
    color: #1a5a1a;
    font-size: 0.9rem;
}

.popular-park-state {
    font-size: 0.8rem;
    color: #666;
}

/* ==========================================================================
   SEARCH HISTORY
   ========================================================================== */

.asp-history-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asp-clear-history {
    background: none;
    border: none;
    font-size: 0.7rem;
    color: #888;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.asp-clear-history:hover {
    background: #fee;
    color: #c00;
}

.asp-live-search-history {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asp-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: background 0.15s ease;
}

.asp-history-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1a5a1a;
}

.history-icon {
    font-size: 0.9rem;
    opacity: 0.5;
}

.history-term {
    flex: 1;
    font-size: 0.9rem;
}

/* ==========================================================================
   DID YOU MEAN SUGGESTIONS
   ========================================================================== */

.asp-live-search-suggestions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e0e0e0;
}

.asp-suggestions-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.asp-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asp-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(139, 195, 74, 0.05));
    border-radius: 8px;
    text-decoration: none;
    color: #1a5a1a;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.asp-suggestion-item:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(139, 195, 74, 0.1));
    transform: translateX(4px);
    color: #1a5a1a;
}

.suggestion-icon {
    font-size: 1rem;
}

.suggestion-term {
    font-size: 0.9rem;
}