* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 22px 4.7vw 28px;
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: #edfaff;
    background:
        radial-gradient(circle at 90% 20%, rgba(0, 229, 255, .24), transparent 27%),
        radial-gradient(circle at 12% 78%, rgba(0, 132, 190, .22), transparent 31%),
        linear-gradient(135deg, #02070b 0%, #071923 48%, #02151d 100%);
}

/* =========================================================
   AURORA — CIAN ELÉCTRICO / AZUL PETRÓLEO / GRAFITO
   Inspirado en la referencia hexagonal metálica.
   ========================================================= */

.chat-container {
    width: 100%;
    max-width: 1500px;
    height: calc(100vh - 50px);
    min-height: 620px;
    margin: 0 auto;
    padding: 24px 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(41, 213, 241, .48);
    border-radius: 42px;
    background:
        linear-gradient(145deg,
            rgba(6, 30, 40, .96),
            rgba(2, 13, 19, .98) 55%,
            rgba(3, 35, 45, .96));
    box-shadow:
        inset 0 0 80px rgba(0, 188, 218, .09),
        inset 0 1px 0 rgba(128, 241, 255, .10),
        0 25px 75px rgba(0, 0, 0, .60);
    backdrop-filter: blur(18px);
}

/* Resplandor cian */
.chat-container::before {
    content: "";
    position: absolute;
    width: 620px;
    height: 620px;
    right: -300px;
    top: -310px;
    border-radius: 50%;
    background: rgba(0, 220, 255, .17);
    filter: blur(100px);
    pointer-events: none;
}

/* Brillo lineal muy sutil */
.chat-container::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 188px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(40, 188, 217, .25),
        rgba(125, 244, 255, .82),
        rgba(40, 188, 217, .25),
        transparent
    );
    opacity: .58;
    pointer-events: none;
}

/* =========================
   ENCABEZADO
   ========================= */

.header {
    flex: 0 0 auto;
    min-height: 180px;
    padding: 2px 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    background: transparent;
    box-shadow: none;
}

.avatar-header {
    width: 94px;
    height: 94px;
    object-fit: contain;
    border-radius: 0;
    filter:
        drop-shadow(0 0 14px rgba(0, 226, 255, .48))
        drop-shadow(0 0 28px rgba(0, 117, 171, .22));
}

.header-text {
    line-height: 1.2;
}

.header-text strong {
    display: block;
    margin-top: 2px;
    font-size: clamp(25px, 2.15vw, 38px);
    font-weight: 650;
    letter-spacing: .24em;
    color: #dffcff;
    text-shadow:
        0 0 15px rgba(71, 231, 255, .58),
        0 2px 3px rgba(0, 0, 0, .65);
}

.header-text span {
    display: block;
    margin-top: 10px;
    font-size: clamp(15px, 1.2vw, 20px);
    font-weight: 400;
    opacity: .92;
    color: #d1e7ec;
}

/* =========================
   ÁREA DE CHAT
   ========================= */

#chat {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 4px solid rgba(36, 165, 193, .42);
    border-radius: 34px;
    background:
        linear-gradient(180deg,
            rgba(3, 24, 32, .92),
            rgba(1, 10, 15, .96));
    box-shadow:
        inset 0 0 48px rgba(0, 164, 194, .08),
        0 0 28px rgba(0, 188, 226, .07);
    scrollbar-width: thin;
    scrollbar-color: rgba(49, 216, 240, .62) transparent;
}

#chat::-webkit-scrollbar {
    width: 7px;
}

#chat::-webkit-scrollbar-track {
    background: transparent;
}

#chat::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(101, 239, 255, .85),
        rgba(0, 129, 164, .85)
    );
    border-radius: 20px;
}

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

.msg {
    margin: 8px 0;
    padding: 13px 18px;
    display: inline-block;
    width: fit-content;
    max-width: 82%;
    min-width: 120px;
    border-radius: 20px;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 1.55;
}

.welcome {
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 13px 22px 13px 76px;
    position: relative;
    border: 1px solid rgba(49, 201, 225, .27);
    border-radius: 30px;
    background:
        linear-gradient(90deg,
            rgba(9, 64, 79, .72),
            rgba(4, 30, 39, .56));
    color: #f0fcff;
    font-size: 18px;
    box-shadow: inset 0 0 26px rgba(0, 197, 226, .06);
}

.welcome::before {
    content: "✦";
    position: absolute;
    left: -2px;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border: 1px solid #49e7ff;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%,
            #1d8eaa,
            #064457 68%,
            #03141c);
    color: #e9fdff;
    font-size: 25px;
    box-shadow:
        0 0 22px rgba(0, 221, 255, .30),
        0 0 36px rgba(0, 126, 168, .12);
}

