/**
 * Search Autocomplete Styles
 */

.search-form,
.search-form-large {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
}

.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #2a2a2a;
}

.suggestion-item:last-of-type {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #2a2a2a;
}

.suggestion-poster {
    width: 50px;
    height: 75px;
    min-width: 50px;
    margin-right: 12px;
    border-radius: 4px;
    overflow: hidden;
    background: #2a2a2a;
}

.suggestion-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-title mark {
    background: #e50914;
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #999;
}

.suggestion-type {
    display: flex;
    align-items: center;
    gap: 5px;
}

.suggestion-type i {
    font-size: 0.75rem;
    color: #e50914;
}

.suggestion-year {
    color: #999;
}

.suggestion-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #ffc107;
}

.suggestion-rating i {
    font-size: 0.75rem;
}

.suggestion-arrow {
    color: #666;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.active .suggestion-arrow {
    opacity: 1;
}

.suggestion-loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

.suggestion-loading i {
    margin-right: 8px;
    color: #e50914;
}

.suggestion-view-all {
    padding: 15px;
    text-align: center;
    color: #e50914;
    font-weight: 500;
    cursor: pointer;
    border-top: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.suggestion-view-all:hover {
    background: #2a2a2a;
}

.suggestion-view-all i {
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 400px;
    }
    
    .suggestion-item {
        padding: 10px 12px;
    }
    
    .suggestion-poster {
        width: 40px;
        height: 60px;
        min-width: 40px;
    }
    
    .suggestion-title {
        font-size: 0.9rem;
    }
    
    .suggestion-meta {
        font-size: 0.8rem;
    }
}

/* Keyboard shortcut hint */
.search-shortcut-hint {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.75rem;
    pointer-events: none;
    display: none;
    white-space: nowrap;
}

.search-shortcut-hint kbd {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #fff;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.search-form input:not(:placeholder-shown) ~ .search-shortcut-hint,
.search-form-large input:not(:placeholder-shown) ~ .search-shortcut-hint {
    display: none;
}

.search-form input:focus:placeholder-shown ~ .search-shortcut-hint,
.search-form-large input:focus:placeholder-shown ~ .search-shortcut-hint {
    display: block;
}

@media (max-width: 768px) {
    .search-shortcut-hint {
        display: none !important;
    }
}

