/* ==========================================
   SmartCodeDev — AI Chat Widget Styles
   ========================================== */

/* ── Toggle Button ── */
#scd-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4f8ef7, #00d4aa);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(79,142,247,.45);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
#scd-chat-toggle:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 36px rgba(79,142,247,.55);
}
#scd-chat-toggle svg { transition: transform .3s ease; }
#scd-chat-toggle.open svg.icon-chat { display: none; }
#scd-chat-toggle.open svg.icon-close { display: block !important; }
#scd-chat-toggle svg.icon-close { display: none; }

/* Notification dot */
#scd-chat-toggle .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 12px; height: 12px;
  background: #ff5f56;
  border: 2px solid #07101f;
  border-radius: 50%;
  animation: notif-pulse 2s infinite;
}
@keyframes notif-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: .7; }
}

/* ── Chat Window ── */
#scd-chat-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  max-height: 560px;
  background: #0d1b3e;
  border: 1px solid rgba(79,142,247,.25);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
#scd-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.chat-header {
  background: linear-gradient(135deg, #0d1b3e, #091428);
  border-bottom: 1px solid rgba(79,142,247,.2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.chat-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #4f8ef7, #00d4aa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-avatar svg { display: block; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}
.status-dot {
  width: 7px; height: 7px;
  background: #00d4aa;
  border-radius: 50%;
  animation: status-blink 2s infinite;
}
@keyframes status-blink {
  0%, 100% { opacity: 1; } 50% { opacity: .4; }
}
.chat-close-btn {
  background: rgba(255,255,255,.07);
  border: none;
  border-radius: 7px;
  width: 30px; height: 30px;
  color: rgba(255,255,255,.5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  flex-shrink: 0;
}
.chat-close-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(79,142,247,.25); border-radius: 4px; }

/* Message bubbles */
.msg {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: msg-in .25s ease both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg.user { flex-direction: row-reverse; align-self: flex-end; }
.msg.bot  { align-self: flex-start; }

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-top: 2px;
}
.msg.bot .msg-avatar { background: linear-gradient(135deg, #4f8ef7, #00d4aa); }
.msg.user .msg-avatar { background: rgba(255,255,255,.1); font-size: 12px; color: rgba(255,255,255,.6); }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  max-width: 100%;
  word-break: break-word;
}
.msg.bot .msg-bubble {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(79,142,247,.15);
  color: #e0e8f8;
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, #4f8ef7, #00d4aa);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  align-self: flex-start;
}
.typing-dots { display: flex; gap: 5px; }
.typing-dots span {
  width: 7px; height: 7px;
  background: rgba(79,142,247,.5);
  border-radius: 50%;
  animation: typing-bounce .9s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 18px 12px;
}
.quick-reply-btn {
  padding: 7px 14px;
  background: rgba(79,142,247,.1);
  border: 1px solid rgba(79,142,247,.25);
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: #c0d0f0;
  cursor: pointer;
  transition: all .2s ease;
}
.quick-reply-btn:hover { background: rgba(79,142,247,.22); border-color: #4f8ef7; color: #fff; }

/* Input area */
.chat-input-area {
  border-top: 1px solid rgba(79,142,247,.15);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
  background: rgba(7,16,31,.5);
}
#scd-chat-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: #fff;
  outline: none;
  resize: none;
  max-height: 100px;
  transition: border-color .2s ease;
  line-height: 1.4;
}
#scd-chat-input::placeholder { color: rgba(255,255,255,.25); }
#scd-chat-input:focus { border-color: rgba(79,142,247,.5); }

#scd-chat-send {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #4f8ef7, #00d4aa);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s ease;
}
#scd-chat-send:hover { opacity: .85; transform: scale(1.05); }
#scd-chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Footer tagline */
.chat-footer-tag {
  text-align: center;
  padding: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,.2);
  letter-spacing: .5px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #scd-chat-window {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
  }
  #scd-chat-toggle { bottom: 20px; right: 20px; }
}
