/* ==========================================================================
   NOHADAYA AI STUDIO ASSISTANT – CHATBOT WIDGET STYLES
   Designed for zero collision with .mobile-sticky-bar (bottom: 84px on <=768px)
   ========================================================================== */

/* ── Floating Launcher Button ── */
.nh-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
  border: 2.5px solid #D4A017;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.45);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}
.nh-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(27, 67, 50, 0.6);
  border-color: #F4E8C1;
}
.nh-chat-launcher svg {
  width: 26px;
  height: 26px;
  stroke: #FFFFFF;
  transition: transform 0.25s ease;
}
.nh-chat-launcher .nh-icon-close {
  display: none;
}
.nh-chat-launcher.active .nh-icon-chat {
  display: none;
}
.nh-chat-launcher.active .nh-icon-close {
  display: block;
}

.nh-launcher-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #E2B04A;
  color: #1B4332;
  font-size: 0.65rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: nhPulse 2s infinite;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
@keyframes nhPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ── Chat Container Window ── */
.nh-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 375px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(212, 160, 23, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.nh-chat-window.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── Chat Header ── */
.nh-chat-header {
  background: linear-gradient(135deg, #1B4332 0%, #142D21 100%);
  color: #FFFFFF;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #D4A017;
  flex-shrink: 0;
}
.nh-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nh-chat-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2D6A4F;
  border: 1.5px solid #D4A017;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F4E8C1;
}
.nh-chat-avatar svg {
  width: 22px;
  height: 22px;
}
.nh-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid #1B4332;
}
.nh-chat-title {
  margin: 0;
  font-size: 0.95rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #F4E8C1;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.nh-chat-status {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #A3CFBB;
}
.nh-header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nh-ctrl-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.nh-ctrl-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}
.nh-ctrl-btn svg {
  width: 17px;
  height: 17px;
}

/* ── Chat Messages Body ── */
.nh-chat-body {
  flex: 1;
  overflow-y: auto;
  background: #FBF9F5;
  display: flex;
  flex-direction: column;
  padding: 14px;
  scroll-behavior: smooth;
}
.nh-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Message Bubbles ── */
.nh-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  animation: nhMsgFade 0.25s ease-out;
}
@keyframes nhMsgFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.nh-msg-bot {
  background: #FFFFFF;
  color: #2D3748;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.nh-msg-bot strong {
  color: #1B4332;
  font-weight: 700;
}
.nh-msg-user {
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
  color: #FFFFFF;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.22);
}
.nh-msg-time {
  font-size: 0.65rem;
  margin-top: 5px;
  opacity: 0.6;
  text-align: right;
}
.nh-msg-user .nh-msg-time {
  color: #E2E8F0;
}

/* ── Message Action Buttons ── */
.nh-msg-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.nh-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(212, 160, 23, 0.4);
  background: linear-gradient(135deg, #FAF4E6 0%, #F5E8C9 100%);
  color: #1B4332;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.nh-action-btn:hover {
  background: linear-gradient(135deg, #D4A017 0%, #C99426 100%);
  color: #1B4332;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 160, 23, 0.3);
}

/* ── Chips Container ── */
.nh-chips-container {
  padding: 8px 12px;
  background: #F4EFE6;
  border-top: 1px solid #E5DECE;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 80px;
  overflow-y: auto;
  flex-shrink: 0;
}
.nh-chip {
  background: #FFFFFF;
  color: #1B4332;
  border: 1px solid rgba(212, 160, 23, 0.4);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.nh-chip:hover {
  background: #1B4332;
  color: #F4E8C1;
  border-color: #1B4332;
  transform: translateY(-1px);
}

/* ── Typing Indicator ── */
.nh-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: #FFFFFF;
  width: fit-content;
}
.nh-typing-dots {
  display: flex;
  gap: 4px;
}
.nh-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A3CFBB;
  animation: nhBounce 1.4s infinite ease-in-out both;
}
.nh-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.nh-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes nhBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); background: #1B4332; }
}

/* ── Chat Input Area ── */
.nh-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.nh-chat-input {
  flex: 1;
  border: 1px solid #CBD5E0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nh-chat-input:focus {
  border-color: #1B4332;
  box-shadow: 0 0 0 2px rgba(27, 67, 50, 0.15);
}
.nh-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1B4332;
  color: #D4A017;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}
.nh-chat-send:hover {
  background: #2D6A4F;
  transform: scale(1.05);
}
.nh-chat-send svg {
  width: 17px;
  height: 17px;
}

/* ── Chat Footer Note ── */
.nh-chat-footer-note {
  font-size: 0.65rem;
  text-align: center;
  color: #718096;
  padding: 4px 8px;
  background: #FBF9F5;
  border-top: 1px solid #EDF2F7;
  flex-shrink: 0;
}

/* ── Mobile Layout & Clearance for Sticky Bar ── */
@media (max-width: 768px) {
  .nh-chat-launcher {
    bottom: 84px !important; /* Clears .mobile-sticky-bar which is 74px */
    right: 16px !important;
    width: 52px;
    height: 52px;
  }
  .nh-chat-window {
    bottom: 146px !important; /* Directly above launcher */
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    height: 480px;
    max-height: calc(100vh - 170px);
  }
}