/* Estilos para el sistema de mensajes directos de Teams Chat */

/* Contenedor principal de mensajes directos */
.teams-chat-direct-messages-container {
    display: flex;
    height: 600px;
    border: 2px solid #B51A1A;
    border-radius: 14px;
    background-color: #fff;
    overflow: hidden;
    font-family: "Geologica";
}

.teams-chat-direct-messages-container::before, 
.teams-chat-direct-messages-container::after {
    content: '';
    position: absolute;
    left: -2px;
    top: -2px;
    background: linear-gradient(to right, #B51A1A, #B519B5, #19B59E);
    width: calc(100% + 5px);
    height: calc(100% + 5px);
    z-index: -1;
    filter: blur(120px);
}

.teams-chat-direct-messages-container::after {
    filter: blur(20px);
}

/* Sidebar de conversaciones */
.teams-chat-conversations-sidebar {
    width: 35%;
    border-right: 2px solid #B51A1A;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* SOLUCIONADO: Headers con blur funcional */
.teams-chat-conversations-header,
.teams-chat-messages-header {
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    padding: 15px 20px;
    border-bottom: 2px solid #B51A1A;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    
    /* Blur con múltiples capas para máxima compatibilidad */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(5px) saturate(700%);
    -webkit-backdrop-filter: blur(5px) saturate(700%);
}

/* Pseudo-elemento para crear el efecto blur en navegadores sin soporte */
.teams-chat-conversations-header::before,
.teams-chat-messages-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.85) 50%, 
        rgba(255, 255, 255, 0.9) 100%);
    z-index: -1;
    box-shadow: 0 1px 10px rgba(255, 125, 50, 0.15);
}

/* Asegurar que el contenido esté por encima del pseudo-elemento */
.teams-chat-conversations-header > *,
.teams-chat-messages-header > * {
    position: relative;
    z-index: 1;
}

/* Añadir backdrop específico para WebKit */
/* @supports (-webkit-backdrop-filter: blur(10px)) {
    .teams-chat-conversations-header,
    .teams-chat-messages-header {
        -webkit-backdrop-filter: blur(10px) saturate(150%);
        background: rgba(255, 255, 255, 0.7);
    }
    
    .teams-chat-conversations-header::before,
    .teams-chat-messages-header::before {
        background: transparent;
    }
}

@supports (backdrop-filter: blur(10px)) {
    .teams-chat-conversations-header,
    .teams-chat-messages-header {
        backdrop-filter: blur(10px) saturate(150%);
        background: rgba(255, 255, 255, 0.7);
    }
    
    .teams-chat-conversations-header::before,
    .teams-chat-messages-header::before {
        background: transparent;
    }
} */

.teams-chat-conversations-header h3,
.teams-chat-messages-header h3 {
    margin: 0;
    font-size: 18px;
    color: #030408;
    font-weight: 600;
}

/* Botones del header */
.teams-chat-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.teams-chat-new-conversation-btn,
.teams-chat-new-group-btn,
.teams-chat-delete-conversation-btn {
    background-color: #B51A1A;
    color: white;
    border: none;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease !important;
    font-size: 16px !important;
}

.teams-chat-new-conversation-btn:hover,
.teams-chat-new-group-btn:hover {
    background-color: #B51A1A !important;
    transform: scale(1.05);
    color: white !important;
}

.teams-chat-delete-conversation-btn {
    background-color: #dc3545 !important;
    color: white !important;
}

.teams-chat-delete-conversation-btn:hover {
    background-color: #c82333 !important;
    transform: scale(1.05) !important;
    color: white !important;
}

.teams-chat-delete-conversation-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    color: white;
}

/* Lista de conversaciones */
.teams-chat-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-right: 5px;
}

/* Barra de desplazamiento personalizada */
.teams-chat-conversations-list::-webkit-scrollbar,
.teams-chat-messages-list::-webkit-scrollbar {
    width: 5px;
}

.teams-chat-conversations-list::-webkit-scrollbar-track,
.teams-chat-messages-list::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 4px;
}

.teams-chat-conversations-list::-webkit-scrollbar-thumb,
.teams-chat-messages-list::-webkit-scrollbar-thumb {
    background-color: #B51A1A;
    border-radius: 4px;
}

/* Items de conversación */
.teams-chat-conversation-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    gap: 12px;
}

