/* AURORA — GLASS CHROME / ELECTRIC BLUE / BLACK / RED
   Rediseño visual audaz. Se conserva la estructura y funcionalidad original.
*/

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: #f4f8ff;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 32, 32, 0.24), transparent 22%),
        radial-gradient(circle at 88% 18%, rgba(0, 110, 255, 0.32), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(0, 72, 255, 0.22), transparent 34%),
        #00030a;
    overflow: hidden;
}

/* 📦 Contenedor principal — cristal oscuro */
.chat-container {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background:
        linear-gradient(145deg,
            rgba(255,255,255,0.10),
            rgba(12,22,48,0.38) 34%,
            rgba(0,18,55,0.56) 72%,
            rgba(255,255,255,0.06));
    border-left: 1px solid rgba(74, 170, 255, 0.28);
    border-right: 1px solid rgba(74, 170, 255, 0.28);
    box-shadow:
        inset 1px 0 0 rgba(255,255,255,0.13),
        inset -1px 0 0 rgba(0,130,255,0.16),
        0 0 70px rgba(0, 75, 255, 0.22);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
}

/* Reflejo cromado lateral */
.chat-container::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            rgba(0, 130, 255, 0.20),
            transparent 4%,
            transparent 95%,
            rgba(0, 100, 255, 0.22)),
        linear-gradient(180deg,
            rgba(255,255,255,0.10),
            transparent 12%,
            transparent 82%,
            rgba(0,100,255,0.12));
}

/* 🟦 Header — cristal eléctrico */
.header {
    position: relative;
    z-index: 2;
    min-height: 70px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;

    background:
        linear-gradient(135deg,
            rgba(2, 12, 30, 0.88),
            rgba(0, 38, 105, 0.68) 52%,
            rgba(5, 10, 24, 0.90));
    border-bottom: 1px solid rgba(42, 165, 255, 0.48);
    box-shadow:
        0 8px 28px rgba(0, 40, 160, 0.28),
        inset 0 -1px 0 rgba(255,255,255,0.12),
        inset 0 1px 0 rgba(255,255,255,0.10);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.header::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #087dff, #25dfff, #087dff, transparent);
    box-shadow: 0 0 14px rgba(0, 170, 255, 0.85);
}

.avatar-header {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(84, 207, 255, 0.75);
    box-shadow:
        0 0 0 3px rgba(0, 91, 255, 0.12),
        0 0 22px rgba(0, 129, 255, 0.60),
        inset 0 0 12px rgba(255,255,255,0.20);
}

.header-text {
    line-height: 1.2;
    text-shadow: 0 1px 12px rgba(0, 150, 255, 0.38);
}

.header-text span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #a9ddff;
    opacity: 0.95;
}

/* 💬 Área de chat */
#chat {
    flex: 1;
    overflow-y: auto;
    padding: 18px 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    scroll-behavior: smooth;

    background:
        radial-gradient(circle at 50% 40%, rgba(0, 83, 255, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,8,28,0.24));
}

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

#chat::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.28);
}

#chat::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: linear-gradient(180deg, #008cff, #183cff);
    box-shadow: 0 0 10px rgba(0, 132, 255, 0.65);
}

/* 💬 Mensajes */
.msg {
    position: relative;
    margin: 9px 0;
    padding: 13px 16px;
    border-radius: 18px;
    display: inline-block;
    width: fit-content;
    max-width: 82%;
    min-width: 120px;

    word-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;

    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.1px;

    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.16),
        inset 0 -1px 0 rgba(0,0,0,0.28),
        0 8px 24px rgba(0,0,0,0.24);
}

/* 👤 Usuario — azul eléctrico con reflejo */
.user {
    align-self: flex-end;
    color: #ffffff;
    background:
        linear-gradient(135deg,
            rgba(0, 75, 255, 0.86),
            rgba(0, 156, 255, 0.62) 54%,
            rgba(0, 35, 145, 0.84));
    border: 1px solid rgba(67, 194, 255, 0.66);
    border-bottom-right-radius: 5px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.26),
        inset 0 -10px 25px rgba(0,0,90,0.16),
        0 8px 28px rgba(0, 82, 255, 0.30);
}

