/* ============================================
   GLASS MESSAGING - Estilos Glass para Mensajería
   ============================================ */

/* Estilo Glass para popups de Magnific */
.mfp-bg {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mfp-wrap .glass-popup {
    margin: 40px auto;
}

/* Sobrescribir estilos de .small-dialog para usar glass */
.zoom-anim-dialog.glass-popup {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
    padding: 0 !important;
    max-width: 500px !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.2) !important;
}

/* Header del popup */
.glass-popup .small-dialog-header,
.glass-popup .glass-popup-header {
    background: linear-gradient(135deg, #1B5D63 0%, #144a50 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 24px 24px 0 0;
}

.glass-popup .small-dialog-header h3,
.glass-popup .glass-popup-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Mensaje reply */
.glass-popup .message-reply {
    padding: 32px;
}

.glass-popup .message-reply textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.glass-popup .message-reply textarea:focus {
    border-color: #1B5D63;
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 93, 99, 0.1);
}

.glass-popup .message-reply .button,
.glass-popup .message-reply button {
    width: 100%;
    padding: 14px 24px;
    background: #1B5D63;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.glass-popup .message-reply .button:hover,
.glass-popup .message-reply button:hover {
    background: #144a50;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(27, 93, 99, 0.3);
}

.glass-popup .message-reply .button i.fa-spin {
    display: none;
}

.glass-popup .message-reply .button.loading i.fa-spin {
    display: inline-block;
}

/* Notificaciones */
.glass-popup .notification {
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.glass-popup .notification.success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.glass-popup .notification.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Botón cerrar */
.glass-popup button.mfp-close {
    color: white !important;
    opacity: 1 !important;
    font-size: 32px !important;
    font-weight: 300 !important;
    transition: all 0.3s ease !important;
    top: -5px !important;
    right: 0px !important;
}
.og-close:before, .mfp-close:before{
    color: white !important;
}
.glass-popup button.mfp-close:hover {
    transform: rotate(90deg);
    opacity: 0.8 !important;
}

/* ============================================
   CHATS EN DASHBOARD - Estilo Glass
   ============================================ */

.chats-page,
.mensajes-page {
    background: #fafafa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.chats-layout,
.mensajes-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
}

.chats-sidebar,
.mensajes-sidebar {
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.chats-sidebar h3 {
    padding: 24px 20px 16px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.chats-search,
.mensajes-search {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    margin: 0 16px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.chats-search:focus-within,
.mensajes-search:focus-within {
    border-color: #1B5D63;
    box-shadow: 0 0 0 3px rgba(27, 93, 99, 0.1);
}

.chats-search svg,
.mensajes-search svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.chats-search input,
.mensajes-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
    background: transparent;
}

.conversation-list,
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.conversation-item,
.conversation-item-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.conversation-item:hover,
.conversation-item-user:hover {
    background: rgba(27, 93, 99, 0.06);
}

.conversation-item.active,
.conversation-item-user.active {
    background: rgba(27, 93, 99, 0.1);
}

.conversation-avatar,
.conversation-avatar-clinic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.conversation-avatar img,
.conversation-avatar-clinic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-info,
.conversation-info-user {
    flex: 1;
    min-width: 0;
}

.conversation-name,
.conversation-name-user {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview,
.conversation-preview-user {
    font-size: 1rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time,
.conversation-meta-user {
    font-size: 0.75rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.conversation-badge-user {
    display: inline-block;
    background: #1B5D63;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 4px;
}

/* Área de mensajes */
.chats-main,
.mensajes-main {
    display: flex;
    flex-direction: column;
    background: white;
}

.chats-empty-state,
.mensajes-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.chats-empty-state svg,
.mensajes-empty-state svg {
    color: #d1d5db;
    margin-bottom: 20px;
}

.chats-empty-state h3,
.mensajes-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.chats-empty-state p,
.mensajes-empty-state p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .chats-layout,
    .mensajes-layout {
        grid-template-columns: 1fr;
    }
    
    .chats-sidebar,
    .mensajes-sidebar {
        display: none;
    }
    
    /* Mostrar sidebar en móvil con toggle */
    .chats-sidebar.show,
    .mensajes-sidebar.show {
        display: flex;
    }
}
