/* ==============================================
   CHAR CREATOR WIZARD - STEP 3 (VOICE)
   ============================================== */

.voice-ring {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(59, 130, 246, 0.2));
    color: var(--cyan);
    box-shadow: 0 0 24px rgba(94, 234, 212, 0.2);
}

/* === Voice & Final === */
.voice-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.voice-source-item {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.voice-source-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.voice-source-item.active {
    background: linear-gradient(145deg, rgba(94, 234, 212, 0.1), rgba(168, 85, 247, 0.05));
    border-color: rgba(94, 234, 212, 0.4);
    box-shadow: 0 8px 32px rgba(94, 234, 212, 0.15);
}

.voice-source-item.active i {
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(94, 234, 212, 0.5);
}

.voice-source-item i {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    transition: color 0.2s;
}

.voice-source-item p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.voice-source-item.active p {
    color: var(--text-primary);
    font-weight: 600;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(238, 82, 83, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(238, 82, 83, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(238, 82, 83, 0);
    }
}

/* === Audio Analysis Panel === */
.voice-analysis-panel {
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 20px 24px;
    margin-top: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* === Custom STT Chat Bubbles === */
.stt-bubble-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.stt-bubble-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stt-bubble-row.disabled {
    opacity: 0.4;
    filter: grayscale(100%);
    background: transparent;
    border-color: transparent;
}

.stt-bubble-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(94, 234, 212, 0.1);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.stt-bubble-play:hover {
    background: rgba(94, 234, 212, 0.25);
    transform: scale(1.05);
}

.stt-bubble-content {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.stt-word {
    display: inline-block;
    padding: 0px 3px;
    margin: 0px 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.stt-word:hover {
    background: rgba(255, 255, 255, 0.1);
}

.stt-word.active {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(94, 234, 212, 0.3);
}

.stt-word.active.playing {
    background-color: rgba(94, 234, 212, 0.4);
    color: #fff;
    border-radius: 2px;
}

.stt-word.inactive {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* Custom modern checkbox toggle */
.stt-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.stt-toggle.active {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(94, 234, 212, 0.3);
}

.stt-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stt-toggle.active::after {
    transform: translateX(20px);
}


.analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.analysis-header i {
    color: var(--cyan);
}

.analysis-title {
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-quality-badge {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.quality-good { background: rgba(46, 213, 115, 0.15); color: #2ed573; }
.quality-fair { background: rgba(255, 165, 2, 0.15); color: #ffa502; }
.quality-poor { background: rgba(255, 71, 87, 0.15); color: #ff4757; }
.quality-unknown { background: rgba(150, 150, 150, 0.15); color: #999; }

.analysis-details {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.analysis-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.analysis-stat i {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
}

.analysis-warnings {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}

.analysis-warning-item {
    font-size: 0.8rem;
    color: #ffa502;
    padding: 3px 0;
}

/* === Speaker Selection Panel === */
.speaker-selection-panel {
    margin-top: 12px;
    background: rgba(99, 110, 255, 0.06);
    border: 1px solid rgba(99, 110, 255, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
}

.speaker-selection-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 500;
}

.speaker-selection-header i {
    color: var(--accent, #636eff);
}

.speaker-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.speaker-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.speaker-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.speaker-card.selected {
    background: rgba(99, 110, 255, 0.12);
    border-color: var(--accent, #636eff);
    box-shadow: 0 0 12px rgba(99, 110, 255, 0.15);
}

.speaker-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.speaker-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.speaker-card.selected .speaker-icon {
    background: rgba(99, 110, 255, 0.2);
    color: var(--accent, #636eff);
}

.speaker-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.speaker-duration {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.speaker-sample-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}