/**
 * Styles pour le lecteur de musique Online Music Player
 */

/* Conteneur principal */
.omp-player {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.omp-player-inner {
    padding: 20px;
}

/* Messages d'erreur */
.omp-error {
    color: #dc3232;
    background: #fef0f0;
    padding: 12px;
    border-left: 4px solid #dc3232;
    margin: 10px 0;
}

/* Informations de la piste actuelle */
.omp-current-track {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.omp-track-artwork {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.omp-track-artwork .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: white;
}

.omp-track-details {
    flex: 1;
    min-width: 0;
}

.omp-track-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.omp-track-artist {
    font-size: 14px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barre de progression */
.omp-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.omp-time {
    font-size: 12px;
    color: #7f8c8d;
    min-width: 40px;
    text-align: center;
}

.omp-progress-bar {
    flex: 1;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.omp-progress-bar:hover {
    height: 8px;
}

.omp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.omp-progress-bar-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #764ba2;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.omp-progress-bar:hover .omp-progress-bar-handle {
    opacity: 1;
}

/* Contrôles */
.omp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.omp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #2c3e50;
}

.omp-btn:hover {
    background: #ecf0f1;
    transform: scale(1.1);
}

.omp-btn:active {
    transform: scale(0.95);
}

.omp-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.omp-btn-play .dashicons,
.omp-btn-pause .dashicons {
    width: 30px;
    height: 30px;
    font-size: 30px;
}

.omp-btn-play,
.omp-btn-pause {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
}

.omp-btn-play:hover,
.omp-btn-pause:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
    transform: scale(1.15);
}

.omp-btn.active {
    color: #764ba2;
    background: #ecf0f1;
}

/* Contrôle du volume */
.omp-volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.omp-volume-slider {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.omp-volume-control:hover .omp-volume-slider {
    width: 80px;
    opacity: 1;
}

.omp-volume-range {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    background: #ecf0f1;
}

.omp-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #764ba2;
    cursor: pointer;
}

.omp-volume-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #764ba2;
    cursor: pointer;
    border: none;
}

.omp-btn-volume.muted {
    color: #e74c3c;
}

/* Toggle playlist */
.omp-playlist-toggle {
    text-align: center;
    margin-bottom: 10px;
}

.omp-btn-playlist {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.omp-btn-playlist:hover {
    background: #d5dbdd;
}

.omp-playlist-count {
    font-weight: 500;
}

/* Playlist */
.omp-playlist {
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.omp-playlist-header {
    background: #2c3e50;
    color: white;
    padding: 12px 15px;
}

.omp-playlist-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.omp-playlist-items {
    max-height: 300px;
    overflow-y: auto;
}

.omp-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #e9ecef;
}

.omp-playlist-item:hover {
    background: #e9ecef;
}

.omp-playlist-item.active {
    background: #667eea;
    color: white;
}

.omp-playlist-item.active .omp-playlist-item-artist,
.omp-playlist-item.active .omp-playlist-item-duration {
    color: rgba(255, 255, 255, 0.8);
}

.omp-playlist-item-number {
    font-size: 14px;
    font-weight: 600;
    color: #95a5a6;
    min-width: 25px;
    text-align: center;
}

.omp-playlist-item.active .omp-playlist-item-number {
    color: white;
}

.omp-playlist-item.playing .omp-playlist-item-number::before {
    content: "♫";
    animation: pulse 1s infinite;
}

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

.omp-playlist-item-info {
    flex: 1;
    min-width: 0;
}

.omp-playlist-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.omp-playlist-item-artist {
    font-size: 12px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.omp-playlist-item-duration {
    font-size: 12px;
    color: #95a5a6;
}

/* Scrollbar personnalisée pour la playlist */
.omp-playlist-items::-webkit-scrollbar {
    width: 6px;
}

.omp-playlist-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.omp-playlist-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.omp-playlist-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 600px) {
    .omp-player-inner {
        padding: 15px;
    }

    .omp-track-artwork {
        width: 60px;
        height: 60px;
    }

    .omp-track-artwork .dashicons {
        font-size: 30px;
        width: 30px;
        height: 30px;
    }

    .omp-track-title {
        font-size: 16px;
    }

    .omp-track-artist {
        font-size: 13px;
    }

    .omp-controls {
        gap: 5px;
    }

    .omp-btn {
        padding: 6px;
    }

    .omp-volume-control {
        display: none;
    }
}

/* État de chargement */
.omp-player.loading .omp-btn {
    opacity: 0.5;
    pointer-events: none;
}
