/* DmApp Multimedia Messaging Styles */
/* Voice Messages, GIFs, Documents, Links, Video/Voice Calls, Animated Waveforms */

/* =============================================
   VOICE MESSAGE BUTTON
   ============================================= */

.voice-msg-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(0, 255, 0, 0.3);
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-msg-btn:hover {
    background: rgba(0, 255, 0, 0.15);
    border-color: #00FF00;
    transform: scale(1.05);
}

.voice-msg-btn:active {
    background: rgba(255, 0, 0, 0.2);
    border-color: #FF0000;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

/* =============================================
   MULTIMEDIA TOOLBAR
   ============================================= */

.multimedia-toggle {
    font-size: 24px !important;
}

.multimedia-toolbar {
    display: none;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 255, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.multimedia-toolbar.active {
    display: block;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toolbar-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.toolbar-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00FF00;
    transform: translateY(-3px);
}

.toolbar-icon {
    font-size: 24px;
}

.toolbar-label {
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

/* =============================================
   RECORDING OVERLAY
   ============================================= */

.recording-overlay {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 0, 0, 0.05));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.recording-dot {
    width: 12px;
    height: 12px;
    background: #FF0000;
    border-radius: 50%;
    animation: recordingPulse 1s ease-in-out infinite;
}

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

.recording-text {
    font-weight: 600;
    color: #FF0000;
    font-size: 14px;
}

.recording-time {
    font-weight: 700;
    color: #FF0000;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.recording-waveform {
    flex: 1;
    height: 40px;
    border-radius: 8px;
}

.cancel-recording-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.4);
    color: #FF0000;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-recording-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: rotate(90deg);
}

/* =============================================
   VOICE MESSAGE BUBBLE
   ============================================= */

.voice-message-bubble {
    min-width: 220px;
}

.voice-message {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.3);
    border: 2px solid rgba(0, 255, 0, 0.5);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.message.sent .voice-play-btn {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.3);
}

.voice-play-btn:hover {
    transform: scale(1.1);
}

.voice-waveform-container {
    flex: 1;
    overflow: hidden;
}

.voice-waveform-canvas {
    width: 100%;
    height: 32px;
    display: block;
}

.voice-duration {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.7;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* =============================================
   GIF MESSAGE
   ============================================= */

.gif-message-bubble {
    padding: 6px !important;
    background: transparent !important;
    border: none !important;
}

.gif-message {
    width: 150px;
    height: 150px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #FFD93D, #FF6B6B);
    animation: gifBounce 0.5s ease;
}

@keyframes gifBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.gif-big-emoji {
    font-size: 64px;
}

.gif-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
}

/* =============================================
   GIF PICKER MODAL
   ============================================= */

.gif-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gif-picker-modal.active {
    opacity: 1;
}

