/* try-yourself.css - gravar a propria voz ao lado de cada botao de som.
   Usado por todas as licoes atraves do include try-yourself.html.

   direction:ltr nas linhas novas e OBRIGATORIO: os cards das licoes herdam
   RTL da pagina e sem isso a ordem dos botoes aparece espelhada. */

.try-row {
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.try-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.try-host.is-recording .try-label { color: #fca5a5; }
.try-host.has-take .try-label { color: #6ee7b7; }

.mic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fca5a5;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    padding: 0;
    flex: none;
}

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

.mic-btn:not(:disabled):hover {
    background: rgba(248, 113, 113, 0.22);
    transform: translateY(-2px);
}

.mic-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Gravando: vira quadrado de stop, pulsando. */
.mic-btn[data-state="recording"] {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    50%      { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
}

/* Linha de revisao: so nasce depois que existe uma gravacao. */
.rec-row {
    direction: ltr;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.try-host.has-take .rec-row { display: flex; }

.rec-row button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
    transition: background 0.2s ease;
}

.rec-row button:hover { background: rgba(255, 255, 255, 0.12); }

/* Icone antes do rotulo: "You" e "Delete" tem que se explicar de
   relance, sem o aluno precisar ler. */
.rec-row button svg { width: 11px; height: 11px; flex: none; }

.del-btn { border-color: rgba(248, 113, 113, 0.4) !important; color: #fca5a5 !important; }

.cmp-btn {
    border-color: rgba(52, 211, 153, 0.5) !important;
    color: #6ee7b7 !important;
}

.try-host.is-recording {
    border-color: #ef4444 !important;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.35);
}

.try-host.has-take { border-color: rgba(52, 211, 153, 0.55) !important; }

.rec-status {
    direction: ltr;
    display: block;
    margin-top: 6px;
    font-size: 0.68rem;
    color: #94a3b8;
    min-height: 1em;
}

.rec-warning {
    direction: ltr;
    margin: 0 auto 20px;
    max-width: 900px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.10);
    color: #fcd34d;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Barra "apagar tudo": so aparece quando ja existe alguma gravacao. */
.rec-bar {
    direction: ltr;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: #94a3b8;
}

body.has-any-take .rec-bar { display: flex; }

.rec-bar__clear {
    background: none;
    border: none;
    color: #94a3b8;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
}

.rec-bar__clear:hover { color: #cbd5e1; }

@media (prefers-reduced-motion: reduce) {
    .mic-btn[data-state="recording"] { animation: none; }
}
