/* AgriBot v4.2 — Liquid Glass UI — Agriculture Novel */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&display=swap');

/* ── Page Backdrop Blur Overlay ── */
#agribot-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999990;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
#agribot-backdrop.agribot-backdrop-active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Wrapper ── */
#agribot-wrapper {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 999999;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Toggle Button ── */
#agribot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255,255,255,0.22) 0%, rgba(45,155,94,0.55) 50%, rgba(26,107,60,0.75) 100%);
    border: 1px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(26,107,60,0.4), 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#agribot-toggle:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(26,107,60,0.55), inset 0 1px 0 rgba(255,255,255,0.4); }
#agribot-toggle:active { transform: scale(0.94); }

/* ── Chat Window ── */
#agribot-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 370px;
    height: 560px;
    background: linear-gradient(145deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.07) 40%, rgba(12,12,12,0.88) 100%);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 22px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.1);
    animation: agribot-rise 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999999;
}
#agribot-chat.agribot-open { display: flex; }
@keyframes agribot-rise {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
#agribot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.agribot-header-left { display: flex; align-items: center; gap: 11px; }
.agribot-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(45,155,94,0.3));
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 4px 12px rgba(0,0,0,0.2);
}
.agribot-header-info { display: flex; flex-direction: column; gap: 2px; }
.agribot-name { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.95); letter-spacing: -0.01em; }
.agribot-status { font-size: 11px; color: rgba(255,255,255,0.45); display: flex; align-items: center; gap: 5px; }
.agribot-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4ade80; display: inline-block;
    box-shadow: 0 0 6px rgba(74,222,128,0.8);
    animation: agribot-pulse 2s infinite;
}
@keyframes agribot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(74,222,128,0.8); }
    50% { opacity: 0.5; box-shadow: 0 0 2px rgba(74,222,128,0.3); }
}
#agribot-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    cursor: pointer; padding: 6px 14px;
    border-radius: 20px; display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-family: 'DM Sans', sans-serif; font-weight: 500;
    transition: all 0.2s;
}
#agribot-close:hover { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.9); }

/* ── Messages ── */
#agribot-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
#agribot-messages::-webkit-scrollbar { width: 3px; }
#agribot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.agribot-msg { max-width: 86%; padding: 11px 15px; font-size: 13.5px; line-height: 1.6; animation: agribot-msg-in 0.25s ease; }
@keyframes agribot-msg-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.agribot-msg-bot {
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: rgba(255,255,255,0.88);
    border-radius: 16px 16px 16px 4px; align-self: flex-start;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 16px rgba(0,0,0,0.15);
}
.agribot-msg-user {
    background: linear-gradient(135deg, rgba(45,155,94,0.7) 0%, rgba(26,107,60,0.85) 100%);
    border: 1px solid rgba(74,222,128,0.2);
    color: rgba(255,255,255,0.95);
    border-radius: 16px 16px 4px 16px; align-self: flex-end;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 16px rgba(26,107,60,0.3);
}

/* ── Typing ── */
.agribot-typing {
    display: flex; gap: 5px; align-items: center;
    padding: 13px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px 16px 16px 4px; align-self: flex-start; width: fit-content;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.agribot-typing span { width: 6px; height: 6px; background: rgba(74,222,128,0.8); border-radius: 50%; animation: agribot-bounce 1.2s infinite; }
.agribot-typing span:nth-child(2) { animation-delay: 0.18s; }
.agribot-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes agribot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Suggestions ── */
#agribot-suggestions { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 7px; flex-shrink: 0; }
.agribot-suggestion {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6); font-size: 11.5px;
    font-family: 'DM Sans', sans-serif; padding: 6px 12px;
    border-radius: 20px; cursor: pointer; transition: all 0.25s;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.agribot-suggestion:hover {
    background: linear-gradient(135deg, rgba(45,155,94,0.25) 0%, rgba(45,155,94,0.12) 100%);
    border-color: rgba(74,222,128,0.35); color: rgba(255,255,255,0.9); transform: translateY(-1px);
}

/* ── Input Area ── */
#agribot-input-area {
    display: flex; align-items: flex-end; gap: 9px; padding: 12px 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border-top: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
#agribot-input {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px; color: rgba(255,255,255,0.9);
    font-family: 'DM Sans', sans-serif; font-size: 13.5px;
    padding: 10px 14px; resize: none; outline: none;
    max-height: 100px; overflow-y: auto; line-height: 1.5;
    transition: all 0.25s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
#agribot-input::placeholder { color: rgba(255,255,255,0.3); }
#agribot-input:focus {
    border-color: rgba(74,222,128,0.4); background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 0 0 3px rgba(45,155,94,0.12);
}
#agribot-send {
    width: 40px; height: 40px;
    background: linear-gradient(145deg, rgba(255,255,255,0.22) 0%, rgba(45,155,94,0.6) 40%, rgba(26,107,60,0.85) 100%);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.25s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 4px 14px rgba(26,107,60,0.35);
}
#agribot-send:hover { transform: scale(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 6px 20px rgba(26,107,60,0.5); }
#agribot-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Footer ── */
#agribot-footer { text-align: center; font-size: 10.5px; color: rgba(255,255,255,0.2); padding: 7px; flex-shrink: 0; }
#agribot-footer a { color: rgba(45,155,94,0.5); text-decoration: none; transition: color 0.2s; }
#agribot-footer a:hover { color: rgba(74,222,128,0.8); }

/* ── Mobile ── */
@media (max-width: 480px) {
    #agribot-wrapper { bottom: 20px; right: 16px; }
    #agribot-chat { right: 10px; width: calc(100vw - 20px); height: 72vh; bottom: 90px; border-radius: 20px; }
}
