/**
 * Je Travel Podcast - Styles du Lecteur Audio Front-End
 * Respect des tokens du Brand Book Officiel v5.0
 * 
 * @package JeTravelPodcast
 */

.jtp-audio-player-wrapper {
    font-family: var(--jtp-font-body);
    margin: 25px 0;
    width: 100%;
}

.jtp-player-card {
    background: var(--jtp-color-white);
    border: 1px solid var(--jtp-color-gray-border);
    border-radius: var(--jtp-radius-lg);
    box-shadow: var(--jtp-shadow-md);
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: var(--jtp-transition);
}

.jtp-player-card:hover {
    box-shadow: var(--jtp-shadow-lg);
    border-color: #cbd5e1;
}

/* Pochette */
.jtp-player-cover {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: var(--jtp-radius-md);
    overflow: hidden;
    box-shadow: var(--jtp-shadow-sm);
}

.jtp-player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Corps du lecteur */
.jtp-player-main {
    flex: 1;
    min-width: 0;
}

.jtp-player-header {
    margin-bottom: 12px;
}

.jtp-player-now-playing {
    font-family: var(--jtp-font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--jtp-color-blue);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.jtp-player-title {
    font-family: var(--jtp-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--jtp-color-navy);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barre de progression */
.jtp-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.jtp-time-current,
.jtp-time-duration {
    font-family: var(--jtp-font-body);
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    min-width: 42px;
}

.jtp-time-duration {
    text-align: right;
}

.jtp-progress-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--jtp-radius-full);
    position: relative;
    cursor: pointer;
    overflow: visible;
}

.jtp-progress-track:focus-visible {
    outline: 2px solid var(--jtp-color-blue);
    outline-offset: 2px;
}

.jtp-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #cbd5e1;
    border-radius: var(--jtp-radius-full);
    width: 0%;
    transition: width 0.2s ease;
}

.jtp-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--jtp-color-blue);
    border-radius: var(--jtp-radius-full);
    width: 0%;
    pointer-events: none;
}

.jtp-progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--jtp-color-navy);
    border: 2px solid var(--jtp-color-white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.jtp-progress-track:hover .jtp-progress-handle,
.jtp-progress-track:focus-visible .jtp-progress-handle {
    opacity: 1;
}

/* Contrôles du lecteur */
.jtp-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.jtp-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--jtp-color-navy);
    transition: var(--jtp-transition);
    padding: 6px;
    border-radius: 50%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.jtp-control-btn * {
    pointer-events: none;
}

.jtp-control-btn:focus-visible {
    outline: 2px solid var(--jtp-color-blue);
    outline-offset: 2px;
}

.jtp-control-btn:hover {
    color: var(--jtp-color-blue);
    background: var(--jtp-color-blue-pale);
}

/* Bouton Play/Pause Principal */
.jtp-btn-play-pause {
    width: 46px;
    height: 46px;
    background: var(--jtp-btn-action-bg) !important;
    color: var(--jtp-btn-action-text) !important;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.35);
}

.jtp-btn-play-pause:hover {
    background: var(--jtp-btn-action-hover-bg) !important;
    color: var(--jtp-color-white) !important;
    transform: scale(1.05);
}

.jtp-btn-play-pause svg {
    margin-left: 2px; /* Centrage optique icône play */
}

.jtp-btn-play-pause.is-playing svg {
    margin-left: 0;
}

/* Recul 15s / Avance 30s */
.jtp-btn-rewind,
.jtp-btn-forward {
    position: relative;
    border-radius: 8px;
    padding: 6px 10px;
    gap: 2px;
}

.jtp-skip-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--jtp-font-heading);
}

/* Sélecteur de vitesse */
.jtp-btn-speed {
    border-radius: var(--jtp-radius-full);
    background: var(--jtp-color-gray-light);
    padding: 4px 10px;
    font-family: var(--jtp-font-heading);
    font-weight: 700;
    font-size: 11px;
    color: var(--jtp-color-navy);
}

.jtp-btn-speed:hover {
    background: var(--jtp-color-yellow-pale);
    color: var(--jtp-color-navy);
}

/* Volume */
.jtp-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.jtp-volume-slider-track {
    width: 60px;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--jtp-radius-full);
    position: relative;
    cursor: pointer;
}

.jtp-volume-slider-track:focus-visible {
    outline: 2px solid var(--jtp-color-blue);
}

.jtp-volume-fill {
    height: 100%;
    background: var(--jtp-color-blue);
    border-radius: var(--jtp-radius-full);
}

/* Responsive Mobile */
@media (max-width: 600px) {
    .jtp-player-card {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .jtp-player-cover {
        width: 100%;
        height: 160px;
        margin-bottom: 8px;
    }

    .jtp-player-controls {
        justify-content: space-between;
    }

    .jtp-volume-slider-track {
        display: none;
    }
}

/* Section Chapitres Horodatés */
.jtp-player-chapters-wrapper {
    margin-top: 15px;
    border-top: 1px solid var(--jtp-color-gray-border);
    padding-top: 10px;
    width: 100%;
}

.jtp-player-chapters-details {
    font-size: 13px;
}

.jtp-player-chapters-summary {
    cursor: pointer;
    font-family: var(--jtp-font-heading);
    font-weight: 700;
    color: var(--jtp-color-navy);
    padding: 6px 0;
    user-select: none;
    outline: none;
    transition: var(--jtp-transition);
}

.jtp-player-chapters-summary:hover {
    color: var(--jtp-color-blue);
}

.jtp-player-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;
}

.jtp-player-chapter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--jtp-radius-sm);
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    transition: var(--jtp-transition);
    width: 100%;
    font-family: var(--jtp-font-body);
}

.jtp-player-chapter-item:hover {
    background: var(--jtp-color-blue-pale);
    border-color: #93c5fd;
    transform: translateX(2px);
}

.jtp-player-chapter-item.is-active {
    background: #eff6ff;
    border-color: var(--jtp-color-blue);
    box-shadow: 0 0 0 1px var(--jtp-color-blue);
}

.jtp-chapter-badge {
    background: var(--jtp-color-navy);
    color: #ffffff;
    font-family: var(--jtp-font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.jtp-player-chapter-item.is-active .jtp-chapter-badge {
    background: var(--jtp-color-blue);
}

.jtp-chapter-title {
    font-weight: 600;
    color: var(--jtp-color-navy);
    font-size: 13px;
    flex: 1;
}

.jtp-chapter-desc {
    color: #64748b;
    font-size: 12px;
    display: none;
}

@media (min-width: 768px) {
    .jtp-chapter-desc {
        display: block;
    }
}
