/**
 * Favoris — cœur + toast + liste
 * @package AnnuairePro
 */

/* =========================================================================
   BOUTON CŒUR
   ========================================================================= */
.apb-fav-btn {
    position: static;
    z-index: 10;
    background: rgba(255,255,255,.85);
    border: 1.5px solid #E2E6EA;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding: 0;
    flex-shrink: 0;
    margin-left: auto;
}

.apb-fav-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.apb-fav-btn:active {
    transform: scale(.9);
}

.apb-fav-btn__heart {
    stroke: #DC2626;
    fill: transparent;
    stroke-width: 2;
    transition: fill .3s cubic-bezier(.4,0,.2,1), stroke .2s;
}

.apb-fav-btn--active .apb-fav-btn__heart {
    fill: #DC2626;
    stroke: #DC2626;
}

/* Animation pop quand on ajoute */
@keyframes apb-heart-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.3); }
    60%  { transform: scale(.95); }
    100% { transform: scale(1); }
}

.apb-fav-btn--animate {
    animation: apb-heart-pop .4s ease;
}

/* =========================================================================
   TOAST NOTIFICATION
   ========================================================================= */
.apb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1A1A2E;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    z-index: 10000;
    opacity: 0;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
    white-space: nowrap;
    font-family: var(--apb-font, system-ui, sans-serif);
}

.apb-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================================
   POPUP CONNEXION (non loggé)
   ========================================================================= */
.apb-fav-popup {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    padding: 24px 28px;
    z-index: 10000;
    opacity: 0;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    text-align: center;
    max-width: 360px;
    width: 90%;
    font-family: var(--apb-font, system-ui, sans-serif);
}

.apb-fav-popup--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.apb-fav-popup__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #9CA3AF;
    padding: 4px;
    line-height: 1;
}

.apb-fav-popup__heart {
    font-size: 36px;
    margin-bottom: 8px;
}

.apb-fav-popup__text {
    font-size: 15px;
    color: #1A1A2E;
    margin-bottom: 16px;
    line-height: 1.5;
    font-weight: 500;
}

.apb-fav-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apb-fav-popup__btn {
    display: block;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .2s;
}

.apb-fav-popup__btn--primary {
    background: var(--apb-primary, #185FA5);
    color: #fff;
}
.apb-fav-popup__btn--primary:hover {
    background: var(--apb-primary-dark, #0C447C);
}

.apb-fav-popup__btn--accent {
    background: var(--apb-accent, #E6892A);
    color: #fff;
}
.apb-fav-popup__btn--accent:hover {
    background: #C96F15;
}

/* =========================================================================
   LISTE FAVORIS (dashboard visiteur)
   ========================================================================= */
.apb-fav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apb-fav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--apb-border, #E2E6EA);
    border-radius: 12px;
    transition: all .2s;
}

.apb-fav-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.apb-fav-item__photo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.apb-fav-item__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--apb-primary-light, #EBF3FB);
    color: var(--apb-primary, #185FA5);
    font-weight: 700;
    font-size: 18px;
}

.apb-fav-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apb-fav-item__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--apb-text, #1A1A2E);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.apb-fav-item__name:hover { color: var(--apb-primary, #185FA5); }

.apb-fav-item__cat {
    font-size: 12px;
    color: var(--apb-primary, #185FA5);
    font-weight: 500;
}

.apb-fav-item__loc,
.apb-fav-item__note {
    font-size: 12px;
    color: var(--apb-muted, #6B7280);
}

.apb-fav-item__remove {
    position: static;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    opacity: .5;
    transition: opacity .2s;
    width: auto;
    height: auto;
    box-shadow: none;
}
.apb-fav-item__remove:hover { opacity: 1; }

/* Fade out après suppression */
.apb-fav-item--removing {
    opacity: 0;
    transform: translateX(20px);
    transition: all .3s;
}

/* =========================================================================
   BOUTON CTA FAVORI (profil public hero)
   ========================================================================= */
.apb-fav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    min-height: 48px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--apb-font, system-ui, sans-serif);
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(4px);
}

.apb-fav-cta:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.5);
}

.apb-fav-cta__heart {
    font-size: 18px;
    line-height: 1;
    transition: transform .3s;
}

.apb-fav-cta--active {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
}

.apb-fav-cta--active:hover {
    background: #FEE2E2 !important;
}

.apb-fav-cta--active .apb-fav-cta__heart {
    transform: scale(1.15);
}

@keyframes apb-cta-heart-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4); }
    60%  { transform: scale(.95); }
    100% { transform: scale(1.15); }
}

.apb-fav-cta--animate .apb-fav-cta__heart {
    animation: apb-cta-heart-pop .4s ease;
}

@media (max-width: 480px) {
    .apb-fav-popup { bottom: 0; border-radius: 16px 16px 0 0; width: 100%; max-width: 100%; }
}
