/* =============================== */
/*   COMPOSANTS – RECHERCHE FILM   */
/* =============================== */

.film-search {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    max-width: 680px;
    margin: 16px auto 0;
    position: relative;
}

.film-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .75rem 1rem;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 6px;
    font-size: 1rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
}

.film-search input[type="search"]::placeholder {
    color: #999;
}

.film-search input[type="search"]:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(10, 165, 233, 0.2);
}

.film-search .btn-search {
    padding: .75rem 1.2rem;
    background: linear-gradient(135deg, #0ea5e9, #a855f7);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.film-search .btn-search:hover {
    filter: brightness(1.1);
}

.film-search .loading {
    position: absolute;
    right: 108px;
    font-size: .9rem;
    opacity: .65;
    color: #666;
}

/* Résultats de recherche */
.film-search-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 999;
    top: 100%;
    margin-top: 6px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.film-search-results.show {
    display: block;
}

.film-search-item {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

.film-search-item:last-child {
    border-bottom: none;
}

.film-search-item:hover,
.film-search-item.is-active {
    background: #eef2f7;
}

.film-search-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.poster-fallback {
    width: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.film-search-item .title {
    font-weight: 800;
    flex: 1;
    min-width: 0;
}

.film-search-item .year {
    color: #6b7280;
    font-weight: 700;
    white-space: nowrap;
}

.film-search-item mark {
    background: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
}

.film-search-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: .95rem;
}

@media (max-width: 680px) {
    .film-search {
        flex-direction: column;
        gap: 10px;
    }

    .film-search input[type="search"],
    .film-search .btn-search {
        width: 100%;
    }

    .film-search .loading {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}
