/* =========================================================
   CHAT EMPRESARIALHOST
   ========================================================= */

#ehc-chat {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 30px auto;
    font-family: Arial, sans-serif;
}

.ehc-window {
    width: 100%;
    height: 430px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ehc-header {
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.ehc-header-title {
    font-size: 16px;
    font-weight: 700;
}

.ehc-header-subtitle {
    font-size: 12px;
    color: #777;
    margin-top: 3px;
}


/* =========================================================
   MENSAJES
   ========================================================= */

.ehc-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    background: #f3f4f6;
}

.ehc-msg {
    max-width: 82%;
    margin: 0 0 6px;
    padding: 6px 9px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ddd;
}

.ehc-msg-name {
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    color: #666;
}

.ehc-msg-text {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #222;
    word-break: break-word;
}

.ehc-msg-time {
    display: none !important;
}

.ehc-msg-admin {
    border-left: 3px solid #2271b1;
}

.ehc-msg-user {
    border-left: 3px solid #ddd;
}


/* =========================================================
   COMPOSER
   ========================================================= */

.ehc-compose,
.ehc-admin-compose {
    display: flex;
    gap: 7px;
    padding: 9px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.ehc-compose input,
.ehc-admin-compose input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 14px;
}

.ehc-compose button,
.ehc-admin-compose button {
    min-height: 38px;
}


/* =========================================================
   NOMBRE
   ========================================================= */

.ehc-name-box {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.ehc-name-box input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 0 10px;
}


/* =========================================================
   EMOJIS
   ========================================================= */

.ehc-emoji-wrap {
    position: relative;
}

.ehc-emoji-picker {
    position: absolute;
    bottom: 45px;
    right: 0;
    width: 230px;
    max-height: 190px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 9px;
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
    z-index: 999;
}

.ehc-emoji-item {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 21px;
    border-radius: 6px;
}

.ehc-emoji-item:hover {
    background: #f1f1f1;
}


/* =========================================================
   MENSAJE DE BANEO
   ========================================================= */

.ehc-ban-info {
    padding: 10px 12px;
    margin: 0 9px 8px;
    border-radius: 8px;
    background: #ffe5e5;
    color: #a00000;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}


/* =========================================================
   CONECTADOS - PUBLICO
   ========================================================= */

.ehc-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    background: #f3f4f6;
}

.ehc-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ehc-main .ehc-messages {
    min-height: 0;
}

.ehc-connected {
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 10px;
    overflow-y: auto;
}

.ehc-connected-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.ehc-connected-list {
    padding-top: 5px;
}

.ehc-connected-user {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 2px;
    font-size: 12px;
    color: #333;
    word-break: break-word;
}

.ehc-online-dot {
    color: #25b45b;
    font-size: 11px;
    line-height: 1;
}

.ehc-connected-name {
    font-weight: 600;
}

.ehc-connected-empty {
    font-size: 12px;
    color: #888;
    padding: 12px 2px;
    line-height: 1.4;
}

.ehc-connected-count {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #eee;
    font-size: 10px;
    color: #777;
}


/* =========================================================
   ADMIN
   ========================================================= */

.ehc-admin-page {
    max-width: 1400px;
}

.ehc-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 15px;
    align-items: stretch;
}

