/* ========================================
   SISTEMA DE MENSAJES DIRECTOS (DM) - MOBILE FIXED
   Diseño profesional y 100% responsive
   ======================================== */

/* ===== BOTÓN FLOTANTE DE MENSAJES ===== */
.dm-floating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    
    background: linear-gradient(135deg, #72d6ff, #5fa8d3);
    border: none;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 4px 20px rgba(114, 214, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
}

.dm-floating-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 24px rgba(114, 214, 255, 0.6);
}

.dm-floating-button:active {
    transform: scale(0.95);
}

.dm-floating-button svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

/* Badge de notificaciones */
.dm-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    
    background: #ff6b6b;
    border: 3px solid #0f0c29;
    border-radius: 11px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 0 6px;
    
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
    }
}

/* ===== MODAL DE MENSAJES ===== */
.dm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    
    display: none;
    align-items: center;
    justify-content: center;
    
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    
    /* FIX MOBILE: Prevenir scroll del body */
    overflow: hidden;
}

.dm-modal.active {
    display: flex;
    opacity: 1;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.dm-container {
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    max-height: 700px;
    
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0c29 100%);
    border: 2px solid rgba(114, 214, 255, 0.3);
    border-radius: 20px;
    
    display: grid;
    grid-template-columns: 320px 1fr;
    
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dm-modal.active .dm-container {
    transform: scale(1);
}

/* ===== SIDEBAR - LISTA DE CONVERSACIONES ===== */
.dm-sidebar {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(114, 214, 255, 0.2);
    
    display: flex;
    flex-direction: column;
    
    overflow: hidden;
}

/* Header del sidebar */
.dm-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dm-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dm-sidebar-title svg {
    width: 22px;
    height: 22px;
    color: #72d6ff;
}

/* Botón cerrar */
.dm-close-btn {
    width: 32px;
    height: 32px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    cursor: pointer;
    transition: all 0.2s ease;
}

.dm-close-btn:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
}

.dm-close-btn svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.6);
}

/* Buscador */
.dm-search {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.dm-search-icon {
    position: absolute;
    left: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.dm-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(114, 214, 255, 0.2);
    border-radius: 10px;
    
    color: #fff;
    font-size: 14px;
    
    transition: all 0.2s ease;
}

.dm-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(114, 214, 255, 0.4);
    outline: none;
}

.dm-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Lista de conversaciones */
.dm-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Conversación individual */
.dm-conversation {
    padding: 12px 14px;
    margin-bottom: 4px;
    
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    
    display: flex;
    align-items: center;
    gap: 12px;
    
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dm-conversation:hover {
    background: rgba(114, 214, 255, 0.08);
    border-color: rgba(114, 214, 255, 0.2);
}

/* Estado ACTIVO */
.dm-conversation.active {
    background: rgba(114, 214, 255, 0.2) !important;
    border-color: rgba(114, 214, 255, 0.5) !important;
    box-shadow: inset 3px 0 0 #72d6ff;
}

.dm-conversation.active .dm-conversation-name {
    color: #72d6ff;
}

/* Avatar */
.dm-conversation-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(114, 214, 255, 0.3);
    flex-shrink: 0;
    position: relative;
}

/* Estado online */
.dm-conversation.online .dm-conversation-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #4ade80;
    border: 3px solid #1a1a2e;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.5);
}

.dm-conversation:not(.online) .dm-conversation-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #6b7280;
    border: 3px solid #1a1a2e;
    border-radius: 50%;
}

/* Info de conversación */
.dm-conversation-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dm-conversation-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-conversation-preview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-conversation.unread .dm-conversation-preview {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Meta info */
.dm-conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.dm-conversation-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.dm-conversation-unread {
    min-width: 20px;
    height: 20px;
    
    background: #72d6ff;
    border-radius: 10px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 11px;
    font-weight: 700;
    color: #0f0c29;
    padding: 0 6px;
}

/* ===== ÁREA DE CHAT ===== */
.dm-chat {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header del chat */
.dm-chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.dm-chat-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dm-chat-user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(114, 214, 255, 0.4);
}

.dm-chat-user-info {
    display: flex;
    flex-direction: column;
}

.dm-chat-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.dm-chat-user-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-chat-user-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

.dm-chat-user-status.offline::before {
    background: #6b7280;
}

/* Mensajes */
.dm-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    
    display: flex;
    flex-direction: column;
    gap: 12px;
    
    min-height: 0;
}

