/* Styles pour les résultats de recherche */

/* Input de recherche avec erreur */
.search-input-error {
    border-color: #EF4444 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Overlay de résultats de recherche */
.search-results-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow-y: auto;
    padding: 100px 20px 40px;
    animation: fadeIn 0.3s ease-out;
}

.search-results-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container des résultats */
.search-results-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header des résultats */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.search-results-title {
    font-size: 2rem;
    color: #fff;
    margin: 0;
}

.search-results-title .search-query {
    color: #5f5dff;
    font-weight: 700;
}

.search-results-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-top: 8px;
}

.search-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-close-btn:hover {
    background: rgba(95, 93, 255, 0.3);
    transform: rotate(90deg);
}

/* Grid de résultats */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Carte de film/série */
.search-result-card {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.9), rgba(20, 20, 30, 0.95));
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #5f5dff;
    box-shadow: 0 10px 40px rgba(95, 93, 255, 0.3);
}

.search-result-poster {
    position: relative;
    width: 100%;
    padding-top: 150%; /* Ratio 2:3 */
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    overflow: hidden;
}

.search-result-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-card:hover .search-result-poster img {
    transform: scale(1.1);
}

.search-result-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(95, 93, 255, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.search-result-rating {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.search-result-rating .stars {
    color: #ffd700;
    letter-spacing: 1px;
}

.search-result-rating span:last-child {
    color: #ffd700;
}

.search-result-info {
    padding: 15px;
}

.search-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 2.8em;
}

.search-result-year {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.search-result-overview {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Message vide */
.search-no-results {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.search-no-results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.search-no-results-title {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 10px;
}

.search-no-results-text {
    font-size: 1.1rem;
}

/* Loading spinner */
.search-loading {
    text-align: center;
    padding: 60px 20px;
}

.search-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(95, 93, 255, 0.3);
    border-top-color: #5f5dff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.search-loading-text {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* Placeholder pour image manquante */
.search-result-no-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: rgba(255, 255, 255, 0.3);
}

.search-result-no-poster svg {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .search-results-overlay {
        padding: 80px 15px 30px;
    }
    
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    .search-results-title {
        font-size: 1.5rem;
    }
    
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .search-result-card {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
