﻿.chat-container {
    display: flex;
    flex-direction: column;
    height: 85vh;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    max-width: 700px;
    margin: auto;
    margin-top: 90px;
    width: 100%
}

.chat-header {
    background-color: #075e54;
    color: white;
    padding: 10px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 20px;
    overflow-y: auto;
    background: #e5ddd5;
}

.chat-message {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    min-width: 15%;
}

    .chat-message p {
        margin-bottom: 5px;
    }

    .chat-message.mio {
        background-color: #dcf8c6;
        margin-left: auto;
        border-top-right-radius: 0;
    }

    .chat-message.otro {
        background-color: #fff;
        margin-right: auto;
        border-top-left-radius: 0;
    }

    .chat-message span {
        font-size: 0.75em;
        color: gray;
        display: block;
        float: right;
        margin-left: 5px;
    }

.chat-form {
    display: flex;
    border-top: 1px solid #ccc;
    padding: 10px;
    background-color: #f7f7f7;
}

    .chat-form input[type="text"] {
        flex: 1;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 20px;
    }

    .chat-form button {
        padding: 10px;
        background-color: #128c7e;
        color: white;
        border: none;
        border-radius: 20px;
    }

.chat-list ul {
    list-style: none;
    padding: 0;
}

.chat-item {
    border-bottom: 1px solid #ddd;
    padding: 10px;
}

.chat-list a {
    text-decoration: none;
    color: inherit;
}

    .chat-list a:hover {
        background-color: #f0f0f0;
    }

.chat-header {
    background-color: #075e54;
    color: white;
    padding: 10px;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.chat-nombre {
    width: 100%;
    margin: 0;
    font-size: 1.5em;
    font-weight: 500;
}

.chat-date-separator {
    text-align: center;
    margin: 10px 0;
    color: #666;
    font-size: 0.85em;
}

    .chat-date-separator span {
        background-color: #d6d6d6;
        padding: 4px 10px;
        border-radius: 10px;
    }

.floating-date {
    position: sticky;
    top: 0;
    text-align: center;
    background: #d4d4d4;
    padding: 4px 10px;
    border-radius: 10px;
    margin: 0 auto 10px auto;
    width: fit-content;
    z-index: 2;
    font-size: 0.85em;
    color: #333;
}

.chat-date-marker {
    width: 100%;
    text-align: center;
    color: gray;
    font-size: 13px;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .chat-form button#emoji-button {
        cursor: pointer;
    }

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    margin-right: 5px;
}

.emoji-wrapper {
    position: relative;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    margin-right: 5px;
}

.emoji-menu {
    display: none;
    width: 300px;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 1.2em;
    user-select: none;
    white-space: nowrap;
    z-index: 1000;
}

    .emoji-menu span {
        cursor: pointer;
        margin: 3px;
    }

        .emoji-menu span:hover {
            background: #f0f0f0;
            border-radius: 4px;
        }

