/* ==== THEME AZUL OSCURO CON GLASSMORFISMO ==== */

/* Estilo base */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    height: 100vh;
    overflow: hidden;
    color: #e2e8f0;
}

.container {
    display: flex;
    height: 100vh;
    backdrop-filter: blur(10px);
}

/* CONTACTOS (columna izquierda) */
#contactos {
    width: 25%;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow-y: auto;
    padding: 10px;
}

/* Cada tarjeta de contacto */




.contacto {
    display: flex;
    align-items: center;
    padding: 10px 35px 28px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    background: rgba(71, 85, 105, 0.4);
    transition: background 0.2s ease;
    position: relative;
    color: #e2e8f0;
}

.contacto:hover {
    background: rgba(71, 85, 105, 0.6);
}

.contacto.activo {
    background: rgba(96, 165, 250, 0.4);
    font-weight: bold;
}

.foto {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #3b82f6;
}

.contacto .info {
    margin-left: 10px;
    width: calc(100% - 55px); /* para que no se desborde */
}

.contacto .info strong {
    font-size: 14px;
    color: white;
    display: block;
    margin-bottom: 2px;
}

/* 🆕 Contenedor para mensaje + fecha */
.contacto .mensaje-y-fecha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.contacto .mensaje-y-fecha .mensaje {
    font-size: 12px;
    color: #f1f1f1;
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.contacto .mensaje-y-fecha .fecha-msg {
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
    text-align: right;
}

.badge {
    color: #fff;
    background: #3b82f6;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 20px;
    position: absolute;
    right: 36px;
    bottom: 6px;
}


/* CHAT */
#chat {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(15px);
    padding: 0;
    overflow: hidden;
}

/* Encabezado del chat */
#encabezado_chat {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(10px);
}

#foto_contacto {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #94a3b8;
}

#encabezado_chat div {
    margin-left: 10px;
}

#nombre_contacto {
    font-size: 16px;
    font-weight: bold;
    border: none;
    background: transparent;
    color: #e2e8f0;
    outline: none;
}

#telefono_contacto {
    font-size: 13px;
    color: #94a3b8;
}

/* MENSAJES */
#mensajes {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mensaje {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    position: relative;
    margin-bottom: 3px;
    word-break: break-word;
    white-space: pre-wrap;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.mensaje.enviado {
    align-self: flex-end;
    background: rgba(59, 130, 246, 0.6);
    color: #fff;
}

.mensaje.recibido {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.mensaje-hora {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
    text-align: right;
}

.contenido {
    display: block;
}

/* FORMULARIO DE MENSAJE */
#formMensaje {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(10px);
}

#formMensaje input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    font-size: 15px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    outline: none;
}

#formMensaje button {
    padding: 10px 20px;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    background: #3b82f6;
    color: white;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

#formMensaje button:hover {
    background: #2563eb;
}

.separador-fecha {
    text-align: center;
    margin: 15px auto;
    padding: 6px 12px;
    background: rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: 13px;
    font-weight: bold;
    border-radius: 12px;
    width: fit-content;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Botón subir archivo */
.btn-subir-archivo {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
    line-height: 1;
    margin-right: 5px;
    color: #e2e8f0;
}

.btn-subir-archivo:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-subir-archivo input[type="file"] {
    display: none;
}

/* Eliminar conversación */
.btn-eliminar {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
}

.btn-eliminar:hover {
    color: #ef4444;
}

/* Scrollbar Glassmorfismo */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) rgba(255,255,255,0.05);
}





