/* ===================================== */
/*           HISTORY CARDS               */
/* ===================================== */

/* Анимации для карточек */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-track-card {
    animation: slideInRight 0.3s ease-out;
    animation-fill-mode: both;
}

/* Задержки для анимации */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }
.delay-9 { animation-delay: 0.45s; }
.delay-10 { animation-delay: 0.5s; }

/* Ховер эффекты */
.history-track-card {
    position: relative;
    overflow: hidden;
}

.history-track-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.history-track-card:hover::after {
    transform: translateX(100%);
}

/* Активный трек */
.history-track-card.active {
    position: relative;
}

.history-track-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Обложка при ховере */
.history-track-cover {
    position: relative;
}

.history-play-overlay {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.play-icon {
    transform: scale(1);
    transition: transform 0.2s ease;
}

.history-track-card:hover .play-icon {
    transform: scale(1.2);
}

/* Время прослушивания */
.history-track-listen-time {
    transition: all 0.2s ease;
}

.history-track-card:hover .history-track-listen-time {
    background: rgba(255,204,0,0.15);
    border-color: rgba(255,204,0,0.3);
}

.time-value {
    transition: color 0.2s ease;
}

.history-track-card:hover .time-value {
    color: var(--accent);
}

/* Мета-информация */
.history-track-meta {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.history-track-card:hover .history-track-meta {
    opacity: 1;
}

/* Адаптив */
@media (max-width: 768px) {
    .history-track-card {
        flex-wrap: wrap;
        padding: 12px 16px;
    }
    
    .history-track-cover {
        width: 50px;
        height: 50px;
    }
    
    .history-track-info {
        width: calc(100% - 90px);
    }
    
    .history-track-title {
        max-width: 200px;
        font-size: 15px;
    }
    
    .history-track-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 66px;
        margin-top: 8px;
    }
    
    .history-track-listen-time {
        padding: 4px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .history-track-title {
        max-width: 150px;
    }
    
    .history-track-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .history-track-right {
        margin-left: 0;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Анимация при удалении */
.history-track-card.removing {
    animation: slideOutLeft 0.3s ease forwards;
    pointer-events: none;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Анимация при добавлении */
.history-track-card.adding {
    animation: slideInRight 0.3s ease;
}

/* Тулкит для времени */
.history-track-listen-time {
    position: relative;
}

.history-track-listen-time:hover::after {
    content: 'Время прослушивания';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* Статистика на десктопе */
@media (min-width: 769px) {
    .history-stats {
        gap: 40px;
    }
    
    .history-stat {
        padding: 0 10px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
}