/**
 * Voice Picker Styles
 * Card-based selection UI for audio and video voice pickers.
 * Follows the same visual language as video-avatar-picker.css.
 */

/* ---- Card ---- */

.voice-card {
    cursor: pointer;
    border: 3px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: border-color 0.2s ease;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.voice-card:hover {
    border-color: #6F67FF;
}

.voice-card:focus:not(:focus-visible) {
    outline: none;
    border-color: #6F67FF;
}

.voice-card:focus-visible {
    outline: 2px solid var(--brand-primary, #0031cc);
    outline-offset: 2px;
    border-color: #6F67FF;
}

.voice-card.active {
    border-color: #6F67FF;
}

/* Selection checkmark (mirrors avatar picker overlay) */
.voice-card-check {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #6F67FF;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-card.active .voice-card-check {
    opacity: 1;
}

/* ---- Card content ---- */

.voice-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    padding-right: 1.25rem;
}

.voice-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

/* ---- Badges ---- */

.voice-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    line-height: 1.3;
    text-transform: capitalize;
}

.voice-badge-female {
    background: #fce7f3;
    color: #9d174d;
}

.voice-badge-male {
    background: #dbeafe;
    color: #1e40af;
}

.voice-badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
}

.voice-badge-country {
    background: #ecfdf5;
    color: #065f46;
}

/* ---- Play button ---- */

.voice-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #f9fafb;
    color: #374151;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    width: 100%;
}

.voice-play-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.voice-play-btn.playing {
    background: #ede9fe;
    border-color: #6F67FF;
    color: #6F67FF;
}

.voice-play-btn.playing .voice-play-icon::before {
    content: "\F4C4"; /* bi-stop-fill */
}

/* ---- Section headings inside modal ---- */

.voice-group-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

/* ---- Loading / empty state ---- */

.voice-picker-loading,
.voice-picker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: #6c757d;
    text-align: center;
}

.voice-picker-loading i,
.voice-picker-empty i {
    font-size: 2rem;
    opacity: 0.4;
}

/* ---- "Auto-select" option (video picker) ---- */

.voice-card-auto {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 80px;
    color: #6c757d;
    text-align: center;
    padding: 0.5rem;
}

.voice-card-auto i {
    font-size: 1.5rem;
    opacity: 0.5;
}

.voice-card-auto span {
    font-size: 0.8rem;
}

/* ---- Inline preview display (shown in form) ---- */

.voice-selected-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.voice-selected-preview .voice-selected-name {
    font-weight: 600;
}

/* ---- Recording indicator ---- */

.js-recording-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---- Fullscreen recording overlay ---- */

.js-voice-record-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    overflow: hidden;
}

.js-voice-record-overlay-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.js-voice-record-overlay-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.js-voice-record-overlay-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.15);
    border: 2px solid rgba(220, 53, 69, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: recording-glow 2s ease-in-out infinite;
}

.js-voice-record-overlay-icon i {
    font-size: 2rem;
    color: #dc3545;
}

.js-voice-record-overlay-icon-done {
    background: rgba(111, 103, 255, 0.15);
    border-color: rgba(111, 103, 255, 0.4);
    animation: none;
}

.js-voice-record-overlay-icon-done i {
    color: #6F67FF;
}

@keyframes recording-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(220, 53, 69, 0);
    }
}

.js-voice-record-overlay-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.js-voice-record-overlay-timer {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.js-voice-record-overlay-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.js-voice-record-overlay-phrase {
    color: #fff;
    font-size: 1.125rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 1.5rem;
    padding: 1rem 1.5rem;
    border-left: 3px solid #6F67FF;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0.5rem 0.5rem 0;
    text-align: left;
}

.js-voice-record-overlay-cancel {
    padding: 1rem;
    font-size: 0.875rem;
    text-decoration: none;
}
