/**
 * Favorite & Follow Buttons Component
 * Styles for favorite/follow buttons across all content types
 *
 * Button Types:
 * - .track-favorite-btn: Track row favorite button (trackA1.php)
 * - .hero__favorite-btn: Hero section favorite button (mixtapeA1.php, videoA1.php)
 * - .hero__follow-btn: Hero section follow button (iartist.php)
 * - .bs-slide__favorite-btn: Video slide favorite button (videoA1.php cards)
 * - .bs-card__follow-btn: Artist card follow button (iartists.php)
 *
 * @created 2025-11-19
 * @version 1.0.0
 */

/* ===================================
   TRACK ROW FAVORITE BUTTON
   =================================== */

.track-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.track-favorite-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* z-index removed - allows sticky player to properly overlay */
}

.track-favorite-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.track-favorite-btn--active {
    color: #1db954;
}

.track-favorite-btn--active i {
    font-weight: 900; /* Solid heart */
}

.track-favorite-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   HERO SECTION BUTTONS
   =================================== */

.hero__favorite-btn,
.hero__follow-btn {
    /* Inherits base styling from .hero__control-btn in existing CSS */
}

.hero__favorite-btn--active {
    color: #1db954;
}

.hero__favorite-btn--active i {
    font-weight: 900; /* Solid heart */
}

.hero__follow-btn--active {
    color: #1db954;
}

.hero__follow-btn--active .fa-user-plus {
    display: none;
}

.hero__follow-btn--active::before {
    content: '\f4fc'; /* fa-user-check icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
}

.hero__favorite-btn.loading,
.hero__follow-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   VIDEO SLIDE FAVORITE BUTTON
   =================================== */

.bs-slide__favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-slide__favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.bs-slide__favorite-btn--active {
    color: #1db954;
}

.bs-slide__favorite-btn--active i {
    font-weight: 900;
}

.bs-slide__favorite-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   ARTIST CARD FOLLOW BUTTON
   =================================== */

.bs-card__follow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.bs-card__follow-btn i {
    font-size: 16px;
}

.bs-card__follow-btn:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.bs-card__follow-btn--active {
    border-color: #1db954;
    color: #1db954;
    background: rgba(29, 185, 84, 0.1);
}

.bs-card__follow-btn--active .fa-user-plus {
    display: none;
}

.bs-card__follow-btn--active::before {
    content: '\f4fc '; /* fa-user-check with space */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
}

.bs-card__follow-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   VIDEO CARD FAVORITE BUTTON
   (videosA1.php, aVideos.php)
   =================================== */

.bs-card__favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.bs-card__favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.bs-card__favorite-btn--active {
    color: #1db954;
}

.bs-card__favorite-btn--active i {
    font-weight: 900;
}

.bs-card__favorite-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Song/Video card add to playlist button (opposite side from favorite) */
.bs-card__add-playlist-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.bs-card__add-playlist-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.bs-card__add-playlist-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   ADD TO PLAYLIST BUTTONS (TRACK ROWS)
   =================================== */

.track-add-playlist-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-add-playlist-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.track-add-playlist-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Hero section playlist button */
.hero__add-playlist-btn {
    /* Inherits from .hero__control-btn */
}

.hero__add-playlist-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.favorites-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.favorites-toast--success {
    border-left: 4px solid #1db954;
}

.favorites-toast--error {
    border-left: 4px solid #e74c3c;
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .track-favorite-btn,
    .track-add-playlist-btn {
        width: 48px;
        height: 48px;
    }

    .bs-slide__favorite-btn,
    .bs-card__favorite-btn {
        width: 44px;
        height: 44px;
        top: 4px;
        right: 4px;
    }

    .bs-card__add-playlist-btn {
        width: 44px;
        height: 44px;
        top: 4px;
        left: 4px;
    }

    .bs-card__follow-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .favorites-toast {
        bottom: 16px;
        width: 90%;
        max-width: 320px;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.track-favorite-btn:focus,
.track-add-playlist-btn:focus,
.hero__favorite-btn:focus,
.hero__add-playlist-btn:focus,
.hero__follow-btn:focus,
.bs-slide__favorite-btn:focus,
.bs-card__favorite-btn:focus,
.bs-card__add-playlist-btn:focus,
.bs-card__follow-btn:focus {
    outline: 2px solid #1db954;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .track-favorite-btn,
    .track-add-playlist-btn,
    .hero__favorite-btn,
    .hero__add-playlist-btn,
    .hero__follow-btn,
    .bs-slide__favorite-btn,
    .bs-card__favorite-btn,
    .bs-card__add-playlist-btn,
    .bs-card__follow-btn,
    .favorites-toast {
        transition: none;
    }
}
