/* ── Favorite Heart Button ────────────────────────────── */

.track-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.track-fav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.track-fav:hover {
    color: var(--accent-primary);
    transform: scale(1.15);
}
.track-fav--active {
    color: var(--accent-primary);
}
.track-fav--active svg {
    fill: currentColor;
}

/* Pulse animation on add */
@keyframes favPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.track-fav--pulse {
    animation: favPulse 0.3s ease;
}

/* ── Profile Favorites Grid ──────────────────────────── */
.fav-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}
.fav-card:hover {
    border-color: var(--border-hover);
}
.fav-card__cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.fav-card__info {
    flex: 1;
    min-width: 0;
}
.fav-card__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-card__artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-card__date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.fav-card__platforms {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.fav-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
    font-size: 0.9rem;
}

/* Profile favorites table */
.fav-row td:nth-child(2) { width: 100%; }
.profile-fav-platforms {
    white-space: nowrap;
    width: 1%;
}

/* Profile favorites table — mobile: icons below track name */
@media (max-width: 640px) {
    .profile-fav-cover { display: none !important; }
    th.profile-fav-cover { display: none !important; }
    .fav-row .profile-history-datetime,
    th.profile-history-datetime { display: none !important; }

    /* Stack: make platforms cell a block row under track info */
    .fav-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
    }
    .fav-row td {
        display: block;
        border: none;
        padding: 2px 12px;
    }
    .fav-row td:nth-child(2) {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .fav-row td:nth-child(2) .profile-history-query {
        white-space: nowrap;
        overflow-x: auto;
    }
    .fav-row .profile-fav-platforms {
        width: 100%;
        padding-top: 4px;
    }
}

/* RTL */
[dir="rtl"] .fav-card { direction: rtl; }