/* 🤖 Bot — vidrio negro/cobalto */
.bot {
    align-self: flex-start;
    color: #eaf5ff;
    background:
        linear-gradient(135deg,
            rgba(10, 18, 35, 0.78),
            rgba(0, 33, 83, 0.58) 58%,
            rgba(2, 8, 20, 0.82));
    border: 1px solid rgba(52, 143, 255, 0.42);
    border-bottom-left-radius: 5px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 0 24px rgba(0, 94, 255, 0.08),
        0 8px 28px rgba(0, 0, 0, 0.34);
}

/* 🧾 Input área — barra de cristal */
.input-area {
    position: sticky;
    z-index: 3;
    bottom: 0;
    display: flex;
    gap: 9px;
    padding: 11px;
    background:
        linear-gradient(180deg,
            rgba(0, 8, 22, 0.56),
            rgba(1, 5, 15, 0.88));
    border-top: 1px solid rgba(54, 159, 255, 0.40);
    box-shadow:
        0 -10px 30px rgba(0, 41, 150, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(25px) saturate(170%);
    -webkit-backdrop-filter: blur(25px) saturate(170%);
}

/* ✏️ Input */
input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 15px;
    border: 1px solid rgba(74, 164, 255, 0.34);
    outline: none;

    font-size: 15px;
    color: #ffffff;

    background:
        linear-gradient(135deg,
            rgba(255,255,255,0.08),
            rgba(0, 51, 120, 0.34));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.13),
        inset 0 0 18px rgba(0, 92, 255, 0.08),
        0 0 0 1px rgba(0,0,0,0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input::placeholder {
    color: rgba(192, 221, 255, 0.58);
}

input:focus {
    border-color: rgba(20, 188, 255, 0.82);
    box-shadow:
        0 0 0 2px rgba(0, 119, 255, 0.12),
        0 0 22px rgba(0, 140, 255, 0.24),
        inset 0 1px 0 rgba(255,255,255,0.16);
}

/* 🔘 Botón — acento rojo/cobalto */
button {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;

    padding: 14px 19px;
    border: 1px solid rgba(255, 93, 93, 0.68);
    border-radius: 15px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;

    background:
        linear-gradient(135deg,
            #ff2424 0%,
            #c90024 52%,
            #640018 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        inset 0 -10px 22px rgba(45,0,8,0.20),
        0 0 20px rgba(255, 24, 45, 0.30),
        0 8px 22px rgba(0,0,0,0.30);

    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

button::before {
    content: "";
    position: absolute;
    top: -30%;
    left: -80%;
    width: 45%;
    height: 160%;
    transform: rotate(24deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.42), transparent);
    transition: left 0.45s ease;
}

button:hover {
    transform: translateY(-2px) scale(1.03);
    filter: saturate(125%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.34),
        0 0 28px rgba(255, 28, 48, 0.48),
        0 10px 28px rgba(0,0,0,0.38);
}

button:hover::before {
    left: 125%;
}

button:active {
    transform: scale(0.98);
}

/* 📱 Responsive */
@media (max-width: 600px) {

    body {
        background:
            radial-gradient(circle at 0% 0%, rgba(255, 24, 24, 0.20), transparent 26%),
            radial-gradient(circle at 100% 20%, rgba(0, 105, 255, 0.28), transparent 32%),
            #00030a;
    }

    .chat-container {
        max-width: 100%;
        border-left: 0;
        border-right: 0;
    }

    .header {
        min-height: 64px;
        padding: 9px 11px;
        gap: 10px;
    }

    .avatar-header {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .header-text {
        font-size: 15px;
    }

    .header-text span {
        font-size: 11px;
    }

    #chat {
        padding: 14px 10px 16px;
    }

    .msg {
        max-width: 88%;
        min-width: 100px;
        font-size: 14px;
        padding: 11px 13px;
        border-radius: 16px;
    }

    .input-area {
        gap: 7px;
        padding: 8px;
    }

    input {
        padding: 13px 13px;
        font-size: 15px;
        border-radius: 13px;
    }

    button {
        padding: 13px 15px;
        border-radius: 13px;
        font-size: 13px;
    }
}