.teams-chat-conversation-item:hover {
    background-color: #B51A1A33;
    border: 2px solid #B51A1A;
    transform: scale(1.01);
}

.teams-chat-conversation-item.active {
    background-color: #b71a1a33;
    border: 2px solid #B51A1A;
}

/* Indicador de grupo */
.teams-chat-conversation-item.is-group {
    border-left: 4px solid #B51A1A;
}

.teams-chat-conversation-item.is-group .teams-chat-conversation-name::before {
    content: "👥 ";
    color: #B51A1A;
}

/* Avatares con contenedor de máscara circular */
.teams-chat-conversation-avatar,
.teams-chat-user-avatar,
.teams-chat-message-avatar,
.teams-chat-notification-avatar,
.teams-chat-group-avatar {
    position: relative !important;
    display: inline-block !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    background-color: #f0f0f0 !important;
    flex-shrink: 0 !important;
    border: 1px solid #B51A1A !important;
}

.teams-chat-conversation-avatar,
.teams-chat-user-avatar,
.teams-chat-group-avatar {
    width: 45px !important;
    height: 45px !important;
}

.teams-chat-message-avatar {
    width: 40px !important;
    height: 40px !important;
}

.teams-chat-notification-avatar {
    width: 40px !important;
    height: 40px !important;
    border-color: #B51A1A;
}

/* Imágenes dentro de los contenedores de avatar */
.teams-chat-conversation-avatar img,
.teams-chat-user-avatar img,
.teams-chat-message-avatar img,
.teams-chat-notification-avatar img,
.teams-chat-group-avatar img,
.teams-chat-user-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 0;
    transition: transform 0.2s ease;
}

.teams-chat-user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

/* Badge de mensajes no leídos */
.teams-chat-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #B51A1A;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Badge de admin de grupo */
.teams-chat-admin-badge {
    background-color: #ffc107;
    color: #212529;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 6px;
    margin-left: 5px;
}

/* Información de conversación */
.teams-chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.teams-chat-conversation-name {
    font-weight: 600;
    color: #030408;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teams-chat-user-role {
    font-size: 11px;
    color: #666;
    background-color: #e0e0e0;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.teams-chat-conversation-last-message {
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.teams-chat-conversation-time {
    font-size: 11px;
    color: #999;
}

/* Descripción de grupo */
.teams-chat-group-description {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}

/* Contador de miembros */
.teams-chat-members-count {
    font-size: 11px;
    color: #666;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: auto;
    width: fit-content;
}

/* Indicadores de estado */
.teams-chat-no-conversations,
.teams-chat-loading,
.teams-chat-error,
.teams-chat-select-conversation {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.teams-chat-error {
    color: #d32f2f;
}

/* Contenedor de mensajes */
.teams-chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.teams-chat-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #FFFFFF;
    margin-right: 5px;
}

/* Mensajes individuales */
.teams-chat-message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
    gap: 10px;
}

.teams-chat-message-mine {
    flex-direction: row-reverse;
}

.teams-chat-message-content {
    max-width: 70%;
    background-color: #B51A1A33;
    padding: 12px 15px;
    border-radius: 12px;
    position: relative;
}

.teams-chat-message-mine .teams-chat-message-content {
    background-color: #B51A1A66;
}

.teams-chat-message-header {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.teams-chat-message-author {
    font-weight: 600;
    font-size: 13px;
    color: #030408;
}

.teams-chat-message-time {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

.teams-chat-message-text {
    color: #030408;
    line-height: 1.5;
    word-break: break-word;
}

.teams-chat-message-text p {
    margin: 0 0 8px 0;
    color: #030408;
}

.teams-chat-message-text p:last-child {
    margin-bottom: 0;
}

.teams-chat-message-text a {
    color: #B51A1A;
    text-decoration: underline;
}

/* Formulario de mensaje */
.teams-chat-message-form {
    padding: 15px 20px;
    background-color: #ffffff;
    border-top: 2px solid #B51A1A;
}

.teams-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#teams-chat-message-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #B51A1A;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    min-height: 40px;
    max-height: 120px;
    transition: border-color 0.2s ease;
    overflow-y: hidden;
}

#teams-chat-message-input:focus {
    outline: none;
    border-color: #e86e2d;
    box-shadow: 0 0 0 3px rgba(255, 125, 50, 0.1);
}