/* Mensaje individual */
.dm-message {
    display: flex;
    gap: 12px;
    max-width: 75%;
    width: fit-content;
    animation: messageSlideIn 0.3s ease;
    align-items: flex-end;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensaje propio */
.dm-message.own {
    margin-left: auto;
    flex-direction: row-reverse;
}

.dm-message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dm-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.dm-message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    
    background: rgba(114, 214, 255, 0.12);
    border: 1px solid rgba(114, 214, 255, 0.25);
    
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
    
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    
    max-width: 100%;
    width: fit-content;
}

.dm-message.own .dm-message-bubble {
    background: linear-gradient(135deg, #72d6ff 0%, #5fa8d3 100%);
    border-color: transparent;
    color: #0f0c29;
    font-weight: 500;
}

.dm-message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dm-message.own .dm-message-time {
    justify-content: flex-end;
}

/* Indicador de escritura */
.dm-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #72d6ff;
    font-size: 12px;
    font-weight: 500;
}

.dm-typing-dot {
    width: 4px;
    height: 4px;
    background: #72d6ff;
    border-radius: 50%;
    display: inline-block;
    animation: typingDot 1.4s infinite;
}

.dm-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dm-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* ===== INPUT DE MENSAJE ===== */
.dm-input {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    
    display: flex;
    align-items: flex-end;
    gap: 12px;
    
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.dm-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dm-input-field {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    
    padding: 12px 16px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(114, 214, 255, 0.2);
    border-radius: 12px;
    
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    
    resize: none;
    transition: all 0.2s ease;
}

.dm-input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(114, 214, 255, 0.4);
    outline: none;
}

.dm-input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Contador de caracteres */
.dm-char-counter {
    position: absolute;
    bottom: -20px;
    right: 60px;
    font-size: 11px;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

/* Botones de acción */
.dm-input-actions {
    display: flex;
    gap: 8px;
}

.dm-input-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dm-input-btn:hover {
    background: rgba(114, 214, 255, 0.15);
    border-color: rgba(114, 214, 255, 0.3);
}

.dm-input-btn svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
}

/* Botón enviar */
.dm-send-btn {
    background: linear-gradient(135deg, #72d6ff, #5fa8d3);
    border: none;
}

.dm-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(114, 214, 255, 0.4);
}

.dm-send-btn:active {
    transform: scale(0.95);
}

.dm-send-btn svg {
    color: #fff;
}

/* ===== TOASTS ===== */
.dm-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #3b82f6;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    font-size: 14px;
    font-weight: 500;
}

.dm-toast-success {
    background: #10b981;
}

.dm-toast-error {
    background: #ef4444;
}

.dm-toast-warning {
    background: #f59e0b;
}

.dm-toast-info {
    background: #3b82f6;
}

.dm-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-toast-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.dm-toast-message {
    flex: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ===== SCROLLBAR ===== */
.dm-conversations-list::-webkit-scrollbar,
.dm-messages::-webkit-scrollbar {
    width: 6px;
}

.dm-conversations-list::-webkit-scrollbar-track,
.dm-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.dm-conversations-list::-webkit-scrollbar-thumb,
.dm-messages::-webkit-scrollbar-thumb {
    background: rgba(114, 214, 255, 0.3);
    border-radius: 3px;
}

.dm-conversations-list::-webkit-scrollbar-thumb:hover,
.dm-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(114, 214, 255, 0.5);
}

/* ===== ESTADO VACÍO ===== */
.dm-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.dm-empty-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-empty-icon svg {
    color: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
}

.dm-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.dm-empty-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.dm-empty-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

/* ===== PREVIEW DE IMAGEN ADJUNTA ===== */
.dm-image-preview {
    position: relative;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 200px;
    border: 2px solid rgba(114, 214, 255, 0.3);
}

.dm-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.dm-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 107, 107, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dm-remove-image:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

.dm-remove-image svg {
    width: 16px;
    height: 16px;
    color: white;
    stroke-width: 3;
}

