/**
 * Audio Player 120 - Styles
 */

/* Container principal */
.ap120-container {
    position: relative;
    max-width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ap120-container * {
    box-sizing: border-box;
}

/* Titre */
.ap120-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Audio caché */
.ap120-audio {
    display: none;
}

/* Contrôles */
.ap120-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Boutons */
.ap120-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ap120-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.ap120-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Bouton Play/Pause principal */
.ap120-play-pause {
    background: #4CAF50;
    width: 48px;
    height: 48px;
}

.ap120-play-pause:hover {
    background: #45a049;
}

.ap120-play-pause svg {
    width: 24px;
    height: 24px;
}

/* Barre de progression */
.ap120-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.ap120-progress-bar {
    position: relative;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.ap120-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    width: 0%;
    transition: width 0.1s ease;
}

.ap120-progress-current {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #4CAF50;
    width: 0%;
    border-radius: 3px;
}

.ap120-progress-input {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 22px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

/* Temps */
.ap120-current-time,
.ap120-duration {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

/* Rewind/Forward */
.ap120-rewind,
.ap120-forward {
    width: 36px;
    height: 36px;
}

.ap120-rewind svg,
.ap120-forward svg {
    width: 18px;
    height: 18px;
}

/* Volume */
.ap120-volume-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ap120-mute {
    width: 36px;
    height: 36px;
}

.ap120-volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
}

.ap120-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.ap120-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ap120-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Menu vitesse */
.ap120-speed-container {
    position: relative;
}

.ap120-speed-btn {
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 50px;
}

.ap120-speed-value {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.ap120-speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 80px;
    display: none;
    z-index: 30;
    margin-bottom: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ap120-speed-container.open .ap120-speed-menu {
    display: block;
}

.ap120-speed-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ap120-speed-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ap120-speed-option.active {
    color: #4CAF50;
    font-weight: 600;
}

/* Message de reprise */
.ap120-resume-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 25;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ap120-resume-prompt p {
    color: #fff;
    margin: 0 0 15px;
    font-size: 14px;
}

.ap120-resume-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ap120-resume-yes,
.ap120-resume-no {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ap120-resume-yes {
    background: #4CAF50;
    color: #fff;
}

.ap120-resume-yes:hover {
    background: #45a049;
}

.ap120-resume-no {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ap120-resume-no:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Message d'erreur */
.ap120-error {
    color: #f44336;
    padding: 15px;
    text-align: center;
    background: #ffebee;
    border-radius: 8px;
}

/* État en cours de lecture */
.ap120-container.playing .ap120-play-pause {
    background: #ff9800;
}

.ap120-container.playing .ap120-play-pause:hover {
    background: #f57c00;
}

/* Responsive */
@media (max-width: 600px) {
    .ap120-container {
        padding: 15px;
    }

    .ap120-controls {
        gap: 8px;
    }

    .ap120-play-pause {
        width: 42px;
        height: 42px;
    }

    .ap120-play-pause svg {
        width: 20px;
        height: 20px;
    }

    .ap120-btn svg {
        width: 16px;
        height: 16px;
    }

    .ap120-rewind,
    .ap120-forward {
        width: 32px;
        height: 32px;
    }

    .ap120-mute {
        width: 32px;
        height: 32px;
    }

    .ap120-volume-slider {
        width: 60px;
    }

    .ap120-current-time,
    .ap120-duration {
        font-size: 11px;
        min-width: 35px;
    }

    .ap120-progress-container {
        min-width: 150px;
    }

    .ap120-speed-btn {
        padding: 6px 10px;
        min-width: 45px;
    }

    .ap120-speed-value {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ap120-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ap120-progress-container {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }

    .ap120-volume-container {
        display: none;
    }
}