.teams-chat-send-button {
    background-color: #B51A1A;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.teams-chat-send-button:hover:not(:disabled) {
    background-color: #B51A1A !important;
    transform: scale(1.05);
}

.teams-chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal base */
.teams-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.teams-chat-modal-content {
    background-color: white;
    border-radius: 14px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

.teams-chat-modal-header {
    padding: 10px 20px;
    border-bottom: 2px solid #B51A1A;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.teams-chat-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #00000A;
}

.teams-chat-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #B51A1A !important;
    transition: color 0.2s ease !important;
    padding: 5px;
    border-radius: 50%;
}

.teams-chat-modal-close:hover {
    color: #00000A !important;
    background-color: transparent !important;
}

.teams-chat-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.teams-chat-modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Modal de confirmación de eliminación */
.teams-chat-delete-modal .teams-chat-modal-content {
    max-width: 400px;
}

.teams-chat-delete-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.teams-chat-delete-warning .dashicons {
    color: #856404;
    flex-shrink: 0;
    margin-top: 2px;
}

.teams-chat-delete-warning-text {
    color: #856404;
    line-height: 1.4;
}

.teams-chat-delete-warning-text strong {
    color: #721c24;
}

/* Formulario de grupo */
.teams-chat-group-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.teams-chat-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.teams-chat-form-group label {
    font-weight: 600;
    color: #00000A;
}

.teams-chat-form-group input,
.teams-chat-form-group textarea {
    padding: 10px 12px;
    border: 2px solid #B51A1A;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.teams-chat-form-group input:focus,
.teams-chat-form-group textarea:focus {
    outline: none;
    border-color: #B51A1A;
    box-shadow: 0 0 0 3px rgba(255, 125, 50, 0.1);
}

.teams-chat-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Selector de archivo para avatar de grupo */
.teams-chat-avatar-upload {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
}

.teams-chat-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    overflow: hidden;
    display: none;
}

.teams-chat-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teams-chat-avatar-placeholder {
    color: #6c757d;
    font-size: 24px;
}

.teams-chat-upload-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.teams-chat-upload-btn:hover {
    background-color: #5a6268;
}

/* Búsqueda de usuarios */
.teams-chat-user-search {
    margin-bottom: 20px;
}

#teams-chat-user-search,
#teams-chat-group-user-search {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #B51A1A;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

#teams-chat-user-search:focus,
#teams-chat-group-user-search:focus {
    outline: none;
    border-color: #B51A1A;
    box-shadow: 0 0 0 3px rgba(255, 125, 50, 0.1);
}

.teams-chat-available-users,
.teams-chat-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.teams-chat-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.teams-chat-user-item:hover {
    background-color: #B51A1A33;
    border-color: #B51A1A;
    transform: translateY(-1px);
}

.teams-chat-user-item.selected {
    background-color: #B51A1A66;
    border-color: #B51A1A;
}

.teams-chat-user-info {
    flex: 1;
    min-width: 0;
}

.teams-chat-user-name {
    font-weight: 600;
    margin-bottom: 2px;
    color: #030408;
}

