/* src/public/css/search.css */

/* Search Results */
.search-results-header {
    padding: 1rem;
    background: #667eea;
    color: white;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

    .search-result-item:hover {
        background: #f0f8ff;
    }

    .search-result-item:last-child {
        border-bottom: none;
        border-radius: 0 0 8px 8px;
    }

.search-result-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.search-result-details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.search-result-type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}

    .search-result-type.series {
        background: #28a745;
    }

.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

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

.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .search-suggestion-item:hover,
    .search-suggestion-item.highlighted {
        background: #f0f8ff;
        border-left: 3px solid #667eea;
    }

    .search-suggestion-item:last-child {
        border-bottom: none;
        border-radius: 0 0 8px 8px;
    }

.suggestion-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.suggestion-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-details {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search Container Positioning */
.search-container {
    position: relative;
}

/* Loading state for suggestions */
.search-suggestions-loading {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* History suggestions styling */
.search-suggestion-item.history {
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
}

    .search-suggestion-item.history:hover,
    .search-suggestion-item.history.highlighted {
        background: #e9ecef;
        border-left: 3px solid #495057;
    }

.suggestion-history-icon {
    width: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.suggestion-history-details {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-suggestions-dropdown {
        max-height: 300px;
    }
    
    .search-suggestion-item {
        padding: 0.5rem;
    }
    
    .suggestion-poster,
    .suggestion-history-icon {
        width: 35px;
        height: 52px;
        margin-right: 0.5rem;
    }
    
    .suggestion-title {
        font-size: 0.9rem;
    }
    
    .suggestion-details,
    .suggestion-history-details {
        font-size: 0.75rem;
    }
}
