/**
 * Lykhubs Audio Player - Styles CSS
 * Version: 3.2.0
 * Description: Player audio avec file d'attente visuelle, lecture automatique, navigation et égaliseur
 */

/* === Player fixé en bas de la page === */
.lykhubs-audioplayer-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 0;
    backdrop-filter: blur(10px);
}

.lykhubs-audioplayer-modal.active {
    display: block;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.lykhubs-audioplayer-container {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    padding: 12px 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* === Bouton de fermeture === */
.lykhubs-audioplayer-close {
    position: absolute;
    top: 5px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lykhubs-audioplayer-close:hover {
    background: transparent;
    color: #e40046;
    transform: rotate(90deg) scale(1.1);
}

/* === Informations audio === */
.lykhubs-audioplayer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.lykhubs-audioplayer-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e40046 0%, #c3003e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.lykhubs-audioplayer-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lykhubs-audioplayer-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lykhubs-audioplayer-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}

.lykhubs-audioplayer-artist {
    font-size: 0.85rem;
    color: #999;
}

.lykhubs-audioplayer-artist::before {
    content: ', ';
    margin-right: 4px;
}

/* === Ligne de contrôles === */
.lykhubs-audioplayer-controls-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 0px;
    position: relative;
}

.lykhubs-audioplayer-timeline-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

/* === Timeline avec égaliseur === */
.lykhubs-audioplayer-timeline {
    position: relative;
    height: 20px;
    margin-top: 0px;
    margin-bottom: 0px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lykhubs-audioplayer-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 0.5px;
    height: 100%;
    width: 100%;
    position: relative;
}

.lykhubs-audioplayer-bar {
    flex: 1;
    min-height: 100%;
    background: linear-gradient(to top, rgba(228, 0, 70, 0.3), rgba(228, 0, 70, 0.5));
    border-radius: 1px 1px 0 0;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.lykhubs-audioplayer-bar.played {
    background: linear-gradient(to top, #e40046, #ff1a5c);
}

.lykhubs-audioplayer-bar:hover {
    background: linear-gradient(to top, #e40046, #ff1a5c);
    opacity: 0.8;
}

/* === Indicateur de progression === */
.lykhubs-audioplayer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* === Affichage du temps === */
.lykhubs-audioplayer-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    color: #999;
    font-size: 0.65rem;
}

.lykhubs-audioplayer-time-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lykhubs-audioplayer-listeners {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #999;
}

.lykhubs-audioplayer-listeners-icon {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.lykhubs-audioplayer-listeners-count {
    font-weight: 600;
    color: #666;
    transition: transform 0.2s ease;
}

.lykhubs-audioplayer-listeners-text {
    font-size: 0.7rem;
    color: #999;
}

.lykhubs-audioplayer-total-listens {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #999;
}

.lykhubs-audioplayer-total-listens i {
    font-size: 0.7rem;
    color: #666;
}

.lykhubs-audioplayer-total-listens-count {
    font-weight: 600;
    color: #888;
}

.lykhubs-audioplayer-total-listens-text {
    font-size: 0.7rem;
    color: #999;
}

.lykhubs-audioplayer-actions {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 10;
}

.lykhubs-audioplayer-btn-action {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    position: relative;
}

.lykhubs-audioplayer-btn-action:hover {
    background: transparent;
    color: #fff;
    transform: scale(1.1);
}

.lykhubs-audioplayer-btn-action.liked,
.lykhubs-audioplayer-btn-action.active {
    background: transparent;
    color: #e40046;
}

.lykhubs-audioplayer-btn-action.liked:hover,
.lykhubs-audioplayer-btn-action.active:hover {
    color: #ff1a5c;
    transform: scale(1.15);
}

/* === Contrôles centraux (Previous/Play/Next) === */
.lykhubs-audioplayer-controls-center {
    display: flex;
    align-items: flex-start; /* Align to top */
    justify-content: center;
    gap: 8px;
    height: 40px; /* Match timeline total height */
    padding: 0; /* No padding to ensure proper top alignment */
    box-sizing: border-box;
}

/* === Boutons Previous/Next === */
.lykhubs-audioplayer-btn-prev,
.lykhubs-audioplayer-btn-next {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: none; /* Caché par défaut, affiché via JS quand il y a une queue */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.lykhubs-audioplayer-btn-prev:hover,
.lykhubs-audioplayer-btn-next:hover {
    background: rgba(228, 0, 70, 0.2);
    border-color: #e40046;
    transform: scale(1.1);
}

.lykhubs-audioplayer-btn-prev:active,
.lykhubs-audioplayer-btn-next:active {
    transform: scale(0.95);
}

/* === Bouton Play === */
.lykhubs-audioplayer-btn-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e40046 0%, #c3003e 100%);
    border: 2px solid #e40046;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.lykhubs-audioplayer-btn-play:hover {
    background: linear-gradient(135deg, #ff1a5c 0%, #e40046 100%);
    transform: scale(1.15);
    box-shadow: 0 5px 20px rgba(228, 0, 70, 0.4);
}

.lykhubs-audioplayer-btn-play i {
    margin-left: 3px;
}

/* === Contrôle du volume === */
.lykhubs-audioplayer-volume {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 26px;
    height: 26px;
}

.lykhubs-audioplayer-volume-icon {
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lykhubs-audioplayer-volume:hover .lykhubs-audioplayer-volume-icon {
    color: #fff;
    transform: scale(1.1);
}

.lykhubs-audioplayer-volume-slider {
    position: absolute;
    left: -80px;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1;
}

.lykhubs-audioplayer-volume:hover .lykhubs-audioplayer-volume-slider {
    opacity: 1;
    visibility: visible;
}

.lykhubs-audioplayer-volume-level {
    position: absolute;
    left: 0;
    top: 0;
    width: 70%;
    height: 100%;
    background: linear-gradient(to right, #e40046, #ff1a5c);
    border-radius: 3px;
    transition: width 0.2s ease;
}

/* === Animation des barres pendant la lecture === */
@keyframes pulse {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1.2);
    }
}

.lykhubs-audioplayer-bar.played.playing {
    animation: pulse 0.3s ease-in-out infinite;
}

.lykhubs-audioplayer-bar:not(.played) {
    animation: none !important;
}

/* === Responsive === */
@media (max-width: 768px) {
    .lykhubs-audioplayer-container {
        padding: 15px 15px;
        border-radius: 15px 15px 0 0;
    }

    .lykhubs-audioplayer-close {
        width: 22px;
        height: 22px;
        font-size: 13px;
        top: 5px;
        right: 8px;
    }

    .lykhubs-audioplayer-info {
        gap: 12px;
        margin-bottom: 10px;
    }

    .lykhubs-audioplayer-cover {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }

    .lykhubs-audioplayer-title {
        font-size: 0.95rem;
    }

    .lykhubs-audioplayer-artist {
        font-size: 0.75rem;
    }

    .lykhubs-audioplayer-timeline {
        height: 38px;
    }

    .lykhubs-audioplayer-btn-play {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .lykhubs-audioplayer-actions {
        top: -28px;
        gap: 4px;
    }

    .lykhubs-audioplayer-btn-action {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .lykhubs-audioplayer-volume {
        width: 24px;
        height: 24px;
    }

    .lykhubs-audioplayer-volume-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .lykhubs-audioplayer-volume-slider {
        width: 60px;
        left: -65px;
    }

    .lykhubs-audioplayer-time-left {
        gap: 10px;
    }

    .lykhubs-audioplayer-listeners {
        font-size: 0.7rem;
    }

    .lykhubs-audioplayer-listeners-text {
        font-size: 0.65rem;
    }

    .lykhubs-audioplayer-listeners-icon {
        width: 7px;
        height: 7px;
    }

    .lykhubs-audioplayer-total-listens {
        font-size: 0.7rem;
        gap: 4px;
    }

    .lykhubs-audioplayer-total-listens i {
        font-size: 0.65rem;
    }

    .lykhubs-audioplayer-total-listens-text {
        font-size: 0.65rem;
    }
}

/* === File d'attente === */
.lykhubs-audioplayer-queue-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e40046;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lykhubs-audioplayer-queue-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 400px;
    background: rgba(30, 30, 30, 0.98);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.lykhubs-audioplayer-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lykhubs-audioplayer-queue-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lykhubs-audioplayer-queue-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    background: rgba(228, 0, 70, 0.3);
    color: #e40046;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0 8px;
    margin-left: 5px;
}

.lykhubs-audioplayer-queue-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lykhubs-audioplayer-queue-close:hover {
    background: rgba(228, 0, 70, 0.8);
    transform: rotate(90deg);
}

.lykhubs-audioplayer-queue-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 10px;
}

.lykhubs-audioplayer-queue-list::-webkit-scrollbar {
    width: 6px;
}

.lykhubs-audioplayer-queue-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.lykhubs-audioplayer-queue-list::-webkit-scrollbar-thumb {
    background: rgba(228, 0, 70, 0.5);
    border-radius: 3px;
}

.lykhubs-audioplayer-queue-list::-webkit-scrollbar-thumb:hover {
    background: rgba(228, 0, 70, 0.7);
}

.lykhubs-audioplayer-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.lykhubs-audioplayer-queue-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lykhubs-audioplayer-queue-item-info {
    cursor: pointer;
}

.lykhubs-audioplayer-queue-item-number {
    width: 24px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
}

.lykhubs-audioplayer-queue-item-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: linear-gradient(135deg, #e40046 0%, #c3003e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.lykhubs-audioplayer-queue-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lykhubs-audioplayer-queue-item-info {
    flex: 1;
    min-width: 0;
}

.lykhubs-audioplayer-queue-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lykhubs-audioplayer-queue-item-artist {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lykhubs-audioplayer-queue-item-duration {
    font-size: 0.8rem;
    color: #999;
    flex-shrink: 0;
}

.lykhubs-audioplayer-queue-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    flex-shrink: 0;
    opacity: 0;
}

.lykhubs-audioplayer-queue-item:hover .lykhubs-audioplayer-queue-item-remove {
    opacity: 1;
}

.lykhubs-audioplayer-queue-item-remove:hover {
    background: rgba(228, 0, 70, 0.2);
    color: #e40046;
    transform: scale(1.1);
}

.lykhubs-audioplayer-queue-item-remove:active {
    transform: scale(0.95);
}

/* === Responsive Queue === */
@media (max-width: 768px) {
    .lykhubs-audioplayer-queue-panel {
        max-height: 300px;
    }

    .lykhubs-audioplayer-queue-list {
        max-height: 240px;
    }

    .lykhubs-audioplayer-queue-item {
        padding: 8px;
        gap: 10px;
    }

    .lykhubs-audioplayer-queue-item-cover {
        width: 36px;
        height: 36px;
    }

    .lykhubs-audioplayer-queue-item-remove {
        opacity: 1;
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}
