/* Nirmala Kisan Mitra - Floating Agro AI Chatbot Widget Styles */
:root {
  --agro-primary: #00450d;
  --agro-primary-dark: #00330a;
  --agro-primary-light: #e8f5e9;
  --agro-accent: #ffb751;
  --agro-accent-dark: #e09b30;
  --agro-bg: #fffdf5;
  --agro-card-bg: #ffffff;
  --agro-text: #1a2e22;
  --agro-text-muted: #5c7263;
  --agro-border: #e2e8f0;
  --agro-shadow: 0 20px 40px -15px rgba(0, 69, 13, 0.25), 0 0 15px rgba(0,0,0,0.06);
}

#agro-chatbot-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--agro-text);
  line-height: 1.5;
}

/* Floating Launcher Button */
.agro-launcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #00450d 0%, #006814 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(0, 69, 13, 0.4), 0 8px 10px -6px rgba(0, 69, 13, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.agro-launcher-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 20px 30px -8px rgba(0, 69, 13, 0.5);
  background: linear-gradient(135deg, #005510 0%, #007a18 100%);
}

.agro-launcher-btn:active {
  transform: translateY(0) scale(0.98);
}

.agro-launcher-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.agro-launcher-label {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.agro-launcher-sub {
  font-size: 10px;
  font-weight: 500;
  color: #ffde99;
}

.agro-pulse-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background-color: #22c55e;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  animation: agro-pulse 2s infinite;
}

@keyframes agro-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Chat Dialog Container */
.agro-chat-window {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--agro-shadow);
  border: 1px solid rgba(0, 69, 13, 0.12);
  overflow: hidden;
  animation: agro-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.agro-chat-window.open {
  display: flex;
}

@keyframes agro-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Chat Header */
.agro-chat-header {
  background: linear-gradient(135deg, #00450d 0%, #005a11 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.agro-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agro-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.agro-header-info h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agro-badge-ai {
  background: rgba(255, 183, 81, 0.25);
  color: #ffde99;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 183, 81, 0.4);
}

.agro-header-info p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.agro-status-dot {
  width: 7px;
  height: 7px;
  background-color: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

.agro-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agro-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.agro-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Language Selector Bar */
.agro-lang-bar {
  background: #f1f8f2;
  border-bottom: 1px solid var(--agro-border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}

.agro-lang-label {
  color: var(--agro-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.agro-lang-buttons {
  display: flex;
  gap: 4px;
  background: #e2efe4;
  padding: 2px;
  border-radius: 8px;
}

.agro-lang-btn {
  background: transparent;
  border: none;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--agro-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.agro-lang-btn.active {
  background: var(--agro-primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Messages Scroll Area */
.agro-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafcf8;
}

.agro-msg-bubble {
  max-width: 86%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
  animation: agro-msg-pop 0.25s ease-out forwards;
}

@keyframes agro-msg-pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.agro-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--agro-text);
  border: 1px solid rgba(0, 69, 13, 0.1);
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 8px -2px rgba(0,0,0,0.04);
}

.agro-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #00450d 0%, #006012 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 69, 13, 0.2);
}

.agro-msg-bot strong {
  color: var(--agro-primary);
  font-weight: 700;
}

.agro-msg-bot ul {
  margin: 6px 0;
  padding-left: 18px;
}

.agro-msg-bot li {
  margin-bottom: 4px;
}

.agro-msg-meta {
  font-size: 9.5px;
  margin-top: 5px;
  opacity: 0.65;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* Typing Indicator */
.agro-typing {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid rgba(0, 69, 13, 0.1);
  padding: 10px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.agro-dot {
  width: 6px;
  height: 6px;
  background: #00450d;
  border-radius: 50%;
  animation: agro-dot-blink 1.4s infinite ease-in-out both;
}

.agro-dot:nth-child(1) { animation-delay: -0.32s; }
.agro-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes agro-dot-blink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Prompt Chips Suggestions */
.agro-chips-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 16px 10px 16px;
  background: #fafcf8;
}

.agro-chip {
  background: #ffffff;
  border: 1px solid #d4e5d8;
  color: var(--agro-primary);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agro-chip:hover {
  background: var(--agro-primary-light);
  border-color: var(--agro-primary);
  transform: translateY(-1px);
}

/* Chat Input Bar */
.agro-input-container {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid var(--agro-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.agro-input-box {
  flex: 1;
  background: #f4f7f4;
  border: 1px solid #d8e2d9;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--agro-text);
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.agro-input-box:focus {
  background: #ffffff;
  border-color: var(--agro-primary);
  box-shadow: 0 0 0 3px rgba(0, 69, 13, 0.12);
}

.agro-send-btn {
  background: var(--agro-primary);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 69, 13, 0.2);
}

.agro-send-btn:hover:not(:disabled) {
  background: #005a11;
  transform: translateY(-1px);
}

.agro-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer Banner with WhatsApp */
.agro-footer-cta {
  background: #f8faf8;
  border-top: 1px solid #ebf1eb;
  padding: 8px 14px;
  font-size: 10.5px;
  color: #556b5a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agro-footer-cta a {
  color: #128c7e;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.agro-footer-cta a:hover {
  text-decoration: underline;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  #agro-chatbot-root {
    bottom: 16px;
    right: 16px;
  }
  .agro-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 80px);
    bottom: 0;
    right: 0;
    border-radius: 20px;
  }
}
