/* ============================================================
   HIDR4 — AI CONVERSATIONAL AGENT & UNIFIED SPEED-DIAL FAB
   Glassmorphic, Cyber-Cyan & Violet Theme (100% Mobile Responsive)
   ============================================================ */

/* Hide legacy standalone whatsapp float */
.whatsapp-float {
  display: none !important;
}

:root {
  --ai-primary: #06b6d4;
  --ai-primary-glow: rgba(6, 182, 212, 0.45);
  --ai-secondary: #7c3aed;
  --ai-bg: #0d0d1a;
  --ai-surface: rgba(22, 22, 38, 0.96);
  --ai-surface-light: rgba(30, 30, 52, 0.95);
  --ai-border: rgba(6, 182, 212, 0.25);
  --ai-text: #f8fafc;
  --ai-text-muted: #94a3b8;
}

/* ─── UNIFIED SPEED-DIAL CONTAINER ─── */
.hidr4-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  user-select: none;
}

/* ─── Main '+' Toggle Button ─── */
.hidr4-fab-main {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #06b6d4;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 6px 24px var(--ai-primary-glow), 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s, box-shadow 0.3s;
  position: relative;
}

.hidr4-fab-main:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.6);
}

.hidr4-fab-main i {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hidr4-fab-container.active .hidr4-fab-main {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.45);
}

.hidr4-fab-container.active .hidr4-fab-main i {
  transform: rotate(135deg);
}

/* ─── Speed Dial Action Items ─── */
.hidr4-fab-items {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hidr4-fab-container.active .hidr4-fab-items {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.hidr4-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.hidr4-fab-item:hover {
  transform: translateX(-3px);
}

.hidr4-fab-label {
  background: rgba(13, 13, 26, 0.95);
  border: 1px solid var(--ai-border);
  color: #ffffff;
  font-family: var(--font-head, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hidr4-fab-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s;
}

.hidr4-fab-btn.btn-ai {
  background: #06b6d4;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.45);
}

.hidr4-fab-btn.btn-wa {
  background: #22d3ee;
  color: #000000;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.45);
}

/* ─── Chat Window ─── */
.hidr4-ai-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(6, 182, 212, 0.2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidr4-ai-window.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ─── Header ─── */
.hidr4-ai-header {
  padding: 16px 20px;
  background: #121224;
  border-bottom: 1px solid var(--ai-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.hidr4-ai-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #06b6d4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  position: relative;
}

.hidr4-ai-header-info h4 {
  margin: 0;
  font-family: var(--font-head, 'Inter', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.hidr4-ai-header-info span {
  font-size: 0.72rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

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

/* ─── Header Language Switcher ─── */
.hidr4-ai-lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 4px;
  border-radius: 12px;
}

.hidr4-ai-lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: 1;
}

.hidr4-ai-lang-btn:hover {
  color: #ffffff;
}

.hidr4-ai-lang-btn.active {
  background: #06b6d4;
  color: #000000;
}

.hidr4-ai-btn-action {
  background: transparent;
  border: none;
  color: var(--ai-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.hidr4-ai-btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ─── Body / Message Stream ─── */
.hidr4-ai-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.hidr4-ai-body::-webkit-scrollbar {
  width: 6px;
}

.hidr4-ai-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.hidr4-ai-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  font-size: 0.92rem;
  line-height: 1.6;
  animation: aiFadeIn 0.3s ease-out;
}

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

.hidr4-ai-msg.bot {
  align-self: flex-start;
}

.hidr4-ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.hidr4-ai-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  word-break: break-word;
}

.hidr4-ai-msg.bot .hidr4-ai-bubble {
  background: #181828;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.hidr4-ai-msg.user .hidr4-ai-bubble {
  background: #06b6d4;
  color: #000000 !important;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.hidr4-ai-msg.bot .hidr4-ai-bubble p {
  margin: 0 0 10px 0;
  color: #ffffff !important;
}

.hidr4-ai-msg.bot .hidr4-ai-bubble p:last-child {
  margin-bottom: 0;
}

.hidr4-ai-msg.bot .hidr4-ai-bubble strong {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.hidr4-ai-msg.bot .hidr4-ai-bubble a {
  color: #22d3ee !important;
  font-weight: 600;
  text-decoration: underline;
}

/* ─── Quick Chips ─── */
.hidr4-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hidr4-ai-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hidr4-ai-chip:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* ─── Typing Indicator ─── */
.hidr4-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--ai-surface-light);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hidr4-ai-typing span {
  width: 6px;
  height: 6px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: aiTyping 1.4s infinite ease-in-out both;
}

.hidr4-ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.hidr4-ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiTyping {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Footer Input Area ─── */
.hidr4-ai-footer {
  padding: 12px 14px;
  background: rgba(13, 13, 26, 0.98);
  border-top: 1px solid var(--ai-border);
}

.hidr4-ai-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ai-surface-light);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 4px 6px 4px 16px;
  transition: all 0.2s;
}

.hidr4-ai-form:focus-within {
  border-color: var(--ai-primary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.hidr4-ai-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff !important;
  font-size: 0.95rem;
  font-family: inherit;
}

.hidr4-ai-input::placeholder {
  color: #94a3b8;
}

.hidr4-ai-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ai-primary);
  border: none;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.hidr4-ai-send:hover {
  background: #22d3ee;
  transform: scale(1.05);
}

/* ─── Inline Lead Capture Form ─── */
.hidr4-ai-lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(13, 13, 26, 0.95);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hidr4-ai-lead-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hidr4-ai-lead-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
}

.hidr4-ai-lead-field input {
  background: rgba(30, 30, 52, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff !important;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.hidr4-ai-lead-field input::placeholder {
  color: #94a3b8;
}

.hidr4-ai-lead-field input:focus {
  border-color: var(--ai-primary);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.hidr4-ai-lead-submit {
  background: #06b6d4;
  border: none;
  border-radius: 8px;
  color: #000000;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hidr4-ai-lead-submit:hover {
  background: #22d3ee;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

/* ─── Mobile Specific ─── */
@media (max-width: 576px) {
  .hidr4-fab-container {
    bottom: 18px;
    right: 18px;
  }
  .hidr4-fab-main {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }
  .hidr4-fab-btn {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }
  .hidr4-fab-label {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  .hidr4-ai-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}
