/* =========================
   RESET
========================= */
*{
    box-sizing:border-box;
}

/* =========================
   BASE
========================= */
body{
    margin:0;
    height:100vh;
    background:radial-gradient(circle at top,#f1f5f9,#dbe3ef);
    font-family:Inter,Arial,sans-serif;
    display:flex;
    flex-direction:column;
    color:#0f172a;
    overflow:hidden;
}

/* =========================
   HEADER
========================= */
.chat-header{
    display:flex;
    align-items:center;
    gap:14px;
    padding:16px 24px;
    background:linear-gradient(90deg,#020617,#111827,#020617);
    color:#f8fafc;
    font-size:18px;
    font-weight:900;
    letter-spacing:1px;
    box-shadow:0 14px 40px rgba(0,0,0,.6);
}

/* ✅ LOGO CON PALPITO SUAVE */
.chat-logo{
    width:40px;
    height:40px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,.9);
    box-shadow:0 0 0 rgba(255,255,255,.6);
    animation:logoPulse 3s ease-in-out infinite;
}

/* =========================
   CONTENEDOR CHAT
========================= */
#chat-container{
    flex:1;
    display:flex;
    flex-direction:column;
    padding:18px;
    min-height:0;
}

/* =========================
   CAJA MENSAJES
========================= */
#chat-box{
    flex:1;
    background:rgba(15,23,42,.06);
    border-radius:24px;
    padding:24px;
    overflow-y:auto;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,.12),
        0 22px 50px rgba(0,0,0,.25);
}

/* =========================
   MENSAJE BASE (100% ESTÁTICO)
========================= */
.chat-message{
    display:flex;
    gap:14px;
    margin-bottom:22px;
}

/* =========================
   AVATAR
========================= */
.avatar{
    width:46px;
    height:46px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    color:#fff;
    box-shadow:0 10px 22px rgba(0,0,0,.45);
}

/* =========================
   MENSAJE USUARIO
========================= */
.message-content{
    background:linear-gradient(180deg,#111827,#020617);
    padding:16px 18px;
    border-radius:18px;
    max-width:75%;
    box-shadow:0 14px 30px rgba(0,0,0,.6);
}

.user-name{
    font-family:'Roboto',sans-serif;
    font-size:13px;
    font-weight:700;
    color:#cbd5f5;
    display:flex;
    align-items:center;
    gap:6px;
    margin-bottom:6px;
}

.message-text{
    font-size:14px;
    color:#f8fafc;
    line-height:1.55;
}

/* =========================
   ADMIN – MODO DIOS
========================= */
.chat-message:has(.user-name strong){
    align-items:flex-start;
}

.chat-message:has(.user-name strong) .avatar{
    background:radial-gradient(circle at top,#fde68a,#f59e0b,#b45309);
    color:#422006;
    box-shadow:
        0 0 0 4px rgba(250,204,21,.5),
        0 0 26px rgba(250,204,21,.9);
}

.chat-message:has(.user-name strong) .message-content{
    background:linear-gradient(135deg,#020617,#1e293b,#020617);
    border:2px solid rgba(250,204,21,.8);
    box-shadow:
        0 0 0 2px rgba(250,204,21,.35),
        0 0 40px rgba(250,204,21,.45),
        0 20px 50px rgba(0,0,0,.8);
}

.chat-message:has(.user-name strong) .user-name{
    font-size:15px;
    font-weight:900;
    letter-spacing:1px;
    color:#fde68a;
    text-transform:uppercase;
}

.admin-badge{
    background:linear-gradient(45deg,#fde047,#f59e0b);
    color:#422006;
    font-size:10px;
    font-weight:900;
    padding:4px 12px;
    border-radius:999px;
    box-shadow:0 6px 18px rgba(0,0,0,.6);
}

.chat-message:has(.user-name strong) .message-text{
    font-size:15px;
}

/* =========================
   FORM
========================= */
#chat-form{
    margin-top:16px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

#chat-form input{
    background:#f8fafc;
    border:none;
    padding:14px;
    border-radius:16px;
    font-size:14px;
    box-shadow:0 8px 18px rgba(0,0,0,.25);
}

/* =========================
   BOTONES (SIN TRANSFORM)
========================= */
.button-container{
    display:flex;
    gap:12px;
}

#chat-form button{
    flex:1;
    background:linear-gradient(180deg,#1e293b,#020617);
    border:none;
    border-radius:16px;
    padding:14px;
    color:#f8fafc;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 12px 26px rgba(0,0,0,.45);
}

/* =========================
   SEPARADOR DIA
========================= */
.day-separator{
    text-align:center;
    font-size:12px;
    color:#64748b;
    margin:26px 0;
    letter-spacing:2px;
}

/* =========================
   EMOJIS (SIN TRANSFORM)
========================= */
#emoji-picker{
    display:none;
    position:absolute;
    background:#fff;
    border-radius:18px;
    padding:8px;
    z-index:1000;
    box-shadow:0 24px 50px rgba(0,0,0,.45);
}

.emoji{
    cursor:pointer;
    font-size:20px;
    padding:6px;
    border-radius:10px;
}

.emoji:hover{
    background:#e5e7eb;
}

/* =========================
   ANIMACIÓN LOGO
========================= */
@keyframes logoPulse{
    0%{
        transform:scale(1);
        box-shadow:
            0 0 0 0 rgba(255,255,255,.5),
            0 0 0 rgba(255,255,255,0);
    }
    50%{
        transform:scale(1.04);
        box-shadow:
            0 0 0 10px rgba(255,255,255,.08),
            0 0 28px rgba(255,255,255,.25);
    }
    100%{
        transform:scale(1);
        box-shadow:
            0 0 0 0 rgba(255,255,255,0),
            0 0 0 rgba(255,255,255,0);
    }
}