/* ==========================================================================
   INNERMAP CHAT WIDGET STYLES
   Design System: Deep Indigo, Soft Purple & Glassmorphism with Official Logo
   ========================================================================== */

:root {
  --im-primary: #66FCF1;
  --im-primary-dark: #312E81;
  --im-accent: #A855F7;
  --im-bg-card: rgba(15, 23, 42, 0.96);
  --im-bg-chat: #0F172A;
  --im-text-light: #F8FAFC;
  --im-text-muted: #94A3B8;
  --im-border: rgba(255, 255, 255, 0.12);
  --im-danger: #EF4444;
  --im-danger-bg: rgba(239, 68, 68, 0.12);
  --im-danger-border: #FCA5A5;
  --im-radius-lg: 22px;
  --im-radius-md: 14px;
  --im-radius-sm: 8px;
  --im-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(168, 85, 247, 0.25);
}

.innermap-widget-wrapper {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.innermap-widget-trigger {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F172A 0%, #312E81 100%);
  color: #FFFFFF;
  border: 1.5px solid rgba(102, 252, 241, 0.4);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(138, 43, 226, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.innermap-widget-trigger:hover {
  transform: scale(1.08);
  border-color: rgba(102, 252, 241, 0.8);
  box-shadow: 0 14px 35px rgba(168, 85, 247, 0.6);
}

.innermap-widget-trigger .im-trigger-icon-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.innermap-widget-trigger .im-trigger-icon-close {
  font-size: 26px;
  display: none;
}

.innermap-widget-trigger.open .im-trigger-icon-logo {
  display: none;
}

.innermap-widget-trigger.open .im-trigger-icon-close {
  display: block;
}

.innermap-widget-trigger .unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #10B981;
  border: 2.5px solid #0F172A;
  border-radius: 50%;
}

.innermap-widget-box {
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--im-bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--im-border);
  border-radius: var(--im-radius-lg);
  box-shadow: var(--im-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.innermap-widget-box.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.innermap-widget-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 100%);
  border-bottom: 1px solid var(--im-border);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.innermap-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.innermap-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
}

.innermap-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.innermap-header-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  color: #F8FAFC;
  letter-spacing: 0.3px;
}

.innermap-header-subtitle {
  font-size: 12px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.innermap-header-subtitle .status-dot {
  width: 8px;
  height: 8px;
  background-color: #34D399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34D399;
  display: inline-block;
}

.innermap-header-close {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.innermap-header-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.innermap-disclaimer-banner {
  padding: 10px 16px;
  background: rgba(30, 27, 75, 0.6);
  border-bottom: 1px solid var(--im-border);
  color: #CBD5E1;
  font-size: 11.5px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.innermap-disclaimer-banner i {
  font-size: 14px;
  color: #66FCF1;
  margin-top: 1px;
  flex-shrink: 0;
}

.innermap-widget-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--im-bg-chat);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.im-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}

.im-msg-row.user {
  justify-content: flex-end;
}

.im-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.im-msg-content-wrap {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.im-msg-row.user .im-msg-content-wrap {
  max-width: 82%;
}

.im-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--im-radius-md);
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.im-msg-row.assistant .im-msg-bubble {
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.im-msg-row.user .im-msg-bubble {
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.im-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  margin-left: 38px;
}

.im-quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(102, 252, 241, 0.25);
  color: #66FCF1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.im-quick-chip:hover {
  background: rgba(102, 252, 241, 0.15);
  border-color: #66FCF1;
  transform: translateY(-1px);
}

.im-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #94A3B8;
  border-radius: 50%;
  margin-right: 3px;
  animation: typing 1.4s infinite ease-in-out both;
}

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

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

.innermap-widget-footer {
  padding: 12px 16px;
  background: #0F172A;
  border-top: 1px solid var(--im-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.innermap-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1E293B;
  color: #F8FAFC;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.innermap-input:focus {
  border-color: #66FCF1;
}

.innermap-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.innermap-send-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

.im-crisis-card {
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  border-radius: var(--im-radius-md);
  padding: 14px;
  color: #FCA5A5;
}

.im-crisis-header {
  font-weight: 700;
  font-size: 13px;
  color: #EF4444;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.im-crisis-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.im-crisis-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--im-radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
  transition: transform 0.2s ease;
}

.im-crisis-btn.cvv {
  background: #DC2626;
  color: #FFFFFF;
}

.im-crisis-btn.samu {
  background: #B91C1C;
  color: #FFFFFF;
}
