/* Variables CSS pour la personnalisation */
:root {
    --slive-primary: #F1E12F;
    --slive-secondary: #1E73BE;
    --slive-bg: #1E73BE;
    --slive-text: #000000;
    --slive-text-light: #000000;
    --slive-border: #1E73BE;
    --slive-shadow: 0 -4px 20px #1E73BE;
    --slive-height: 70px;
    --slive-z-index: 9999;
}

/* Barre audio principale */
.slive-audio-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--slive-height);
    background: var(--slive-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--slive-border);
    box-shadow: var(--slive-shadow);
    z-index: var(--slive-z-index);
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

.slive-audio-bar.hidden {
    transform: translateY(100%);
}

.audio-bar-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

/* Section pochette */
.cover-section {
    flex-shrink: 0;
}

.cover-container {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cover-container:hover .cover-image {
    transform: scale(1.05);
}

/* Mini visualiseur */
.mini-visualizer {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mini-visualizer.active {
    opacity: 1;
}

.mini-bar {
    width: 2px;
    height: 8px;
    background: linear-gradient(to top, var(--slive-primary), var(--slive-secondary));
    border-radius: 1px;
    animation: miniVisualize 1s ease-in-out infinite alternate;
}

.mini-bar:nth-child(2) { animation-delay: 0.1s; }
.mini-bar:nth-child(3) { animation-delay: 0.2s; }

@keyframes miniVisualize {
    0% { height: 3px; }
    100% { height: 8px; }
}

/* Section informations de la piste */
.track-section {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--slive-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 2px;
}

.track-artist {
    font-size: 12px;
    color: var(--slive-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Animation de défilement pour les textes longs */
.track-title.scrolling,
.track-artist.scrolling {
    animation: scrollText 10s linear infinite;
}

@keyframes scrollText {
    0%, 20% { transform: translateX(0); }
    80%, 100% { transform: translateX(-100%); }
}

/* Section contrôles */
.controls-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.play-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px #1E73BE;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px #1E73BE;
}

.play-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Section volume */
.volume-section {
    position: relative;
    display: flex;
    align-items: center;
}

.volume-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    color: var(--slive-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
      opacity: 0;
    visibility: hidden;}

.volume-button:hover {
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
}

.volume-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.volume-control {
    opacity: 1 !important;
    visibility: visible !important;
}



.volume-slider {
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Section statut */
.status-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.loading {
    background: #FF9800;
}

.status-dot.error {
    background: #F44336;
}

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

.close-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    color: #F44336;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    transform: scale(1.05);
}

.close-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Barre de progression */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--slive-primary), var(--slive-secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* Bouton pour réafficher la barre */
.show-audio-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--slive-primary), var(--slive-secondary));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: calc(var(--slive-z-index) - 1);
    transition: all 0.3s ease;
}

.show-audio-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.show-audio-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Responsive Design */
@media (max-width: 768px) {
    .audio-bar-container {
        padding: 0 15px;
        gap: 10px;
    }
    
    .cover-container {
        width: 45px;
        height: 45px;
    }
    
    .track-title {
        font-size: 13px;
    }
    
    .track-artist {
        font-size: 11px;
    }
    
    .play-button {
        width: 36px;
        height: 36px;
    }
    
    .play-button svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .audio-bar-container {
        padding: 0 10px;
        gap: 8px;
    }
    
    .cover-container {
        width: 40px;
        height: 40px;
    }
    
    .track-section {
        padding: 0 5px;
    }
    
    .volume-control {
        position: fixed;
        bottom: 80px;
        right: 10px;
        left: auto;
        transform: none;
    }
    
    .volume-slider {
        width: 60px;
    }
}

/* Mode sombre (détection automatique) */
@media (prefers-color-scheme: dark) {
    :root {
        --slive-bg: rgba(30, 30, 30, 0.95);
        --slive-text: #000000;
        --slive-text-light: #000000;
        --slive-border: rgba(102, 126, 234, 0.3);
        --slive-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Animations d'entrée */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slive-audio-bar.entering {
    animation: slideUp 0.5s ease-out;
}

/* États de chargement */
.loading .track-title::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

