/**
 * Enhanced Search Styles
 * Provides styling for fallback search dropdowns and improved search functionality
 */

/* Fallback search dropdown styling */
.fallback-search {
    position: relative;
    display: inline-block;
    width: 100%;
}

.fallback-search input[type="text"] {
    width: 100%;
    padding: 0.5em 1em;
    border: 1px solid #d4d4d5;
    border-radius: 0.28571429rem;
    background: #fff;
    font-size: 1em;
    line-height: 1.21428571em;
    color: rgba(0, 0, 0, 0.87);
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.fallback-search input[type="text"]:focus {
    border-color: #96c8da;
    box-shadow: 0 0 0 0.2em rgba(33, 133, 208, 0.3);
    outline: none;
}

.fallback-search .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d4d4d5;
    border-top: none;
    border-radius: 0 0 0.28571429rem 0.28571429rem;
    box-shadow: 0 2px 4px 0 rgba(34, 36, 38, 0.12), 0 2px 10px 0 rgba(34, 36, 38, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.fallback-search .menu .item {
    padding: 0.5em 1em;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s ease;
}

.fallback-search .menu .item:hover {
    background-color: #f8f9fa;
}

.fallback-search .menu .item:last-child {
    border-bottom: none;
}

/* Enhanced search input styling */
.ui.dropdown.search input[type="text"] {
    font-size: 1em;
    padding: 0.5em 1em;
}

.ui.dropdown.search .menu {
    max-height: 300px;
    overflow-y: auto;
}

/* Search highlighting */
.ui.dropdown.search .menu .item.highlighted {
    background-color: #e3f2fd;
    font-weight: 500;
}

/* Loading state for search */
.ui.dropdown.search.loading .menu::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive search */
@media (max-width: 768px) {
    .fallback-search .menu {
        max-height: 150px;
    }
    
    .ui.dropdown.search .menu {
        max-height: 200px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .fallback-search input[type="text"] {
        background: #2d2d2d;
        border-color: #555;
        color: #fff;
    }
    
    .fallback-search .menu {
        background: #2d2d2d;
        border-color: #555;
    }
    
    .fallback-search .menu .item {
        color: #fff;
        border-bottom-color: #444;
    }
    
    .fallback-search .menu .item:hover {
        background-color: #3d3d3d;
    }
}
