/* ============================================================
   CAW MEDIA PLAYER — Lecteur audio/vidéo moderne
   ============================================================ */

/* --- AUDIO : pill arrondi --- */
.caw-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    background: #9febc9;
    border-radius: 9999px;
    box-shadow: 0 2px 10px rgba(44, 123, 47, 0.08);
    max-width: 100%;
    width: auto;
    font-family: var(--font-body, 'Inter', sans-serif);
    transition: box-shadow 0.25s ease;
    direction: ltr;
}

.caw-player:hover {
    box-shadow: 0 4px 16px rgba(44, 123, 47, 0.15);
}

/* Bouton play */
.caw-player__play {
    background: linear-gradient(135deg, var(--agri-green, #2c7b2f), #40916c);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(44, 123, 47, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.caw-player__play:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(44, 123, 47, 0.4);
}

.caw-player__play svg { display: block; }

/* Info (titre + temps) */
.caw-player__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    /* min-width: 90px; */
    flex-shrink: 0;
}

.caw-player__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a4d3a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.caw-player__time {
    font-size: 0.85rem;
    color: #007166;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* Barre de progression */
.caw-player__progress {
    flex: 1;
    height: 15px;
    background: linear-gradient(90deg, #000000, #bbbbbb);
    border-radius: 9999px;
    cursor: pointer;
    position: relative;
    min-width: 40px;
    overflow: hidden;
    transition: height 0.2s ease;
}

.caw-player__progress:hover {height: 17px;}

.caw-player__progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2196F3, #a9ff00);
    border-radius: 9999px;
    transition: width 0.1s linear;
}

/* Bouton volume */
.caw-player__volume {
    background: transparent;
    border: none;
    color: #6a7f6a;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.caw-player__volume:hover {
    background: rgba(44, 123, 47, 0.1);
    color: #2c7b2f;
}

/* Audio caché (contrôles natifs désactivés) */
.caw-player__native { display: none; }

/* Message d'erreur */
.caw-player__error {
    padding: 1rem;
    background: #fff0f0;
    color: #c0392b;
    border-radius: 8px;
    border-left: 4px solid #c0392b;
    font-size: 0.9rem;
}

/* --- VIDÉO : conteneur responsive --- */
.caw-video {
    width: 100%;
    max-width: 100%;
    margin: 1rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: #000;
}

.caw-video__el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- RTL --- */
[dir="rtl"] .caw-player {
    direction: ltr;   /* la timeline reste LTR */
}

/* --- Mobile --- */
@media (max-width: 575px) {
    .caw-player {
        padding: 0.5rem 0.8rem;
        gap: 0.5rem;
    }
    .caw-player__play { width: 36px; height: 36px; }
    .caw-player__title { max-width: 100px; font-size: 0.75rem; }
    .caw-player__volume { display: none; }
    .caw-player__progress { min-width: 80px; }
}