.user {
    align-self: flex-end;
    color: #ffffff;
    background:
        linear-gradient(135deg,
            rgba(0, 139, 170, .98),
            rgba(0, 75, 105, .99));
    border: 1px solid rgba(77, 229, 249, .50);
    border-bottom-right-radius: 4px;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .28);
}

.bot {
    align-self: flex-start;
    color: #eaf7fa;
    background:
        linear-gradient(135deg,
            rgba(27, 42, 48, .98),
            rgba(8, 18, 22, .99));
    border: 1px solid rgba(78, 134, 148, .28);
    border-bottom-left-radius: 4px;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .22);
}

/* =========================
   BOTÓN COPIAR
   ========================= */

.msg button {
    border: 1px solid rgba(54, 221, 244, .68);
    border-radius: 10px;
    padding: 8px 13px;
    background:
        linear-gradient(135deg,
            rgba(5, 89, 111, .96),
            rgba(3, 42, 55, .99));
    color: #c9f7ff;
    font-size: 12px;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.msg button:hover {
    transform: translateY(-1px);
    background:
        linear-gradient(135deg,
            rgba(8, 132, 157, .98),
            rgba(3, 63, 80, .99));
}

/* =========================
   BARRA DE ENTRADA
   ========================= */

.input-area {
    flex: 0 0 auto;
    min-height: 98px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    bottom: auto;
    border: 1px solid rgba(47, 196, 222, .50);
    border-radius: 34px;
    background:
        linear-gradient(135deg,
            rgba(5, 54, 69, .97),
            rgba(3, 22, 29, .99));
    box-shadow:
        inset 0 0 30px rgba(0, 193, 222, .08),
        inset 0 1px 0 rgba(129, 238, 255, .08),
        0 0 22px rgba(0, 0, 0, .34);
}

input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 66px;
    padding: 0 22px;
    border: 1px solid rgba(63, 126, 143, .38);
    border-radius: 0;
    outline: none;
    background:
        linear-gradient(180deg,
            rgba(3, 14, 18, .98),
            rgba(1, 8, 11, .99));
    color: #f2fcff;
    font-size: 18px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, .38);
}

input::placeholder {
    color: #8daab2;
    opacity: 1;
}

input:focus {
    border-color: rgba(66, 226, 248, .72);
    box-shadow:
        inset 0 0 22px rgba(0, 0, 0, .38),
        0 0 17px rgba(0, 210, 242, .13);
}

/* =========================
   BOTONES EXISTENTES
   ========================= */

button {
    flex: 0 0 76px;
    width: 76px;
    height: 66px;
    padding: 0;
    border: 1px solid rgba(74, 224, 247, .72);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%,
            #087d99,
            #045069 70%,
            #02232e);
    color: #effeff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow:
        inset 0 0 18px rgba(61, 224, 247, .20),
        0 0 18px rgba(0, 207, 239, .10);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

button:hover {
    transform: scale(1.04);
    background:
        radial-gradient(circle at 35% 30%,
            #0faacb,
            #06627e 70%,
            #033341);
    box-shadow:
        inset 0 0 20px rgba(93, 238, 255, .27),
        0 0 25px rgba(0, 220, 255, .19);
}

#voiceBtn {
    margin-right: 8px;
    width: 66px;
    height: 66px;
    flex-basis: 66px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#voiceBtn.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.14); }
    100% { transform: scale(1); }
}

/* =========================
   CELULAR
   ========================= */

@media (max-width: 600px) {
    body {
        padding: 8px;
        overflow: hidden;
    }

    .chat-container {
        height: calc(100dvh - 16px);
        min-height: 0;
        max-width: 100%;
        padding: 14px 12px;
        gap: 12px;
        border-radius: 24px;
    }

    .chat-container::after {
        top: 151px;
        left: 8%;
        right: 8%;
    }

    .header {
        min-height: 150px;
        padding: 0 10px;
        gap: 5px;
    }

    .avatar-header {
        width: 76px;
        height: 76px;
    }

    .header-text strong {
        font-size: 24px;
        letter-spacing: .17em;
    }

    .header-text span {
        margin-top: 7px;
        font-size: 13px;
        line-height: 1.35;
    }

    #chat {
        padding: 20px 15px;
        border-width: 3px;
        border-radius: 25px;
    }

    .msg {
        max-width: 90%;
        font-size: 15px;
        padding: 11px 14px;
    }

    .welcome {
        padding: 12px 12px 12px 58px;
        font-size: 15px;
    }

    .welcome::before {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .input-area {
        min-height: 76px;
        padding: 9px;
        gap: 8px;
        border-radius: 25px;
    }

    input {
        height: 56px;
        padding: 0 14px;
        font-size: 16px;
    }

    button {
        flex-basis: 58px;
        width: 58px;
        height: 56px;
        font-size: 11px;
    }

    #voiceBtn {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        font-size: 19px;
    }
}
