/* ========== MODAL FAVORIS SERVICE ========== */

.favorites-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.favorites-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.favorites-modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

.favorites-modal-right {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.favorites-modal-info {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(102, 126, 234, 0.08);
    border-left: 4px solid rgba(102, 126, 234, 0.9);
    color: var(--text-secondary);
    padding: 1rem 1.2rem;
    margin: 0 1.2rem 1.2rem;
    border-radius: 10px;
    gap: 0.8rem;
}

.favorites-modal-info i[data-lucide] {
    min-width: 24px;
    min-height: 24px;
    color: #667eea;
    margin-top: 2px;
}

.favorites-modal-info p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.favorites-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.favorites-empty-icon {
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.favorites-empty-icon i[data-lucide] {
    width: 42px;
    height: 42px;
    opacity: 0.7;
    color: #667eea;
}

.favorites-empty-state h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.favorites-empty-state p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.favorites-modal-counter {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-left: auto;
    margin-right: 0.7rem;
}

.favorites-modal-toolbar {
    padding: 0.85rem 1.2rem 0.25rem;
}

.favorites-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
}

.favorites-search-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.favorites-search-wrap input::placeholder {
    color: var(--text-secondary);
    opacity: 0.9;
}

.favorites-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-darker);
    gap: 1rem;
}

.favorites-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-modal-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.4;
    max-width: 42rem;
}

.favorites-modal-toolbar {
    padding: 1rem 1.2rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.favorites-modal-body {
    padding: 0 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 6px;
}

.btn-close-modal:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.favorites-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.favorites-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.favorites-item:hover {
    background: var(--bg-darker);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.2);
    transform: translateX(4px);
}

.favorites-item-info {
    flex: 1;
    min-width: 0;
}

.favorites-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.favorites-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.favorites-item-detail {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.favorites-item-detail strong {
    color: var(--text-primary);
    min-width: 50px;
}

.favorites-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-load-item {
    padding: 0.5rem 0.75rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    white-space: nowrap;
    text-align: center;
}

.btn-load-item:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-delete-item {
    padding: 0.5rem 0.75rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
}

.btn-delete-item:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.favorites-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.favorites-empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.favorites-empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Scroll personnalisé pour la modal */
.favorites-modal-list::-webkit-scrollbar {
    width: 6px;
}

.favorites-modal-list::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.favorites-modal-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.favorites-modal-list::-webkit-scrollbar-thumb:hover {
    background: var(--bg-light);
}

/* Badge counters */
#favorites-count {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 0.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .favorites-modal-content {
        max-width: 95%;
    }

    .favorites-item-details {
        grid-template-columns: 1fr;
    }

    .favorites-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .favorites-item-actions {
        width: 100%;
        justify-content: space-between;
    }
}