.file-upload-wrapper {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.file-btn {
    background-color: #128c7e;
    border: none;
    color: white;
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .file-btn:hover {
        background-color: #0b6f60;
    }

.chat-message a.file-link {
    display: block;
    background-color: #f1f0f0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    color: #333;
    font-weight: 500;
    max-width: 100%;
    word-break: break-all;
    position: relative;
    text-decoration: none;
    margin-top: 4px;
}

    .chat-message a.file-link:hover {
        background-color: #c9c9c9;
    }

    .chat-message a.file-link::before {
        content: "📎";
        position: absolute;
        left: 10px;
        top: 10px;
        font-size: 1.2em;
    }

    .chat-message a.file-link span {
        margin-top: 0px !important;
        margin-left: 24px;
        display: block;
    }

.file-card {
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.file-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.file-info {
    flex-grow: 1;
    overflow: hidden;
}

.file-link {
    text-decoration: none;
    color: #075e54;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .file-link:hover {
        text-decoration: underline;
    }


.emoji-menu.visible {
    display: block;
}

.emoji-category-title {
    font-weight: bold;
    margin: 10px 0 5px;
    font-size: 14px;
    color: #444;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 6px;
}

.emoji-item {
    font-size: 22px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s;
}

    .emoji-item:hover {
        transform: scale(1.2);
    }

.emoji-tabs {
    font-size: 9px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

    /* Webkit-based browsers */
    .emoji-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .emoji-tabs::-webkit-scrollbar-track {
        background: transparent;
    }

    .emoji-tabs::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 4px;
    }

        .emoji-tabs::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

/* Firefox */
.emoji-tabs {
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}

.emoji-tab {
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.2em;
    border-radius: 6px 6px 0 0;
    background: #eee;
    user-select: none;
    transition: background 0.2s;
    white-space: nowrap;
}

    .emoji-tab.active {
        background: #fff;
        font-weight: bold;
        border-bottom: 2px solid #075e54;
    }

.emoji-content {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin; /* Para Firefox */
    scrollbar-color: #ccc transparent; /* Para Firefox */
}

    /* Para Chrome, Edge, Safari */
    .emoji-content::-webkit-scrollbar {
        width: 6px; /* ancho del scrollbar */
    }

    .emoji-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .emoji-content::-webkit-scrollbar-thumb {
        background-color: #bbb;
        border-radius: 4px;
    }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 6px;
    padding: 5px 0;
}

.chat-message-wrapper {
    position: relative;
    max-width: 80%;
}

    .chat-message-wrapper.mio {
        margin-left: auto;
    }

    .chat-message-wrapper.otro {
        margin-right: auto;
    }

.eliminar-form {
    position: relative;
    top: -3px;
    right: 3px;
}

.eliminar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 2px;
    transition: color 0.2s ease;
}

    .eliminar-btn:hover {
        color: red;
    }

.chat-wrapper {
    display: flex;
    height: 85vh;
    max-width: 1000px;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
}

/* Sidebar de contactos */
.sidebar {
    width: 300px;
    background-color: #f0f0f0;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    margin-top: 90px;
    border: 1px solid #ccc;
}

.sidebar-header {
    padding: 15px;
    font-weight: bold;
    background-color: #075e54;
    color: white;
    font-size: 1.2em;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.contact-list-wrapper {
    overflow-y: auto;
    flex-grow: 1;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-item a,
.contact-item form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #ddd;
    position: relative;
}

    .contact-item a:hover, .contact-item form:hover {
        background-color: #e0e0e0;
    }

.contact-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #ef7f13;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
    color: white;
    font-size: 1em;
    margin-right: 10px;
}

.contact-name {
    flex-grow: 1;
    display: block;
    flex-direction: column;
    justify-content: center;
}

.chat-container {
    display: flex;
    flex-direction: column;
}


.chat-header {
    height: 60px; /* o el alto real de tu encabezado */
    flex-shrink: 0;
}

.chat-messages {
    flex-grow: 1; /* ocupa el espacio restante */
    overflow-y: auto;
}

.chat-form {
    flex-shrink: 0;
    padding: 10px;
    background-color: #f7f7f7;
}

.mensaje-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    color: gray;
}

.fa-check-double.leido {
    color: #34B7F1;
    font-size: 0.9em;
    margin-left: 4px;
}

.unread-badge {
    background-color: #dc3545;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    position: absolute;
    right: 10px;
    top: 8px;
    z-index: 2;
}

.lastTime {
    font-size: 10px;
    color: #777;
    position: absolute;
    right: 10px;
    bottom: 0px;
}

.iconSuperAdmin {
    display: inline-flex;
    padding-right: 5px;
}

.btn-enviar {
    background-color: #128c7e;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .btn-enviar .flecha {
        display: none;
    }

.chat-count {
    float: right;
    border: 1px solid white;
    border-radius: 30px;
    padding: 5px 10px;
    margin-top: -5px;
    margin-bottom: -5px;
    background: white;
    color: #075e54;
}

@media (max-width: 768px) {
    .chat-wrapper {
        flex-direction: column;
        height: 95vh;
    }

    .sidebar {
        margin-top: 10px;
        margin-bottom: 10px;
        width: 100%;
        height: 50vh;
        order: 2;
        overflow-y: auto;
    }

    .chat-container {
        margin-top: 70px;
        order: 1;
        height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .chat-form {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 10px;
        background-color: #f7f7f7;
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

        .chat-form input[type="text"] {
            flex: 1;
            padding: 10px 14px;
            border: 1px solid #ccc;
            border-radius: 20px;
            font-size: 15px;
        }

        .emoji-wrapper,
        .file-upload-wrapper,
        .chat-form button[type="submit"] {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: none;
            border: none;
            font-size: 20px;
        }

        .chat-form button[type="submit"] {
            background-color: #128c7e;
            color: white;
            border-radius: 50%;
            font-size: 16px;
            width: 40px;
            height: 40px;
        }

            .chat-form button[type="submit"]::after {
                content: "➤"; /* ícono flecha tipo enviar */
                font-size: 18px;
            }

    .emoji-btn,
    .file-btn {
        background: transparent;
        border: none;
        font-size: 20px;
        cursor: pointer;
    }

    .btn-enviar {
        padding: 10px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

        .btn-enviar .texto {
            display: none;
        }

        .btn-enviar .flecha {
            display: none;
        }
}
#btnChatAll:hover {
    background-color: gray;
}

#ChatNoLeidos.badge::after {
    content: attr(data-count);
}