.gif-picker-container {
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    background: white;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.4s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.gif-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gif-picker-header h3 {
    margin: 0;
    font-size: 18px;
}

.gif-picker-header button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.gif-search {
    padding: 12px 20px;
}

.gif-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.gif-search input:focus {
    border-color: #00FF00;
}

.gif-categories {
    display: flex;
    gap: 8px;
    padding: 0 20px 12px;
    overflow-x: auto;
}

.gif-cat-btn {
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.gif-cat-btn.active {
    background: #00FF00;
    border-color: #00FF00;
    color: #000;
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 20px;
    overflow-y: auto;
    flex: 1;
}

.gif-item {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gif-item:hover {
    transform: scale(1.05);
}

.gif-emoji {
    font-size: 36px;
}

.gif-label {
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* =============================================
   DOCUMENT MESSAGE
   ============================================= */

.doc-message-bubble {
    min-width: 250px;
}

.doc-message {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 12px;
    opacity: 0.7;
}

.doc-download-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.3);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.doc-download-btn:hover {
    background: rgba(0, 255, 0, 0.3);
    transform: scale(1.1);
}

/* =============================================
   LINK PREVIEW
   ============================================= */

.link-preview {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #00FF00;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.link-preview:hover {
    background: rgba(0, 255, 0, 0.1);
}

.link-domain {
    font-size: 11px;
    font-weight: 600;
    color: #00AA00;
    margin-bottom: 4px;
}

.link-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.link-url {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================
   CALL MODAL (Video & Voice)
   ============================================= */

.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.call-modal.active {
    opacity: 1;
}

.call-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.call-bg-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Video Call */
.video-call-container .call-bg-effect {
    background: #000;
}

/* Voice Call */
.voice-call-container .call-bg-effect {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
}

/* Team Call */
.team-call-container .call-bg-effect {
    background: #1a1a1a;
}

/* Remote Video */
.remote-video-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.remote-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.call-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #00FF00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.calling-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

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

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

/* Self Video */
.self-video-area {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #00FF00;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
    cursor: move;
}

.self-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.self-label {
    position: absolute;
    bottom: 5px;
    left: 5px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Team Video Grid */
.team-video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
    z-index: 1;
}

.team-member-video {
    background: #2a2a2a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.team-member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #00FF00;
}

.team-member-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.team-member-status {
    color: #00FF00;
    font-size: 12px;
}

.team-self-video {
    top: auto;
    bottom: 120px;
    right: 20px;
    width: 100px;
    height: 130px;
}

/* Call Info Overlay */
.call-info-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    color: white;
}

.call-name {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.call-timer {
    font-size: 14px;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

.call-participants-count {
    font-size: 13px;
    color: #00FF00;
    margin-top: 4px;
}

/* Voice Call Content */
.voice-call-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    gap: 20px;
}

.call-avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
}

.call-avatar-wrapper .call-avatar-large {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 120px;
    height: 120px;
    z-index: 2;
}

.call-avatar-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 0, 0.3);
}

.ring-1 {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    animation: ringPulse 2s ease-in-out infinite;
}

.ring-2 {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    animation: ringPulse 2s ease-in-out infinite 0.5s;
}

.ring-3 {
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    animation: ringPulse 2s ease-in-out infinite 1s;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.call-name-large {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.call-status-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.call-timer-large {
    font-size: 20px;
    color: #00FF00;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.voice-call-waves {
    width: 300px;
    height: 60px;
}

.voice-call-waves canvas {
    width: 100%;
    height: 100%;
}

/* Call Controls */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px 20px;
    z-index: 10;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.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.2);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.end-call-btn {
    background: #FF3B30 !important;
    border-color: #FF3B30 !important;
    width: 64px;
    height: 64px;
    transform: rotate(135deg);
}

.end-call-btn:hover {
    background: #FF0000 !important;
    transform: rotate(135deg) scale(1.1);
}

/* =============================================
   NOTIFICATION
   ============================================= */

.mm-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 30000;
    animation: slideInRight 0.4s ease-out;
    font-weight: 600;
    font-size: 14px;
}

.mm-notification.info {
    background: linear-gradient(135deg, #E6F3FF, #CCE6FF);
    border-left: 5px solid #0088FF;
}

.mm-notification.success {
    background: linear-gradient(135deg, #E6FFE6, #CCFFCC);
    border-left: 5px solid #00FF00;
}

.mm-notification.error {
    background: linear-gradient(135deg, #FFE6E6, #FFCCCC);
    border-left: 5px solid #FF0000;
}

.mm-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100px); }
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .toolbar-row {
        gap: 8px;
    }

    .toolbar-btn {
        padding: 10px 12px;
        min-width: 58px;
    }

    .toolbar-icon {
        font-size: 20px;
    }

    .toolbar-label {
        font-size: 10px;
    }

    .self-video-area {
        width: 90px;
        height: 120px;
        top: 60px;
        right: 10px;
    }

    .team-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .end-call-btn {
        width: 56px;
        height: 56px;
    }

    .call-controls {
        gap: 15px;
    }

    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .voice-message-bubble {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .toolbar-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .call-avatar-large {
        width: 100px;
        height: 100px;
    }

    .call-name-large {
        font-size: 22px;
    }
}
