/* W33Keys Favorites System Styles */

/* Favorite Button Styles */
.favorite-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(8px);
    color: #9ca3af;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    color: #ef4444;
}

.favorite-btn.favorited {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.favorite-btn.favorited:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.favorite-btn i {
    font-size: 1rem;
    transition: all 0.2s ease;
}

.favorite-btn:not(.favorited) i.fas {
    display: none;
}

.favorite-btn.favorited i.far {
    display: none;
}

/* Favorite Button Animation */
.favorite-btn.adding {
    animation: favoriteAdd 0.6s ease-out;
}

.favorite-btn.removing {
    animation: favoriteRemove 0.4s ease-out;
}

@keyframes favoriteAdd {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #ef4444;
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes favoriteRemove {
    0% {
        transform: scale(1.1);
        color: #ef4444;
    }
    50% {
        transform: scale(0.8);
        color: #9ca3af;
    }
    100% {
        transform: scale(1);
    }
}

/* Favorites Tab Styles */
.favorites-tab {
    position: relative;
    overflow: hidden;
}

.favorites-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.2), transparent);
    transition: left 0.6s ease;
}

.favorites-tab:hover::before {
    left: 100%;
}

.favorites-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.favorites-count.pulse {
    animation: favoritesCountPulse 0.8s ease-out;
}

@keyframes favoritesCountPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        background: #fbbf24;
    }
    100% {
        transform: scale(1);
    }
}

/* Favorites Controls */
.favorites-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.75rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.favorites-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.favorites-control-btn:hover {
    background: rgba(107, 114, 128, 0.3);
    border-color: rgba(107, 114, 128, 0.5);
    color: white;
    transform: translateY(-1px);
}

.favorites-control-btn.active {
    background: rgba(147, 51, 234, 0.2);
    border-color: #9333ea;
    color: #c084fc;
}

.favorites-control-btn i {
    font-size: 0.875rem;
}

/* Favorites Empty State */
.favorites-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.favorites-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.favorites-empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

.favorites-empty-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.favorites-empty-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.favorites-empty-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
}

/* Favorites Statistics */
.favorites-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.favorites-stat-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.favorites-stat-card:hover {
    border-color: rgba(147, 51, 234, 0.5);
    background: rgba(31, 41, 55, 0.7);
    transform: translateY(-2px);
}

.favorites-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #9333ea;
}

.favorites-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.favorites-stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Favorites Progress Bar */
.favorites-progress {
    margin-top: 1rem;
}

.favorites-progress-bar {
    width: 100%;
    height: 0.5rem;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 9999px;
    overflow: hidden;
}

.favorites-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e);
    border-radius: 9999px;
    transition: width 0.6s ease;
    position: relative;
}

.favorites-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.favorites-progress-text {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    text-align: center;
}

/* Toast Notifications */
.toast-notification {
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.toast-notification:hover {
    transform: translateX(-4px);
}

/* Favorites Badge */
.favorites-badge {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #111827;
    z-index: 20;
}

/* Favorite Cards Highlighting */
.itch-card.is-favorite {
    border: 2px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.itch-card.is-favorite::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
    border-radius: inherit;
    pointer-events: none;
}

/* Favorites First Indicator */
.favorites-first-indicator {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    z-index: 15;
}

/* Export/Import Styles */
.favorites-export-import {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.favorites-file-input {
    display: none;
}

.favorites-file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 0.5rem;
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-file-label:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #10b981;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .favorites-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .favorites-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .favorites-export-import {
        flex-direction: column;
    }
    
    .favorite-btn {
        width: 2rem;
        height: 2rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .favorite-btn i {
        font-size: 0.875rem;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .favorites-control-btn {
        background: rgba(55, 65, 81, 0.3);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .favorites-stat-card {
        background: rgba(17, 24, 39, 0.8);
    }
}

/* Accessibility Improvements */
.favorite-btn:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.favorites-control-btn:focus {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .favorite-btn,
    .favorites-count,
    .favorites-control-btn,
    .favorites-stat-card,
    .toast-notification {
        transition: none;
    }
    
    .favorite-btn.adding,
    .favorite-btn.removing,
    .favorites-count.pulse {
        animation: none;
    }
}