/* ===== IMAGEN EN MENSAJES ===== */
.dm-message-image {
    margin-bottom: 8px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 300px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.dm-message-image:hover {
    transform: scale(1.02);
}

.dm-message-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.dm-message.own .dm-message-image {
    border: 2px solid rgba(114, 214, 255, 0.3);
}

/* ===== MODAL DE IMAGEN COMPLETA ===== */
.dm-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.dm-image-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.dm-image-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.dm-image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dm-image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.dm-image-modal-close svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 2.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE MÓVIL - CORREGIDO COMPLETAMENTE
   ======================================== */

@media (max-width: 768px) {
    /* Botón flotante ajustado */
    .dm-floating-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        z-index: 998;
    }
    
    .dm-floating-button svg {
        width: 24px;
        height: 24px;
    }
    
    /* FIX: Modal ocupa toda la pantalla en móvil */
    .dm-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }
    
    /* FIX CRÍTICO: Container ocupa 100% en móvil */
    .dm-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-width: 100%;
        border-radius: 0;
        border: none;
        
        /* Usar columna única en móvil */
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        
        /* Asegurar que ocupe toda la pantalla */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    /* Sidebar en móvil - oculto por defecto */
    .dm-sidebar {
        display: none;
        border-right: none;
    }
    
    /* Cuando sidebar está visible en móvil */
    .dm-sidebar.mobile-visible {
        display: flex;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 20;
        background: linear-gradient(180deg, #1a1a2e 0%, #0f0c29 100%);
    }
    
    /* Chat siempre visible en móvil */
    .dm-chat {
        width: 100%;
        height: 100%;
    }
    
    /* Header ajustado en móvil */
    .dm-chat-header {
        padding: 16px 20px;
    }
    
    .dm-sidebar-header {
        padding: 16px 20px;
    }
    
    /* Usuario del chat más compacto */
    .dm-chat-user-avatar {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .dm-chat-user-name {
        font-size: 15px;
    }
    
    .dm-chat-user-status {
        font-size: 11px;
    }
    
    /* Mensajes ajustados */
    .dm-messages {
        padding: 16px;
        gap: 10px;
    }
    
    .dm-message {
        max-width: 85%;
    }
    
    .dm-message-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .dm-message-bubble {
        padding: 9px 12px;
        font-size: 14px;
    }
    
    /* Input ajustado en móvil */
    .dm-input {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .dm-input-field {
        min-height: 40px;
        max-height: 100px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Botones más pequeños en móvil */
    .dm-input-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .dm-input-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Contador de caracteres reposicionado */
    .dm-char-counter {
        bottom: auto;
        top: -22px;
        right: 8px;
        font-size: 10px;
    }
    
    /* Conversaciones más compactas en móvil */
    .dm-conversation {
        padding: 10px 12px;
    }
    
    .dm-conversation-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .dm-conversation-name {
        font-size: 14px;
    }
    
    .dm-conversation-preview {
        font-size: 12px;
    }
    
    /* Búsqueda ajustada */
    .dm-search {
        padding: 12px 16px;
    }
    
    .dm-search-input {
        padding: 9px 12px 9px 36px;
        font-size: 13px;
    }
    
    /* Toasts más pequeños en móvil */
    .dm-toast {
        min-width: 250px;
        max-width: calc(100% - 40px);
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Imagen modal ajustada */
    .dm-image-modal-backdrop {
        padding: 20px;
    }
    
    .dm-image-modal img {
        max-width: 95%;
        max-height: 80vh;
    }
    
    .dm-image-modal-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .dm-image-modal-close svg {
        width: 20px;
        height: 20px;
    }
    
    /* Imágenes en mensajes más pequeñas */
    .dm-message-image {
        max-width: 200px;
    }
    
    /* Empty state ajustado */
    .dm-empty-state {
        padding: 30px 20px;
    }
    
    .dm-empty-title {
        font-size: 16px;
    }
    
    .dm-empty-text {
        font-size: 13px;
    }
}

/* ===== RESPONSIVE PARA PANTALLAS MUY PEQUEÑAS ===== */
@media (max-width: 375px) {
    .dm-floating-button {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }
    
    .dm-chat-header,
    .dm-sidebar-header {
        padding: 14px 16px;
    }
    
    .dm-input {
        padding: 10px 12px;
    }
    
    .dm-messages {
        padding: 12px;
    }
    
    .dm-message {
        max-width: 90%;
    }
    
    .dm-input-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }
    
    .dm-toast {
        min-width: 200px;
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* ===== FIX PARA LANDSCAPE EN MÓVIL ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .dm-container {
        height: 100vh;
        max-height: 100vh;
    }
    
    .dm-messages {
        padding: 12px 16px;
    }
    
    .dm-input {
        padding: 10px 16px;
    }
    
    .dm-chat-header {
        padding: 12px 20px;
    }
}

/* ===== PREVENIR SCROLL DEL BODY CUANDO MODAL ESTÁ ABIERTO ===== */
body.dm-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ===== OPTIMIZACIONES DE PERFORMANCE ===== */
.dm-container,
.dm-messages,
.dm-conversations-list {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===== BOTÓN BACK EN MÓVIL (opcional) ===== */
.dm-mobile-back {
    display: none;
}

@media (max-width: 768px) {
    .dm-mobile-back {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .dm-mobile-back:active {
        background: rgba(114, 214, 255, 0.15);
        border-color: rgba(114, 214, 255, 0.3);
    }
    
    .dm-mobile-back svg {
        width: 20px;
        height: 20px;
        color: rgba(255, 255, 255, 0.8);
    }
}