/* Barre audio persistante KMP Classic - Style identique au plugin WooCommerce */

.kmp-classic-persistent-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(26, 26, 26, 0.35));
    color: white;
    padding: 12px 20px;
    z-index: 99999;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.kmp-classic-bar-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    padding-left: 30px; /* AJOUT : Espace minimum à gauche pour le CD */
}

/* ===== ZONE 1: COVER AVEC CD ANIMATION ===== */
.kmp-classic-bar-cover {
    flex-shrink: 0;
    position: relative; /* AJOUT : Pour positionner le CD */
    overflow: visible;  /* AJOUT : Permet au CD de dépasser */
}

.kmp-classic-bar-cover-img {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2; /* AJOUT : Cover au-dessus du CD */
}

/* ===== ANIMATION CD ===== */
.kmp-classic-bar-cd-animation {
    position: absolute;
    top: 50%;
    left: -30%; /* Le CD dépasse du cover vers la gauche */
    transform: translateY(-50%);
    z-index: 1; /* En arrière-plan du cover */
    width: 80px;
    height: 80px;
}

.kmp-classic-bar-cd-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: cdRotate 3s linear infinite;
    animation-play-state: paused; /* Par défaut en pause */
}

/* Animation de rotation */
@keyframes cdRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* États de l'animation */
.kmp-classic-bar-cd-animation.playing .kmp-classic-bar-cd-img {
    animation-play-state: running;
}

.kmp-classic-bar-cd-animation.paused .kmp-classic-bar-cd-img {
    animation-play-state: paused;
}

/* Accessibilité : Respecter les préférences de mouvement */
@media (prefers-reduced-motion: reduce) {
    .kmp-classic-bar-cd-img {
        animation: none;
    }
}

/* ===== ZONE 2+3: CENTRE ===== */
.kmp-classic-bar-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Zone 2: Ligne du haut (Contrôles + Info) */
.kmp-classic-bar-top-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.kmp-classic-bar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.kmp-classic-bar-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kmp-classic-bar-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.kmp-classic-bar-controls button:active {
    transform: scale(0.95);
}

.kmp-classic-bar-controls button .dashicons {
    font-size: 16px;
    line-height: 1;
}

/* Bouton play/pause spécial */
.kmp-classic-bar-play-pause {
    background: #0073aa !important;
    border-color: #005177 !important;
    font-size: 18px !important;
}

.kmp-classic-bar-play-pause:hover {
    background: #005177 !important;
}

/* Par défaut : play */
.kmp-classic-bar-play-pause:after {
    content: "\f04b";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Quand en lecture : pause */
.kmp-classic-bar-play-pause.playing:after {
    content: "\f04c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Masquer le contenu HTML */
.kmp-classic-bar-play-pause {
    font-size: 0 !important;
}

.kmp-classic-bar-play-pause:after {
    font-size: 18px !important;
}

/* Fix pour le bouton play/pause - masquer l'icône pause par défaut */
.kmp-classic-bar-play-pause .fa-pause {
    display: none;
}

/* Quand en lecture : masquer play, montrer pause */
.kmp-classic-bar-play-pause.playing .fa-play {
    display: none;
}

.kmp-classic-bar-play-pause.playing .fa-pause {
    display: inline;
}

/* Quand en pause : montrer play, masquer pause */
.kmp-classic-bar-play-pause.paused .fa-play {
    display: inline;
}

.kmp-classic-bar-play-pause.paused .fa-pause {
    display: none;
}

.kmp-classic-bar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0px;
}

.kmp-classic-bar-title {
    display: block;
    font-weight: bold;
    font-size: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
    line-height: 1.1;
}

.kmp-classic-bar-artist {
    display: block;
    font-size: 18px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0;
    line-height: 1.1;
}

/* ===== ZONE 3: BARRE DE PROGRESSION ===== */
.kmp-classic-bar-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.kmp-classic-bar-time-current,
.kmp-classic-bar-time-total {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 35px;
    text-align: center;
}

.kmp-classic-bar-progress-wrapper {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.kmp-classic-bar-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
}

.kmp-classic-bar-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #0066cc, #0099ff);
    border-radius: 8px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.kmp-classic-bar-progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kmp-classic-bar-progress-wrapper:hover .kmp-classic-bar-progress-bar::after {
    opacity: 1;
}

/* ===== ZONE 4: DROITE (Volume + Fermer) ===== */
.kmp-classic-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.kmp-classic-bar-volume {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kmp-classic-bar-mute {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kmp-classic-bar-mute:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Personnalisation barre de volume */
.kmp-classic-bar-volume-slider {
    width: 80px;
    height: 6px;
    border-radius: 2px;
    background: #5d2727 !important;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Curseur rond blanc sans bordure */
.kmp-classic-bar-volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: white !important;
    cursor: pointer;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pour Firefox */
.kmp-classic-bar-volume-slider::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: white !important;
    cursor: pointer;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pour Edge/IE */
.kmp-classic-bar-volume-slider::-ms-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: white !important;
    cursor: pointer;
    border: none !important;
}

.kmp-classic-bar-close {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 24px !important;
    cursor: pointer;
    padding: 5px 10px !important;
    line-height: 1;
    transition: color 0.3s ease;
}

.kmp-classic-bar-close:hover {
    color: white !important;
}

/* Animation d'apparition */
.kmp-classic-persistent-bar.show {
    display: block !important;
    animation: slideDown 0.4s ease-out;
}

.kmp-classic-persistent-bar.hide {
    animation: slideUp 0.3s ease-in;
}

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

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

/* Décaler le contenu quand la barre est visible */
body.kmp-classic-bar-active {
    padding-top: 75px !important;
    transition: padding-top 0.4s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .kmp-classic-bar-content {
        gap: 10px;
        padding-left: 20px; /* AJOUT : Espace réduit sur mobile */
    }
    
    .kmp-classic-bar-top-row {
        gap: 10px;
    }
    
    .kmp-classic-bar-title,
    .kmp-classic-bar-artist {
        font-size: 12px;
    }
    
    .kmp-classic-bar-volume-slider {
        width: 60px;
    }
    
    .kmp-classic-bar-controls {
        gap: 5px;
    }
    
    .kmp-classic-bar-controls button {
        width: 35px;
        height: 35px;
    }
    
    .kmp-classic-bar-progress-container {
        gap: 6px;
    }
    
    .kmp-classic-bar-time-current,
    .kmp-classic-bar-time-total {
        font-size: 10px;
        min-width: 30px;
    }
    
    .kmp-classic-bar-progress-wrapper {
        height: 16px;
    }
    
    /* Responsive CD animation */
    .kmp-classic-bar-cd-animation {
        width: 70px;
        height: 70px;
        left: -25%;
    }
}

/* Très petits écrans - CD à l'intérieur pour éviter débordement */
@media (max-width: 480px) {
    .kmp-classic-bar-content {
        padding-left: 15px; /* AJOUT : Espace encore plus réduit */
    }
    
    .kmp-classic-bar-cd-animation {
        width: 50px;
        height: 50px;
        left: 8px;
        top: 8px;
        transform: none;
    }
}