/*
 * Developer: MexTech Limited
 * Licenced: Naijasearch is officially licenced and authorized to be used from MexTech Limited
 * Copyright: (c) 2026 All Rights Reserved, MexTech Limited (https://mextechltd.name.ng).
 */

.vrec {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field + .vrec {
    margin-top: 12px;
}

.vrec__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.vrec__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.vrec__intro {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vrec__title {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.92rem;
}

.vrec__hint {
    font-size: 0.83rem;
    color: var(--muted);
    line-height: 1.45;
}

.vrec__word {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 340px;
}

.vrec__word label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.vrec__stage {
    border: 1px dashed var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 13px 14px;
}

.vrec__stage[data-state="recording"],
.vrec__stage[data-state="paused"] {
    border-style: solid;
    border-color: var(--brand);
    background: var(--brand-soft);
}

.vrec__idle[hidden],
.vrec__live[hidden],
.vrec__done[hidden],
.vrec__busy[hidden] {
    display: none;
}

.vrec__idle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vrec__rec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--brand);
    border-radius: var(--r-pill);
    background: var(--brand);
    color: var(--on-brand);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.vrec__rec:hover:not([disabled]) {
    transform: translateY(-1px);
}

.vrec__rec[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.vrec__rec-icon {
    display: inline-flex;
}

.vrec__file {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.vrec__file:hover {
    border-color: var(--brand);
}

.vrec__file-icon {
    display: inline-flex;
    color: var(--muted);
}

.vrec__live {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vrec__pulse {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
}

.vrec__pulse i {
    display: block;
    width: 3px;
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--brand);
    animation: vrec-pulse 0.9s ease-in-out infinite;
}

.vrec__pulse i:nth-child(2) {
    animation-delay: 0.12s;
}

.vrec__pulse i:nth-child(3) {
    animation-delay: 0.24s;
}

.vrec__pulse i:nth-child(4) {
    animation-delay: 0.36s;
}

.vrec__pulse i:nth-child(5) {
    animation-delay: 0.48s;
}

.vrec__stage[data-state="paused"] .vrec__pulse i {
    animation-play-state: paused;
    opacity: 0.45;
}

@keyframes vrec-pulse {
    0%, 100% {
        height: 7px;
    }
    50% {
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vrec__pulse i {
        animation: none;
        height: 12px;
    }
}

.vrec__timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
    min-width: 44px;
}

.vrec__live-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}

.vrec__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.vrec__btn:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.vrec__btn--stop {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

.vrec__btn--stop:hover {
    color: var(--on-brand);
    opacity: 0.92;
}

.vrec__btn--ghost {
    color: var(--muted);
}

.vrec__btn.is-paused {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.vrec__done {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vrec__done audio {
    width: 100%;
    height: 38px;
}

.vrec__done-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vrec__size {
    font-size: 0.78rem;
    color: var(--faint);
    margin: 0;
}

.vrec__busy {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.87rem;
}

.vrec__spin {
    display: inline-flex;
    animation: vrec-spin 0.9s linear infinite;
}

@keyframes vrec-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vrec__spin {
        animation: none;
    }
}

.vrec__status {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    min-height: 1px;
}

.vrec__status.is-error {
    color: var(--danger);
}

.vrec__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vrec__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vrec__item .vplayer {
    flex: 1 1 auto;
    min-width: 0;
}

.vrec__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.vrec__remove:hover:not([disabled]) {
    border-color: var(--danger);
    color: var(--danger);
}

.vrec__remove[disabled] {
    opacity: 0.5;
    cursor: progress;
}

.vplayer {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    min-width: 0;
}

.vplayer__toggle,
.vplayer__mute {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-strong);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.vplayer__toggle:hover,
.vplayer__mute:hover {
    background: var(--brand);
    color: var(--on-brand);
}

.vplayer__mute {
    background: transparent;
    color: var(--muted);
}

.vplayer__mute:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.vplayer__icon {
    display: none;
}

.vplayer:not(.is-playing) .vplayer__icon--play {
    display: inline-flex;
}

.vplayer.is-playing .vplayer__icon--pause {
    display: inline-flex;
}

.vplayer .vplayer__icon--on {
    display: inline-flex;
}

.vplayer.is-muted .vplayer__icon--on {
    display: none;
}

.vplayer.is-muted .vplayer__icon--off {
    display: inline-flex;
}

.vplayer__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.vplayer__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.vplayer__caption {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vplayer__clock {
    font-size: 0.74rem;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
    flex: none;
}

.vplayer__word {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

.vplayer__track {
    position: relative;
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--line);
    cursor: pointer;
    overflow: hidden;
}

.vplayer__track:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.vplayer__bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--r-pill);
    background: var(--brand);
}

.voice-block {
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.voice-block__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: var(--brand-strong);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.voice-block__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vrec--compact {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.vrec--compact .vrec__title {
    font-size: 0.86rem;
}

.vrec__rec-text {
    font-weight: 600;
}

.vrec__word label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.voice-block + .voice-block {
    margin-top: 14px;
}

.voice-block__label {
    margin: 0 0 8px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.voice-block--pron,
.voice-block--route {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.pronlist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.pronlist__slot {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.vplayer--route .vplayer__caption {
    color: var(--brand-strong);
}

.vplayer--pronunciation .vplayer__word {
    font-weight: 600;
    color: var(--ink);
}

@media (max-width: 560px) {
    .vrec__live-actions {
        margin-left: 0;
    }

    .vrec__stage {
        padding: 12px;
    }

    .vplayer {
        padding: 7px 9px;
    }

    .vplayer__caption {
        font-size: 0.74rem;
    }

    .pronlist__slot {
        padding: 12px;
    }
}
