/* ═══════════════════════════════════════════════
   24Hat AI Chat Widget — CSS
   Glassmorphism + Teal accent (#67e6dc)
   ═══════════════════════════════════════════════ */

/* ── Google Font (Inter) ──────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Floating Action Button (FAB) ─────────────── */
#hat24-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #67e6dc 0%, #41c9bc 100%);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(103, 230, 220, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#hat24-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(103, 230, 220, 0.6);
}

/* ── Chat Widget Container ────────────────────── */
#hat24-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 99999;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 500px;
    max-height: 70vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;            /* toggled via JS */
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    animation: hat24SlideUp 0.3s ease forwards;
}

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

/* ── Header ───────────────────────────────────── */
#hat24-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #67e6dc 0%, #41c9bc 100%);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

#hat24-btn-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: opacity 0.2s;
}
#hat24-btn-close:hover {
    opacity: 0.7;
}

/* ── Messages Area ────────────────────────────── */
#hat24-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Scrollbar */
#hat24-chat-messages::-webkit-scrollbar {
    width: 5px;
}
#hat24-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

/* ── Chat Bubbles ─────────────────────────────── */
.hat24-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: hat24FadeIn 0.25s ease;
}

@keyframes hat24FadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.hat24-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #67e6dc, #41c9bc);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.hat24-bot {
    align-self: flex-start;
    background: #f0f4f8;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

/* ── Footer / Input Area ──────────────────────── */
#hat24-chat-footer {
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

#hat24-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    background: #fff;
    max-height: 100px;
    transition: border-color 0.2s;
}
#hat24-input:focus {
    border-color: #67e6dc;
}

#hat24-btn-send {
    margin-left: 8px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #67e6dc 0%, #41c9bc 100%);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}
#hat24-btn-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(103, 230, 220, 0.5);
}
#hat24-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Mobile Responsive ────────────────────────── */
@media (max-width: 420px) {
    #hat24-chat-widget {
        right: 8px;
        bottom: 80px;
        width: calc(100vw - 16px);
        height: 60vh;
    }
    #hat24-fab {
        right: 14px;
        bottom: 14px;
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
}
