html, 
body {
    height: 100% !important;
}
.header{
    border-bottom: 1px solid #AFAFAF;
}
.bg_parallax {
    height: 100% !important;    
}
.col_md_12 {
    height: 100% !important;    
}
#container {
    height: 100% !important;    
}
.container {
    max-width: 100% !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    height: 100% !important;    
}
.page-info{
    padding-top: 50px; 
    padding-bottom: 30px; 
}
.md-chat{
    padding-top: 0px;
    padding-left: 0px;
    padding-right: 41px;
    height: 100% !important;    
}
#cometchat{
    height: 100% !important;
}
#main_container{
    height: 100% !important;
}
#cometchat_embed_synergy_container{
    width: 100% !important;
    height: 100% !important;
    border: 0px !important;
}
.side_menu .fa-comments{
  color: #560099 !important;
  background: #d1ef0c;
}
#cometchat_embed_synergy_container{
    border-radius: 0px !important;
}

#cometchat_synergy_iframe{
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 992px){
    .md-chat{
        padding-right: 0px !important;    
    }
    #cometchat_userstab{
        display: none !important;
    }    
}
@media (min-width: 1200px){
    .container {
        max-width: 100% !important;
    }
}
@media (max-width: 1200px){
    .page-info{
        padding-bottom: 0px; 
    }
}

.md-chat-page{
    display: none !important;
}
.main-menu-left{
    display: none !important;
}

#cometchat_header {
}

.cometchat_userlist_hover:hover .cometchat_userdisplayname{
    font-weight: 600;
}

.md-chat-information{
    height: 800px;
    background-image: url(../img/user/chat/bg.jpg);
    background-repeat: no-repeat;
    background-size: contain;
}

.text-left {
    margin-left: 315px;
}

/* ============================================
   CHAT UI - Ventanas de chat modernas
   ============================================ */

.chat-ui-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: visible;
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    overflow: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10001 !important;
    animation: chatWindowSlideIn 0.3s ease;
}

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

.chat-window.is-active {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.chat-window__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #76ED00 0%, #5db300 100%);
    color: #ffffff;
    cursor: move;
    user-select: none;
}

.chat-window__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.chat-window__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.chat-window__header-text {
    flex: 1;
    min-width: 0;
}

.chat-window__name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window__status {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window__close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-window__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-window__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.chat-window__messages-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    margin-bottom: 8px;
    animation: messageSlideIn 0.2s ease;
}

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

.message--own {
    justify-content: flex-end;
}

.message--received {
    justify-content: flex-start;
}

.message__content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
}

.message--own .message__content {
    background: linear-gradient(135deg, #76ED00 0%, #5db300 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message--received .message__content {
    background: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message__text {
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.message__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
}

.message--own .message__meta {
    justify-content: flex-end;
}

.message__time {
    font-size: 11px;
}

.message__status {
    font-size: 10px;
}

.chat-window__input-container {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e8e8e8;
}

.chat-window__form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-window__input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-window__input:focus {
    border-color: #76ED00;
    box-shadow: 0 0 0 3px rgba(118, 237, 0, 0.1);
}

.chat-window__send {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #76ED00 0%, #5db300 100%);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chat-window__send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(118, 237, 0, 0.3);
}

.chat-window__send:active {
    transform: scale(0.95);
}

/* Scrollbar personalizado */
.chat-window__messages::-webkit-scrollbar {
    width: 6px;
}

.chat-window__messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-window__messages::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.chat-window__messages::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100% - 40px);
        height: calc(100% - 40px);
        max-height: calc(100vh - 40px);
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
}

/* Estados de mensaje */
.message[data-status="pending"] .message__content {
    opacity: 0.7;
}

.message[data-status="error"] .message__content {
    background: #ff4444 !important;
    color: #ffffff !important;
}

/* ============================================
   INDICADOR DE CARGA - Mensajes antiguos (Infinite Scroll)
   ============================================ */

.chat-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    color: #666666;
    font-size: 13px;
    background: transparent;
    border: none;
    animation: fadeIn 0.2s ease;
}

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

.chat-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #76ED00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.chat-loading-indicator span {
    font-weight: 500;
    user-select: none;
}