/**
 * Veelearn Search Enhancements CSS
 * Styles for search highlighting, filters, and history
 */

.search-highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* Advanced filters */
.advanced-filters {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #374151;
    min-width: 150px;
}

.filter-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.clear-filters-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.clear-filters-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Search history dropdown */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.clear-history-btn:hover {
    background: #f3f4f6;
}

.search-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-history-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #374151;
}

.search-history-item:hover {
    background: #f3f4f6;
}

.search-history-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.search-history-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-highlight {
        background: #854d0e;
        color: #fef08a;
    }

    .advanced-filters {
        background: #1f2937;
    }

    .filter-group label {
        color: #9ca3af;
    }

    .filter-select {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }

    .clear-filters-btn {
        background: #374151;
        border-color: #4b5563;
        color: #9ca3af;
    }

    .clear-filters-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
    }

    .search-history-dropdown {
        background: #1f2937;
        border-color: #4b5563;
    }

    .search-history-header {
        border-bottom-color: #4b5563;
        color: #9ca3af;
    }

    .search-history-item {
        color: #e5e7eb;
    }

    .search-history-item:hover {
        background: #374151;
    }
}

/* Responsive design */
@media (max-width: 640px) {
    .advanced-filters {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .clear-filters-btn {
        width: 100%;
        margin-left: 0;
    }
}
