/* ===== VOICE MESSAGES ===== */

/* Recording UI */
.voice-recording-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-chat);
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: none;
    animation: slideUp 0.2s ease-out;
}

.voice-recording-ui.show {
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.recording-indicator {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.live-waveform {
    display: flex;
    gap: 2px;
    height: 32px;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.waveform-bar {
    width: 3px;
    background: var(--telegram-blue);
    border-radius: 2px;
    transition: height 0.1s;
    min-height: 4px;
}

.recording-timer {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 50px;
}

.cancel-recording-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.cancel-recording-btn:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
    color: #ff4444;
}

/* Voice Message Playback */
.voice-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-width: 280px;
    max-width: 400px;
}

.voice-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--telegram-blue);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.voice-play-btn:hover {
    background: var(--telegram-blue-light);
    transform: scale(1.05);
}

.voice-play-btn:active {
    transform: scale(0.95);
}

.voice-waveform {
    flex: 1;
    display: flex;
    gap: 2px;
    height: 28px;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    position: relative;
}

.voice-waveform-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.1s;
    min-height: 4px;
}

.voice-waveform-bar.played {
    background: var(--telegram-blue);
}

.voice-waveform:hover .voice-waveform-bar {
    background: rgba(255, 255, 255, 0.5);
}

.voice-waveform:hover .voice-waveform-bar.played {
    background: var(--telegram-blue-light);
}

.voice-duration {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.voice-speed {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--telegram-blue);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 38px;
}

.voice-speed:hover {
    background: rgba(0, 136, 204, 0.1);
    border-color: var(--telegram-blue);
}

/* Mic button style moved to components.css for consistency */

/* Mic specific animation */

.mic-btn.recording {
    background: #ff4444;
    color: white;
    animation: pulse 1.5s infinite;
}

/* Voice message in sent/received */
.sent .voice-message {
    background: transparent;
}

.received .voice-message {
    background: transparent;
}

.sent .voice-waveform-bar {
    background: rgba(255, 255, 255, 0.4);
}

.sent .voice-waveform-bar.played {
    background: white;
}

.received .voice-waveform-bar {
    background: rgba(255, 255, 255, 0.2);
}

.received .voice-waveform-bar.played {
    background: var(--telegram-blue);
}

/* Loading state */
.voice-message.loading {
    opacity: 0.6;
    pointer-events: none;
}

.voice-message.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}