.teams-chat-user-role,
.teams-chat-user-email {
    font-size: 12px;
    color: #666;
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* Miembros seleccionados */
.teams-chat-selected-members {
    margin-top: 15px;
}

.teams-chat-selected-members h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.teams-chat-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teams-chat-member-tag {
    background-color: #B51A1A;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.teams-chat-member-tag .remove-member {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.teams-chat-member-tag .remove-member:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Botones del modal */
.teams-chat-btn-primary {
    background-color: #B51A1A !important;
    color: white;
    border: 1px solid #B51A1A !important;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px !important;
    transition: background-color 0.2s ease;
}

.teams-chat-btn-primary:hover {
    background-color: #B51A1A33 !important;
    border: 1px solid #B51A1A !important;
}

.teams-chat-btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.teams-chat-btn-secondary {
    background-color: #6c757d;
    color: white !important;
    border: 1px solid #6c757d !important;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px !important;
    transition: background-color 0.2s ease;
}

.teams-chat-btn-secondary:hover {
    background-color: #6c757d33 !important;
    border: 1px solid #B51A1A !important;
}
 
.teams-chat-btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px !important;
    transition: background-color 0.2s ease;
}

.teams-chat-btn-danger:hover {
    background-color: #c82333 !important;
}

/* Contador de mensajes no leídos (shortcode) */
.teams-chat-unread-count {
    display: inline-block;
    background-color: var(--teams-chat-primary, #B51A1A);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.teams-chat-unread-count[data-count="0"] {
    display: none;
}

/* Estados de carga */
.teams-chat-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #B51A1A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Estilos para vista previa de imágenes */
.teams-chat-image-preview {
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
}

.teams-chat-image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.teams-chat-image-preview-container img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.teams-chat-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.teams-chat-remove-image:hover {
    background: rgba(220, 53, 69, 1);
}

.teams-chat-image-preview-text {
    margin: 10px 0 0 0;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* Estilos para imágenes en mensajes */
.teams-chat-message-image {
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    margin: 5px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.teams-chat-message-image:hover {
    transform: scale(1.02);
}

.teams-chat-message-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

/* Loading state para subida de imágenes */
.teams-chat-image-uploading {
    opacity: 0.6;
    pointer-events: none;
}

.teams-chat-upload-progress {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    color: #1976d2;
}

.teams-chat-upload-progress .teams-chat-loading-spinner {
    margin-right: 8px;
}

/* Modal para vista completa de imagen */
.teams-chat-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.teams-chat-image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.teams-chat-image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
}

/* Estilos para funcionalidad de edición y eliminación de mensajes */

/* Acciones del mensaje */
.teams-chat-message-actions {
    display: none;
    position: absolute;
    top: -10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.teams-chat-message:hover .teams-chat-message-actions {
    display: flex;
    gap: 2px;
}

.teams-chat-message-mine .teams-chat-message-actions {
    right: 10px;
}

.teams-chat-message-actions button {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 3px;
    color: #666;
    font-size: 12px;
    transition: all 0.2s ease;
}

.teams-chat-message-actions button:hover {
    background: #f0f0f0;
    color: #333;
}

.teams-chat-message-actions button:disabled,
.teams-chat-message-actions button.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.teams-chat-message-actions button:disabled:hover,
.teams-chat-message-actions button.disabled:hover {
    background: none;
    color: #ccc;
}

.teams-chat-message-edit .dashicons {
    color: #0073aa;
}

.teams-chat-message-delete .dashicons {
    color: #d63638;
}

/* Indicador de mensaje editado */
.teams-chat-message-edited {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-left: 8px;
}

/* Mensaje eliminado */
.teams-chat-message-deleted {
    color: #888;
    font-style: italic;
    opacity: 0.7;
}

.teams-chat-message-deleted-state {
    opacity: 0.6;
}

/* Contenedor de edición */
.teams-chat-edit-container {
    width: 100%;
    margin-top: 5px;
}

.teams-chat-edit-input {
    width: 100%;
    min-height: 40px;
    max-height: 150px;
    padding: 8px 12px;
    border: 2px solid var(--teams-chat-primary, #B51A1A);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    background: #fff;
    color: #333;
    outline: none;
    box-sizing: border-box;
}

.teams-chat-edit-input:focus {
    border-color: var(--teams-chat-primary-hover, #e86e2d);
    box-shadow: 0 0 0 2px rgba(181, 26, 26, 0.1);
}

.teams-chat-edit-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.teams-chat-edit-save,
.teams-chat-edit-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.teams-chat-edit-save {
    background-color: #B51A1A !important;
    color: white;
}

.teams-chat-edit-save:hover {
    background: var(--teams-chat-primary-hover, #e86e2d);
}

.teams-chat-edit-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.teams-chat-edit-cancel {
    background: white;
    color: #00000A;
}

.teams-chat-edit-cancel:hover {
    background: #e0e0e0;
}

/* Estado de edición */
.teams-chat-message-editing {
    background: rgba(181, 26, 26, 0.05);
    border-left: 3px solid var(--teams-chat-primary, #B51A1A);
    padding-left: 8px;
    margin-left: -8px;
    border-radius: 15px;
}

.teams-chat-message-editing .teams-chat-message-actions {
    display: none !important;
}

/* Posicionamiento relativo para mensajes */
.teams-chat-message {
    position: relative;
}

/* Efecto de actualización en tiempo real */
.teams-chat-message-updated {
    animation: messageUpdated 2s ease-in-out;
    transform: scale(1.02);
    box-shadow: 0 2px 12px rgba(181, 26, 26, 0.3);
    border-left: 3px solid var(--teams-chat-primary, #B51A1A);
}

@keyframes messageUpdated {
    0% {
        background-color: rgba(181, 26, 26, 0.1);
        transform: scale(1);
    }
    50% {
        background-color: rgba(181, 26, 26, 0.2);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Efecto de pulso para mensajes editados */
/*.teams-chat-message-edited {
    animation: editedPulse 1s ease-in-out;
}

@keyframes editedPulse {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    50% {
        opacity: 1;
        transform: translateY(0);
        color: var(--teams-chat-primary, #B51A1A);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
} */

/* Efecto de fade para mensajes eliminados */
/* .teams-chat-message-deleted-state {
    animation: messageDeleted 2s ease-in-out;
}

@keyframes messageDeleted {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(0.98);
        background-color: rgba(255, 0, 0, 0.1);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
} */

/* Indicador de cambio en tiempo real */
.teams-chat-message-realtime-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 8px;
    height: 8px;
    background: var(--teams-chat-primary, #B51A1A);
    border-radius: 50%;
    animation: realtimeIndicator 1s ease-in-out;
}

@keyframes realtimeIndicator {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Mejoras visuales para el estado de edición */
.teams-chat-message-editing {
    background: rgba(181, 26, 26, 0.05);
    border-left: 3px solid var(--teams-chat-primary, #B51A1A);
    padding-left: 8px;
    margin-left: -8px;
    transition: all 0.3s ease;
}

/* Efecto de destacado para mensajes recién editados */
/* .teams-chat-message-just-edited {
    background: rgba(181, 26, 26, 0.05);
    border-radius: 8px;
    padding: 4px;
    margin: 2px 0;
    animation: justEdited 3s ease-in-out;
}

@keyframes justEdited {
    0% {
        background-color: rgba(181, 26, 26, 0.15);
        transform: translateX(5px);
    }
    100% {
        background-color: rgba(181, 26, 26, 0.05);
        transform: translateX(0);
    }
} */

/* Loader para actualizaciones */
.teams-chat-updating {
    position: relative;
}

.teams-chat-updating::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--teams-chat-primary, #B51A1A), 
        transparent
    );
    animation: loadingBar 1s ease-in-out infinite;
}

@keyframes loadingBar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Notificación de actualización */
.teams-chat-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--teams-chat-primary, #B51A1A);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10000;
    animation: slideInRight 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .teams-chat-message-actions {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 5px;
        background: none;
        border: none;
        box-shadow: none;
    }
    
    .teams-chat-message:hover .teams-chat-message-actions {
        display: flex;
    }
    
    .teams-chat-edit-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .teams-chat-edit-save,
    .teams-chat-edit-cancel {
        width: 100%;
        padding: 8px;
    }

    .teams-chat-message-updated {
        transform: scale(1.01);
    }
    
    .teams-chat-update-notification {
        right: 10px;
        top: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Mejoras de accesibilidad */
.teams-chat-message-actions button:focus {
    outline: 2px solid var(--teams-chat-primary, #B51A1A);
    outline-offset: 2px;
}

.teams-chat-edit-input:focus {
    outline: none;
}

/* Animaciones */
/* @keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} */

.teams-chat-message-actions {
    animation: fadeIn 0.2s ease;
}

.teams-chat-edit-container {
    animation: fadeIn 0.3s ease;
}

/* Tooltips mejorados */
.teams-chat-message-actions button[title] {
    position: relative;
}

.teams-chat-message-actions button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

.teams-chat-message-actions button[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Indicadores de tiempo */
.teams-chat-time-indicator {
    position: absolute;
    top: -25px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    display: none;
}

.teams-chat-message:hover .teams-chat-time-indicator {
    display: block;
}

/* Animaciones */
/* @keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
} */

/* Estilos CSS corregidos para el sistema de estado de usuario */
/* Agregar al archivo assets/css/frontend.css */

/* Contenedor de estado principal */
.teams-chat-user-status-container {
    padding: 12px 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    position: relative;
}

.teams-chat-status-selector {
    position: relative;
}

.teams-chat-current-status {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #B51A1A;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    min-height: 40px;
    box-sizing: border-box;
}

.teams-chat-current-status:hover {
    border-color: #B51A1A;
    box-shadow: 0 2px 4px rgba(181, 26, 26, 0.2);
    background-color: #B51A1A11;
}

/* Indicadores de estado */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    flex-shrink: 0;
}

/* Animación de pulso para estados activos */
.status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* Colores de estado */
.status-available .status-indicator,
.status-indicator.status-available {
    background-color: #44b700;
}

.status-available .status-indicator::after {
    background-color: #44b700;
}

.status-away .status-indicator,
.status-indicator.status-away {
    background-color: #ffae00;
}

.status-away .status-indicator::after {
    background-color: #ffae00;
}

.status-busy .status-indicator,
.status-indicator.status-busy {
    background-color: #e74c3c;
}

.status-busy .status-indicator::after {
    background-color: #e74c3c;
}

.status-offline .status-indicator,
.status-indicator.status-offline {
    background-color: #95a5a6;
    animation: none;
}

.status-offline .status-indicator::after {
    display: none;
}

/* Texto de estado */
.status-text {
    flex: 1;
    margin-right: 8px;
    font-weight: 500;
}

/* Flecha desplegable */
.teams-chat-current-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Menú desplegable de estados */
.teams-chat-status-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #B51A1A;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.teams-chat-status-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.teams-chat-status-option:hover {
    background-color: #B51A1A11;
}

.teams-chat-status-option:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* Input de mensaje personalizado */
.teams-chat-custom-status {
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.teams-chat-custom-status input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.teams-chat-custom-status input:focus {
    border-color: #B51A1A;
}

.teams-chat-custom-status input::placeholder {
    color: #999;
    font-style: italic;
}

/* Estado en avatares de conversaciones */
.teams-chat-conversation-avatar {
    position: relative;
}

.teams-chat-user-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    z-index: 10; /* Aumentado para estar encima del avatar */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background-clip: content-box; /* Para que el border no afecte el color */
}

.teams-chat-user-status.status-available {
    background-color: #44b700;
}

.teams-chat-user-status.status-away {
    background-color: #ffae00;
}

.teams-chat-user-status.status-busy {
    background-color: #e74c3c;
}

.teams-chat-user-status.status-offline {
    background-color: #95a5a6;
}

/* Asegurar que el avatar no tenga z-index mayor */
.teams-chat-conversation-avatar img {
    position: relative;
    z-index: 1;
    border-radius: 50%;
    display: block;
}

/* Estado en header del chat */
.teams-chat-header-status {
    font-size: 12px;
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    font-weight: normal;
}

/* Estilos adicionales para mayor visibilidad */
.teams-chat-user-status::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.teams-chat-header-status .status-indicator {
    width: 8px;
    height: 8px;
    margin-right: 6px;
}

.teams-chat-header-status.status-available {
    color: #44b700;
    background-color: rgba(68, 183, 0, 0.1);
}

.teams-chat-header-status.status-away {
    color: #ffae00;
    background-color: rgba(255, 174, 0, 0.1);
}

.teams-chat-header-status.status-busy {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.teams-chat-header-status.status-offline {
    color: #95a5a6;
    background-color: rgba(149, 165, 166, 0.1);
}

/* Efecto visual para conversaciones nuevas/actualizadas */
.teams-chat-conversation-updated {
    animation: newConversationPulse 2s ease-in-out;
    background-color: #B51A1A22 !important;
    border: 2px solid #B51A1A !important;
}

@keyframes newConversationPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(181, 26, 26, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(181, 26, 26, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(181, 26, 26, 0);
    }
}

/* Mejora visual para nuevas conversaciones */
.teams-chat-conversation-item.teams-chat-conversation-new {
    background: linear-gradient(135deg, #B51A1A11 0%, #B51A1A22 100%);
    border-left: 4px solid #B51A1A;
    animation: slideInFromLeft 0.5s ease-out;
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}




/* Estilos para conversaciones temporales */
.teams-chat-conversation-item.is-temp {
    opacity: 0.8;
    position: relative;
}

.teams-chat-conversation-item.is-temp::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #f0ad4e;
    border-radius: 50%;
    margin: 8px;
}

.teams-chat-conversation-item.is-temp .teams-chat-conversation-last-message {
    font-style: italic;
    color: #999;
}

/* Animación para nuevas conversaciones */
@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.teams-chat-conversation-item.teams-chat-conversation-updated {
    animation: slideInFromTop 0.3s ease-out;
    background-color: rgba(181, 26, 26, 0.05);
    transition: background-color 2s ease-out;
}






/* Responsive */
@media screen and (max-width: 768px) {
    .teams-chat-user-status-container {
        padding: 8px 10px;
    }
    
    .teams-chat-current-status {
        font-size: 13px;
        padding: 6px 10px;
        min-height: 36px;
    }
    
    .status-indicator {
        width: 8px;
        height: 8px;
        margin-right: 6px;
    }
    
    .teams-chat-status-option {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .teams-chat-user-status {
        width: 18px;
        height: 18px;
        bottom: 1px;
        right: 1px;
        border-width: 2px;
    }
}

/* Transiciones suaves */
.teams-chat-current-status,
.teams-chat-status-option,
.teams-chat-user-status,
.status-indicator {
    transition: all 0.2s ease;
}

/* Fix para elementos que puedan sobrescribir estilos */
.teams-chat-universal-container .status-indicator {
    display: inline-block !important;
    border-radius: 50% !important;
}

.teams-chat-universal-container .teams-chat-current-status {
    display: flex !important;
    align-items: center !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .teams-chat-direct-messages-container {
        flex-direction: column;
        height: 100vh;
    }
    
    .teams-chat-conversations-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 2px solid #B51A1A;
    }
    
    .teams-chat-message-content {
        max-width: 85%;
    }
    
    .teams-chat-conversations-header h3,
    .teams-chat-messages-header h3 {
        font-size: 16px;
    }
    
    .teams-chat-header-buttons {
        gap: 5px;
    }
    
    .teams-chat-new-conversation-btn,
    .teams-chat-new-group-btn,
    .teams-chat-delete-conversation-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

        .teams-chat-message-image {
        max-width: 250px;
    }
    
    .teams-chat-image-preview-container {
        max-width: 150px;
    }
    
    .teams-chat-image-modal img {
        max-width: 95%;
        max-height: 85%;
    }
}

@media screen and (max-width: 480px) {
    .teams-chat-conversation-item {
        padding: 12px;
    }
    
    .teams-chat-conversation-avatar,
    .teams-chat-user-avatar,
    .teams-chat-group-avatar {
        width: 36px;
        height: 36px;
    }
    
    .teams-chat-message-avatar {
        width: 30px;
        height: 30px;
    }
    
    .teams-chat-message {
        margin-bottom: 15px;
    }
    
    .teams-chat-modal-content {
        width: 95%;
        margin: 10px;
    }
}





/* CSS para previsualización de imagen - Añadir al archivo frontend.css */

/* Contenedor de previsualización de imagen */
.teams-chat-image-preview {
    padding: 10px 15px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.teams-chat-preview-container {
    position: relative;
    display: inline-block;
    max-width: 200px;
    background: white;
    border: 2px solid #B51A1A;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.teams-chat-preview-container img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.teams-chat-remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(181, 26, 26, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 2;
}

.teams-chat-remove-preview:hover {
    background: rgba(181, 26, 26, 1);
    transform: scale(1.1);
}

.teams-chat-remove-preview .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.teams-chat-preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 8px 6px 4px;
    font-size: 11px;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.teams-chat-preview-filename {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teams-chat-preview-size {
    display: block;
    opacity: 0.9;
    font-size: 10px;
}

/* Indicador de carga mejorado */
.teams-chat-upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(181, 26, 26, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    z-index: 10;
}

.teams-chat-upload-progress .teams-chat-loading-spinner {
    margin-bottom: 5px;
}

/* Ajustar el formulario cuando hay imagen */
.teams-chat-message-form.has-image-preview .teams-chat-input-wrapper {
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
}

/* Botón de imagen mejorado */
#teams-chat-image-btn {
    position: relative;
}

#teams-chat-image-btn.uploading {
    pointer-events: none;
    opacity: 0.6;
}

#teams-chat-image-btn.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid #B51A1A;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .teams-chat-preview-container {
        max-width: 150px;
    }
    
    .teams-chat-preview-container img {
        max-height: 100px;
    }
    
    .teams-chat-preview-info {
        padding: 6px 4px 2px;
        font-size: 10px;
    }
}