/* AN Audio Reader v2.1.0 · AlexNews */

.anar-player {
    background: linear-gradient(135deg, #0a1018, #16233a);
    border: 1px solid rgba(232, 21, 27, 0.25);
    border-left: 4px solid #0B5FFF;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 24px;
    font-family: 'Inter', 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Estado desabilitado ──────────────────────────────────────────────────── */
.anar-player--disabled {
    border-left-color: #2d3748;
    opacity: 0.65;
}

/* ── Layout interno ──────────────────────────────────────────────────────── */
.anar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ── Botão play ──────────────────────────────────────────────────────────── */
.anar-btn-play {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: #0B5FFF;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    flex-shrink: 0;
}

.anar-btn-play svg {
    width: 18px;
    height: 18px;
}

.anar-btn-play:hover {
    background: #0949cc;
    box-shadow: 0 0 16px rgba(232, 21, 27, 0.5);
}

.anar-btn-play:active {
    transform: scale(0.92);
}

.anar-btn-play--playing {
    background: #0949cc;
}

.anar-btn-play--disabled {
    background: #2d3748;
    cursor: not-allowed;
}

.anar-btn-play--disabled:hover {
    background: #2d3748;
    box-shadow: none;
}

/* ── Área central ────────────────────────────────────────────────────────── */
.anar-middle {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.anar-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.anar-label {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.anar-time {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.anar-status-msg {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Barra de progresso ──────────────────────────────────────────────────── */
.anar-progress-wrap {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}

.anar-progress-wrap:hover {
    height: 7px;
}

.anar-progress-wrap--disabled {
    cursor: default;
}

.anar-progress-wrap--disabled:hover {
    height: 5px;
}

.anar-progress-bar {
    height: 100%;
    background: #0B5FFF;
    border-radius: 3px;
    width: 0%;
    transition: width 0.25s linear;
    pointer-events: none;
}

/* ── Waveform animada ────────────────────────────────────────────────────── */
.anar-waveform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    gap: 2px;
    margin-top: 2px;
}

.anar-waveform .anar-bar {
    flex: 1;
    border-radius: 2px;
    background: rgba(232, 21, 27, 0.25);
    transition: background 0.3s;
    /* altura animada via JS inline style */
}

/* Quando tocando: barras ficam vermelhas e animam */
.anar-player--playing .anar-waveform .anar-bar {
    background: rgba(232, 21, 27, 0.7);
    animation: anar-pulse var(--anar-dur, 0.8s) ease-in-out infinite alternate;
    animation-delay: var(--anar-delay, 0s);
}

@keyframes anar-pulse {
    0%   { transform: scaleY(0.25); }
    100% { transform: scaleY(1); }
}

/* Barras já tocadas (antes do cursor de progresso) — mais brilhantes */
.anar-player--playing .anar-waveform .anar-bar.anar-bar--played {
    background: #0B5FFF;
}

/* Estado pausado: barras congelam mas mantêm cor levemente ativa */
.anar-player--paused .anar-waveform .anar-bar {
    background: rgba(232, 21, 27, 0.4);
    animation: none;
}

.anar-player--paused .anar-waveform .anar-bar.anar-bar--played {
    background: rgba(232, 21, 27, 0.6);
}

/* ── Velocidades ─────────────────────────────────────────────────────────── */
.anar-speeds {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.anar-speeds--disabled .anar-speed {
    opacity: 0.35;
    cursor: not-allowed;
}

.anar-speed {
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.anar-speed:not(:disabled):hover {
    border-color: rgba(232, 21, 27, 0.5);
    color: #e2e8f0;
}

.anar-speed-active {
    background: rgba(232, 21, 27, 0.15);
    border-color: #0B5FFF !important;
    color: #7db4ff !important;
}

/* ── Audio element oculto ────────────────────────────────────────────────── */
#anar-audio {
    display: none;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .anar-player {
        padding: 12px 12px;
    }

    .anar-inner {
        gap: 10px;
    }

    .anar-btn-play {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .anar-btn-play svg {
        width: 15px;
        height: 15px;
    }

    .anar-speeds {
        flex-direction: row;
        gap: 4px;
    }

    .anar-speed {
        padding: 4px 7px;
        font-size: 10px;
    }

    .anar-label {
        font-size: 12px;
    }

    .anar-time,
    .anar-status-msg {
        font-size: 10px;
    }

    .anar-waveform {
        height: 18px;
    }
}
