/* ============================================================
   style.css — Matched to secured script.js
   
   CLASS/ID AUDIT vs script.js:
   ✅ #chat-box            — chatBox reference
   ✅ #user-input          — userInput reference
   ✅ #send-btn            — sendBtn reference
   ✅ #main-wrapper        — toggleChat() target
   ✅ #typing-id           — typing indicator div id
   ✅ #current-typing      — streaming bot bubble id
   ✅ .message-container   — wrapper for every message row
   ✅ .bot-container       — bot row alignment
   ✅ .user-container      — user row alignment
   ✅ .message             — base bubble style
   ✅ .bot-bubble          — bot message bubble
   ✅ .user-bubble         — user message bubble
   ✅ .avatar              — bot logo image
   ✅ .typing-indicator    — animated dots wrapper
   ✅ .typing-indicator span — individual dot
   ✅ .fab-button          — floating open/close button
   ✅ .fab-icon-img        — robot image inside FAB
   ✅ .chat-wrapper        — the whole chat panel (hidden/shown)
   ✅ .chat-header         — top header bar
   ✅ .online-dot          — green status dot
   ✅ .chat-box            — scrollable message area
   ✅ .suggestions-container — chip row
   ✅ .chip                — quick-reply button
   ✅ .input-area          — input + send row
   ✅ .contact-form-link   — special anchor style inside bot bubble
   ============================================================ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
    --navy:       #124E66;
    --maroon:     #E2311B;
    --light-gray: #f4f7f6;
}

/* ─── Base ───────────────────────────────────────────────────── */
body 

/* ─── Floating Action Button ─────────────────────────────────── */
/* Used by: toggleChat() in script.js via onclick="toggleChat()" */
.fab-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.fab-button:hover {
    transform: scale(1.1);
}

/* Used by: <img class="fab-icon-img"> in index.html */
.fab-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

/* ─── Chat Panel (#main-wrapper / .chat-wrapper) ─────────────── */
/* Used by: toggleChat() — adds/removes .active class on #main-wrapper */
.chat-wrapper {
    display: none !important;       /* hidden by default */
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 80vh;
    max-height: 700px;
    background: white;
    border-radius: 20px;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow: hidden;
}

.chat-wrapper.active {
    display: flex !important;       /* shown when JS adds .active */
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Chat Header ────────────────────────────────────────────── */
/* Used by: index.html <div class="chat-header"> */
.chat-header {
    background: var(--navy);
    padding: 15px;
    color: white;
    text-align: center;
    border-bottom: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Used by: <span class="online-dot"> in index.html */
.online-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}

/* ─── Scrollable Message Area (#chat-box) ────────────────────── */
/* Used by: chatBox = document.getElementById('chat-box') in script.js */
.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Message Row Containers ─────────────────────────────────── */
/* Used by: container.className = 'message-container bot-container'  */
/*          container.className = 'message-container user-container' */
.message-container {
    display: flex;
    align-items: flex-end;
    max-width: 85%;
}

.bot-container {
    align-self: flex-start;
    gap: 8px;
}

.user-container {
    align-self: flex-end;
    flex-direction: row-reverse;
    gap: 8px;
}

/* ─── Avatar Image ───────────────────────────────────────────── */
/* Used by: <img class="avatar"> injected in script.js bot rows */
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    margin: 0 4px;
    flex-shrink: 0;
}

/* ─── Message Bubbles ────────────────────────────────────────── */
/* Used by: bubble.className = 'message bot-bubble'  */
/*          bubble.className = 'message user-bubble' */
.message {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.bot-bubble {
    background: var(--navy);
    color: white;
    border-radius: 15px 15px 15px 0;
}

.user-bubble {
    background: var(--maroon);
    color: white;
    border-radius: 15px 15px 0 15px;
}

/* ─── Links inside Bot Bubbles ───────────────────────────────── */
/* Used by: formatResponse() builds <a> tags; DOMPurify allows them */
.bot-bubble a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.bot-bubble a:hover {
    color: #f0f0f0;
}

/* Used by: class="contact-form-link" on anchor tags in chat.py responses */
.bot-bubble a.contact-form-link {
    color: var(--maroon);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.bot-bubble a.contact-form-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.bot-bubble a.contact-form-link:active,
.bot-bubble a.contact-form-link:visited:active {
    color: #4169E1;
}

/* ─── Typing Indicator ───────────────────────────────────────── */
/* Used by: typingDiv.innerHTML includes <div class="typing-indicator">  */
/*          with three <span> children                                    */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--navy);
    border-radius: 15px 15px 15px 0;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40%            { transform: scale(1); }
}

/* ─── Suggestion Chips ───────────────────────────────────────── */
/* Used by: <div class="suggestions-container"> + <button class="chip"> in index.html */
/* Chips call sendQuickReply() via onclick                                              */
.suggestions-container {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    overflow-x: auto;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Hide scrollbar on chips row (cosmetic) */
.suggestions-container::-webkit-scrollbar { display: none; }
.suggestions-container { -ms-overflow-style: none; scrollbar-width: none; }

.chip {
    background: white;
    color: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
    font-family: 'Inter', sans-serif;
}

.chip:hover {
    background: var(--navy);
    color: white;
}

/* ─── Input Area ─────────────────────────────────────────────── */
/* Used by: <div class="input-area">, #user-input, #send-btn in index.html */
/* JS: userInput = getElementById('user-input'), sendBtn = getElementById('send-btn') */
.input-area {
    padding: 12px 15px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

#user-input {
    flex: 1;
    border: none;
    background: #f0f0f0;
    padding: 12px 20px;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

#user-input::placeholder {
    color: #aaa;
}

#send-btn {
    background: var(--maroon);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
    flex-shrink: 0;
}

#send-btn svg {
    width: 18px;
    fill: white;
}

#send-btn:hover {
    transform: scale(1.1);
}