/* =============================================================
   GrowScience AI Chatbot — Stylesheet v2.0
   ============================================================= */

/* ── Floating Bubble ── */
#gsc-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-size: 26px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: gsc-pop-in 0.5s ease forwards;
}
#gsc-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0,0,0,0.32);
}
@keyframes gsc-pop-in {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
#gsc-bubble-close { color: #fff; font-size: 20px; font-weight: bold; }

/* ── Chat Widget ── */
#gsc-chat-widget {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    max-height: 560px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    animation: gsc-slide-up 0.3s ease;
}
@keyframes gsc-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
#gsc-chat-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    flex-shrink: 0;
}
#gsc-header-info { display: flex; align-items: center; gap: 10px; }
#gsc-avatar {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
#gsc-chat-header strong { display: block; font-size: 14px; font-weight: 700; }
#gsc-status { font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.gsc-dot {
    width: 7px; height: 7px;
    background: #7fff7f; border-radius: 50%;
    display: inline-block;
    animation: gsc-pulse 1.5s infinite;
}
@keyframes gsc-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
#gsc-close-btn {
    background: none; border: none; color: #fff;
    font-size: 18px; cursor: pointer; padding: 4px;
    opacity: 0.85; transition: opacity 0.2s;
}
#gsc-close-btn:hover { opacity: 1; }

/* ── Messages ── */
#gsc-messages {
    flex: 1; overflow-y: auto;
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
.gsc-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px; line-height: 1.55;
    animation: gsc-fade-in 0.25s ease;
    word-break: break-word;
}
@keyframes gsc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.gsc-msg.bot {
    background: #f1f8f2;
    border-bottom-left-radius: 4px;
    align-self: flex-start; color: #333;
}
.gsc-msg.bot a { color: #1a6b2f; font-weight: 600; text-decoration: none; }
.gsc-msg.bot a:hover { text-decoration: underline; }
.gsc-msg.user {
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* ── Typing Indicator ── */
.gsc-typing {
    display: flex; gap: 5px;
    padding: 12px 14px;
    background: #f1f8f2;
    border-radius: 16px; border-bottom-left-radius: 4px;
    align-self: flex-start; width: fit-content;
}
.gsc-typing span {
    width: 7px; height: 7px;
    border-radius: 50%; background: #1a6b2f;
    animation: gsc-bounce 1.2s infinite;
}
.gsc-typing span:nth-child(2){animation-delay:0.2s}
.gsc-typing span:nth-child(3){animation-delay:0.4s}
@keyframes gsc-bounce {
    0%,80%,100%{transform:scale(0.7);opacity:0.5}
    40%{transform:scale(1);opacity:1}
}

/* ── Quick Reply Buttons ── */
#gsc-quick-replies {
    padding: 0 14px 8px;
    display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0;
}
.gsc-qbtn {
    background: #e8f5e9; color: #1a6b2f;
    border: 1px solid #a5d6a7;
    border-radius: 20px; padding: 5px 12px;
    font-size: 11.5px; cursor: pointer;
    transition: background 0.2s; font-family: inherit;
}
.gsc-qbtn:hover { background: #c8e6c9; }

/* ── Input Area ── */
#gsc-input-area {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #e8f0e8; flex-shrink: 0;
}
#gsc-input {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid #c8e6c9; border-radius: 22px;
    font-size: 13px; outline: none;
    font-family: inherit; transition: border-color 0.2s;
}
#gsc-input:focus { border-color: #1a6b2f; }
#gsc-send {
    color: #fff; border: none; border-radius: 50%;
    width: 40px; height: 40px; font-size: 16px;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity 0.2s;
}
#gsc-send:hover { opacity: 0.85; }

/* ── Footer ── */
#gsc-footer {
    text-align: center; font-size: 10.5px; color: #aaa;
    padding: 6px 10px; border-top: 1px solid #f0f0f0; flex-shrink: 0;
}
#gsc-footer a { color: #1a6b2f; text-decoration: none; font-weight: 600; }

/* ── Mobile ── */
@media (max-width: 420px) {
    #gsc-chat-widget { width: calc(100vw - 20px); right: 10px; bottom: 82px; max-height: 70vh; }
    #gsc-chat-bubble { right: 16px; bottom: 16px; }
}
