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

.room-list li {
    margin-bottom: 0.5rem;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.room-list li:hover {
    border-color: #c8d4e0;
}

.room-list li.active-room {
    border-color: var(--header-bg);
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.2);
}

.room-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: background-color 0.2s;
    width: 100%;
}

.room-list .active-room a {
    background-color: var(--header-bg);
    color: white;
    font-weight: 600;
}

.room-list .count {
    font-size: 0.85rem;
    background-color: #e0e6ed;
    color: #555;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.room-list .active-room .count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

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

.user-list a {
    display: block;
    padding: 0.6rem 0;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.user-list a:hover {
    color: var(--header-bg);
}

#connectionStatus {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    color: white;
}

.status-connected {
    background-color: #2ecc71;
}

.status-disconnected {
    background-color: #e74c3c;
}

/* Mensajes: ahora en fila con avatar y burbuja */
.chat-messages .message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Burbujas del contenedor principal (por defecto alineadas a la izquierda) */
.chat-messages .message .bubble {
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background: var(--other-message-bg);
    color: #222;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    box-sizing: border-box;
    max-width: calc(100% - 72px);
}

/* Avatar styling */
.avatar-chat {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 48px;
}

/* Nombre y contenido dentro de la burbuja */
.message-header {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}
.message-content {
    display: block;
    line-height: 1.35;
    word-break: break-word;
}

/* Mensaje propio: alinear a la derecha, invertir orden visual */
.chat-messages .message.mine {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.chat-messages .message.mine .bubble {
    background: var(--my-message-bg);
    color: #ffffff;
    margin-left: 0;
    margin-right: 12px;
}

.chat-messages .message.mine .avatar-chat {
    margin-left: 12px;
    margin-right: 0;
}

/* Mensajes de otros usuarios */
.chat-messages .message.other .bubble {
    background: var(--other-message-bg);
    color: #222;
    margin-right: 0;
    margin-left: 12px;
}

/* Notificaciones de sistema */
.notification {
    text-align: center;
    width: 100%;
    color: #666;
    font-style: italic;
    padding: 6px 0;
}

/* Input y botones */
.input-wrapper {
    position: relative;
    display: flex;
    flex-grow: 1;
    align-items: center;
}

#messageInput {
    width: 100%;
    padding: 0.8rem 3.2rem 0.8rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.emoji-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.emoji-toggle-btn:hover {
    opacity: 1;
}

.picker {
    position: absolute;
    bottom: 120%;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

#sendBtn {
    width: 48px;
    height: 48px;
    border: none;
    background-color: var(--header-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#sendBtn svg {
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
    stroke-width: 2;
    fill: none;
}

.private-chat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.private-chat-item a {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.private-chat-item .avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 36px;
}

.close-chat-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.5rem;
    line-height: 1;
    color: #95a5a6;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    z-index: 10;
}

.close-chat-btn:hover {
    color: var(--notification-red);
}

.unread-badge {
    background-color: var(--notification-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 2px 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: 8px;
    flex-shrink: 0;
}

.room-list a:focus-visible,
.user-list a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
    border-radius: 8px;
}

.leave-room-btn {
    background: #f1f0f0;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

.leave-room-btn:active {
    background-color: #e74c3c;
    color: white;
    transform: scale(0.95);
}

.leave-room-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* 🔇 Ocultar visualmente el indicador de estado de conexión */
#connectionStatus {
  display: none !important;
}

