/* ---------------- RESET ---------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------------- BODY ---------------- */
body {
    height: 100vh;
    background: linear-gradient(135deg, #f8fafc, #fefce8);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1e293b;
}

/* ---------------- CHAT CONTAINER ---------------- */
.chat-container {
    width: 100%;
    max-width: 460px;
    height: 92vh;
    background: #fffef9;
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(30, 41, 59, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(30, 41, 59, 0.12);
}

/* ---------------- HEADER ---------------- */
.chat-header {
    padding: 16px 20px;
    background: #041931; /* blue from your logo */
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px; /* spacing between logo and text */
    border-radius: 22px 22px 0 0; /* rounded top corners */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* ---------------- CHAT BODY WITH EMOJI BACKGROUND ---------------- */
.chat-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #fffdfa;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ctext x='20' y='40' font-size='26' opacity='0.15'%3E💬%3C/text%3E%3Ctext x='90' y='90' font-size='26' opacity='0.15'%3E🧠%3C/text%3E%3Ctext x='40' y='130' font-size='26' opacity='0.15'%3E🩺%3C/text%3E%3C/svg%3E");
}

/* ---------------- SCROLLBAR ---------------- */
.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(30, 41, 59, 0.25);
    border-radius: 10px;
}

/* ---------------- MESSAGE BASE ---------------- */
.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeUp 0.25s ease;
}

/* ---------------- BOT MESSAGE ---------------- */
.bot {
    background: rgba(30, 41, 59, 0.9);
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

/* ---------------- USER MESSAGE ---------------- */
.user {
    background: #fef3c7;
    color: #1e293b;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    border: 1px solid rgba(30, 41, 59, 0.15);
}

/* ---------------- INPUT AREA ---------------- */
.chat-input {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid rgba(30, 41, 59, 0.12);
}

/* ---------------- INPUT ---------------- */
.chat-input input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 30px;
    border: 1px solid rgba(30, 41, 59, 0.2);
    background: #fffef9;
    color: #1e293b;
    outline: none;
    font-size: 14px;
}

.chat-input input::placeholder {
    color: #64748b;
}

/* ---------------- BUTTON ---------------- */
.chat-input button {
    padding: 14px 22px;
    border-radius: 30px;
    border: none;
    background: rgba(30, 41, 59, 0.9);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(30, 41, 59, 0.35);
}

/* ---------------- OPTION BUTTONS ---------------- */
.option-btn {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    border: 1px solid rgba(30, 41, 59, 0.2);
    color: #1e293b;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: #fef3c7;
    transform: scale(1.03);
}

/* ---------------- TYPING INDICATOR ---------------- */
.typing {
    font-style: italic;
    opacity: 0.7;
    background: rgba(30, 41, 59, 0.6);
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    padding: 14px 18px;
    max-width: 50%;
    display: flex;
    gap: 4px;
}

/* Animated three dots for typing */
.typing::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    margin-left: 2px;
    animation: blink 1.4s infinite both;
}

.typing::after,
.typing::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    margin-left: 2px;
    animation: blink 1.4s infinite both;
}

.typing::before {
    animation-delay: 0.2s;
}

.typing::after {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* ---------------- ANIMATION ---------------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.restart-btn {
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #002b5b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.restart-btn:hover {
    background-color: #0056a0;
}