.ehc-admin-chat {
    min-width: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.ehc-admin-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.ehc-admin-chat-head strong {
    font-size: 15px;
}

.ehc-admin-chat .ehc-messages {
    min-height: 500px;
    max-height: 650px;
}


/* =========================================================
   ADMIN - USUARIOS
   ========================================================= */

.ehc-admin-users {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.ehc-admin-users-section {
    padding: 12px;
}

.ehc-admin-banned-section {
    border-top: 1px solid #e5e5e5;
}

.ehc-admin-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    padding-bottom: 9px;
    border-bottom: 1px solid #eee;
    margin-bottom: 7px;
}

.ehc-admin-user {
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ehc-admin-user:last-child {
    border-bottom: 0;
}

.ehc-admin-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
}

.ehc-admin-online-dot {
    color: #25b45b;
    font-size: 11px;
    line-height: 1;
}

.ehc-admin-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.ehc-ban-button,
.ehc-unban-button {
    width: 100%;
    justify-content: center;
    font-size: 11px !important;
    line-height: 1.2 !important;
    min-height: 30px !important;
    padding: 5px 7px !important;
}

.ehc-ban-button {
    color: #a00000 !important;
    border-color: #e0b0b0 !important;
}

.ehc-unban-button {
    color: #176b35 !important;
    border-color: #a9d7b8 !important;
}

.ehc-admin-banned-user {
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ehc-admin-banned-user:last-child {
    border-bottom: 0;
}

.ehc-admin-banned-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
    margin-bottom: 3px;
}

.ehc-admin-banned-time {
    font-size: 11px;
    color: #888;
    margin-bottom: 7px;
}

.ehc-admin-empty {
    font-size: 12px;
    color: #888;
    padding: 10px 2px;
    line-height: 1.4;
}


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

@media (max-width: 900px) {

    .ehc-admin-layout {
        grid-template-columns:
            minmax(0, 1fr)
            230px;
    }

    .ehc-body {
        grid-template-columns:
            minmax(0, 1fr)
            170px;
    }
}


@media (max-width: 700px) {

    .ehc-admin-layout {
        grid-template-columns: 1fr;
    }

    .ehc-admin-users {
        order: 2;
    }

    .ehc-admin-chat {
        order: 1;
    }

    .ehc-body {
        grid-template-columns: 1fr;
    }

    .ehc-connected {
        border-left: 0;
        border-top: 1px solid #ddd;
        max-height: 125px;
        overflow-y: auto;
        padding: 10px 12px;
    }

    .ehc-connected-list {
        display: flex;
        flex-wrap: wrap;
        gap: 3px 12px;
        padding-top: 5px;
    }

    .ehc-connected-user {
        padding: 4px 0;
    }

    .ehc-connected-count {
        margin-top: 5px;
        padding-top: 6px;
    }
}
/* =========================================================
   CORRECCIÓN COMPOSER - TODO EN UNA SOLA LÍNEA
   ========================================================= */

.ehc-compose {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ehc-compose .ehc-emoji-wrap {
    flex: 0 0 auto !important;
    width: auto !important;
}

.ehc-compose input[type="text"],
.ehc-compose input[type="search"] {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
}

.ehc-compose button {
    flex: 0 0 auto !important;
}

.ehc-compose #ehc-message {
    height: 38px !important;
    box-sizing: border-box !important;
}


/* ADMIN TAMBIÉN EN UNA SOLA LÍNEA */

.ehc-admin-compose {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
}

.ehc-admin-compose #ehc-admin-message {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}


/* MÓVIL */

@media (max-width: 500px) {

    .ehc-compose {
        gap: 5px !important;
        padding: 7px !important;
    }

    .ehc-compose #ehc-message {
        font-size: 13px !important;
    }

}
/* =========================================================
   COLOR DEL TEXTO EN LOS CAMPOS DE MENSAJE
   ========================================================= */

.ehc-compose input,
.ehc-compose #ehc-message,
.ehc-admin-compose input,
.ehc-admin-compose #ehc-admin-message {
    color: #222 !important;
    background-color: #fff !important;
    caret-color: #222 !important;
}

.ehc-compose input::placeholder,
.ehc-compose #ehc-message::placeholder,
.ehc-admin-compose input::placeholder,
.ehc-admin-compose #ehc-admin-message::placeholder {
    color: #777 !important;
    opacity: 1 !important;
}



/* Elementor: el chat no debe aparecer dentro del editor/preview. */
body.elementor-editor-active #ehc-chat,
body.elementor-editor-preview #ehc-chat {
    display: none !important;
}
