
/* ===== VOICE RECORDING PANEL ===== */
.voice-recording-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.95), rgba(255, 60, 172, 0.95));
    backdrop-filter: blur(20px);
    padding: 20px 24px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: slideUpPanel 0.3s ease;
}

@keyframes slideUpPanel {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-recording-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Voice Wave Animation */
.voice-wave-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}

.wave-bar {
    width: 4px;
    background: white;
    border-radius: 4px;
    animation: waveAnimation 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; height: 16px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 24px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 32px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 24px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 16px; }

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.7;
    }
    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}

/* Recording Time */
.voice-recording-time {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    min-width: 80px;
}

.recording-dot {
    color: #FF0000;
    font-size: 12px;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.2);
    }
}

/* Voice Recording Actions */
.voice-recording-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.voice-cancel-btn,
.voice-send-btn {
    padding: 12px 24px;
    border-radius: 24px;
    border: 2px solid white;
    background: transparent;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.voice-send-btn {
    background: white;
    color: var(--primary-color);
}

.voice-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

.chat-voice-btn {
    position: relative;
}

.chat-voice-btn.recording {
    background: #FF0000;
    color: white;
    animation: recordingButtonPulse 1.5s ease-in-out infinite;
}

@keyframes recordingButtonPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 0, 0, 0);
    }
}

/* ===== VIDEO CALL MODAL ===== */
.video-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-call-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remote Video (Main) */
.video-remote-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-remote {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Call Info Overlay */
.video-call-info {
    position: absolute;
    top: 32px;
    left: 32px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.call-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.call-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.call-user-details {
    display: flex;
    flex-direction: column;
}

.call-user-name {
    color: white;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.call-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Local Video (PiP) */
.video-local-container {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 240px;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: #2A2A2A;
}

.video-local {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

.video-local-toggle {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-local-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(180deg);
}

/* Call Controls */
.video-call-controls {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-radius: 48px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.call-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.call-control-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.call-control-btn.muted {
    background: #EF4444;
    border-color: #EF4444;
}

.call-end-btn {
    background: #EF4444;
    border-color: #EF4444;
}

.call-end-btn:hover {
    background: #DC2626;
    transform: scale(1.1);
}

/* Call Timer */
.video-call-timer {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.video-call-timer i {
    color: #00D936;
}

/* ===== AUDIO MESSAGE IN CHAT ===== */
.message-audio {
    max-width: 320px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-group.sent .message-audio {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 60, 172, 0.2));
    border-color: rgba(255, 60, 172, 0.3);
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.audio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 60, 172, 0.4);
}

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

.audio-wave-bar {
    width: 3px;
    background: var(--text-secondary);
    border-radius: 3px;
    transition: all 0.1s ease;
}

.message-group.sent .audio-wave-bar {
    background: var(--primary-color);
}

.audio-wave-bar.playing {
    background: var(--primary-color);
    animation: audioWavePlaying 0.5s ease-in-out infinite alternate;
}

@keyframes audioWavePlaying {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1); }
}

.audio-duration {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.message-group.sent .audio-duration {
    color: var(--primary-color);
}

/* ===== RESPONSIVE - VOICE & VIDEO ===== */
@media (max-width: 1024px) {
    .video-local-container {
        width: 180px;
        height: 135px;
        top: 24px;
        right: 24px;
    }

    .video-call-info {
        top: 24px;
        left: 24px;
    }

    .call-control-btn {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .voice-recording-panel {
        padding: 16px 20px;
    }

    .voice-recording-content {
        flex-wrap: wrap;
        gap: 16px;
    }

    .voice-recording-time {
        font-size: 16px;
    }

    .voice-cancel-btn,
    .voice-send-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .video-local-container {
        width: 120px;
        height: 90px;
        top: 16px;
        right: 16px;
        border-width: 2px;
    }

    .video-call-info {
        top: 16px;
        left: 16px;
        padding: 12px 16px;
    }

    .call-avatar {
        width: 40px;
        height: 40px;
    }

    .call-user-name {
        font-size: 15px;
    }

    .call-status {
        font-size: 12px;
    }

    .video-call-controls {
        bottom: 32px;
        gap: 12px;
        padding: 12px 16px;
    }

    .call-control-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .video-call-timer {
        top: 16px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .message-audio {
        max-width: 280px;
    }
}

/* Dark Mode Enhancements for Voice & Video */
[data-theme="dark"] .voice-recording-panel {
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .video-call-info,
[data-theme="dark"] .video-call-controls,
[data-theme="dark"] .video-call-timer {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .message-audio {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
