/* ── H2Os Chatbot Widget Styles ─────────────────────────────────────────── */



#h2os-chat-widget {
    --green:  #82ad35;
    --blue:   #82ad35;
    --dark:   #5a7c1e;
    --white:  #ffffff;
    --radius: 18px;
    --shadow: 0 8px 32px rgba(0,0,0,0.18);
    font-family: 'Inter', sans-serif;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
}

/* ── Launcher button ──────────────────────────────────────────────────────── */
#h2os-launcher {
    width: 120px;
    height: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#h2os-launcher:hover {
    transform: scale(1.08);
}

#h2os-droplet-icon {
    width: 120px;
    height: auto;
    object-fit: contain;
    object-position: center;
}

#h2os-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 11px;
    height: 11px;
    background: #ff4f4f;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.3); opacity: 0.7; }
}

/* ── Chat panel ───────────────────────────────────────────────────────────── */
#h2os-panel {
    position: absolute;
    bottom: 136px;
    right: 0;
    width: 320px;
    max-height: 500px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slide-up 0.25s ease;
    border: 1.5px solid rgba(0,151,213,0.15);
}

#h2os-panel[hidden] { display: none; }

@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ───────────────────────────────────────────────────────────────── */
#h2os-header {
    background: linear-gradient(135deg, var(--blue) 0%, #5a7c1e 100%);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    flex-shrink: 0;
}

#h2os-header-mascot {
    width: 32px;
    height: auto;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
    margin-bottom: -4px;
}

#h2os-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

#h2os-header-text strong {
    font-size: 13.5px;
    font-weight: 700;
}

#h2os-header-text span {
    font-size: 10.5px;
    opacity: 0.85;
    font-weight: 500;
}

#h2os-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#h2os-close:hover { background: rgba(255,255,255,0.35); }

/* ── Messages area ────────────────────────────────────────────────────────── */
#h2os-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5fbfe;
    scroll-behavior: smooth;
}

#h2os-messages::-webkit-scrollbar { width: 4px; }
#h2os-messages::-webkit-scrollbar-track { background: transparent; }
#h2os-messages::-webkit-scrollbar-thumb { background: #b8dff0; border-radius: 4px; }

.h2os-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.h2os-msg.bot {
    background: var(--white);
    color: var(--dark);
    border: 1.5px solid rgba(0,151,213,0.15);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.h2os-msg.user {
    background: linear-gradient(135deg, var(--green), #6a9228);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-weight: 500;
}

.h2os-msg.bot ul {
    margin: 4px 0 0 0;
    padding-left: 16px;
}

.h2os-msg.bot li { margin-bottom: 2px; }

/* Typing indicator */
.h2os-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    background: var(--white);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    border: 1.5px solid rgba(0,151,213,0.15);
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.h2os-typing span {
    width: 6px;
    height: 6px;
    background: var(--blue);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
    opacity: 0.7;
}

.h2os-typing span:nth-child(2) { animation-delay: 0.2s; }
.h2os-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* ── Input area ───────────────────────────────────────────────────────────── */
#h2os-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1.5px solid rgba(0,151,213,0.12);
    background: var(--white);
    flex-shrink: 0;
}

#h2os-input {
    flex: 1;
    border: 1.5px solid #c8e8f5;
    border-radius: 12px;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--dark);
    resize: none;
    outline: none;
    max-height: 90px;
    overflow-y: auto;
    background: #f5fbfe;
    transition: border-color 0.2s;
    line-height: 1.4;
}

#h2os-input:focus { border-color: var(--blue); background: white; }
#h2os-input::placeholder { color: #313a3e; }

#h2os-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--blue), #5a7c1e);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(130,173,53,0.35);
}

#h2os-send:hover { transform: scale(1.1); box-shadow: 0 4px 14px rgba(130,173,53,0.45); }
#h2os-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

#h2os-send svg { width: 14px; height: 14px; }

/* ── Jiggle animation ─────────────────────────────────────────────────────── */
@keyframes jiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20%       { transform: rotate(-8deg) scale(1.05); }
    40%       { transform: rotate(6deg) scale(1.05); }
    60%       { transform: rotate(-4deg) scale(1.02); }
    80%       { transform: rotate(3deg) scale(1.02); }
}

.h2os-jiggle { animation: jiggle 0.6s ease; }

/* ── Greeting bubble ──────────────────────────────────────────────────────── */
#h2os-greeting {
    position: absolute;
    bottom: 136px;
    right: 0;
    background: white;
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: #1a3a2a;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1.5px solid rgba(130,173,53,0.25);
    max-width: 200px;
    line-height: 1.4;
    animation: slide-up 0.3s ease;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

#h2os-greeting:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.2); }

#h2os-greeting::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 22px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
    #h2os-panel {
        width: calc(100vw - 24px);
        right: -12px;
        bottom: 134px;
    }
    #h2os-greeting {
        max-width: 160px;
    }
}

/* ── Mobile fixes ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Prevent iOS zoom on input focus */
    #h2os-input {
        font-size: 16px !important;
    }

    /* Override site's p tag styles inside the chat */
    #h2os-chat-widget p,
    #h2os-chat-widget .h2os-msg p {
        font-size: 12.5px !important;
        line-height: 1.5 !important;
        margin: 0 0 4px !important;
    }

    #h2os-chat-widget .h2os-msg {
        font-size: 12.5px !important;
    }
}