/* 
  Veryotp Support Chat Widget Styles
  Premium glassmorphic look, responsive layout, micro-animations
*/

#veryna-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Action Button (FAB) */
.veryna-chat-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.veryna-chat-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.veryna-chat-fab svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  transition: transform 0.3s;
}

.veryna-chat-fab.active svg {
  transform: rotate(90deg);
}

/* Pulse animation on load */
.veryna-chat-fab::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid #2563eb;
  opacity: 0;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) 3;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  80%, 100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Active Notification Badge */
.veryna-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #ef4444;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  animation: badge-pulse 1.5s infinite;
}

@keyframes badge-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Chat Card Window */
.veryna-chat-card {
  width: 470px;
  height: 660px;
  background: rgba(255, 255, 255, 0.98);


  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  overflow: hidden;
  transform-origin: bottom right;
  animation: slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  display: none;
}

.veryna-chat-card.open {
  display: flex;
  opacity: 1;
}

@keyframes slide-in {
  from {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Header styling */
.veryna-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.veryna-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  font-size: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.veryna-chat-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
}

.veryna-chat-title-group {
  display: flex;
  flex-direction: column;
}

.veryna-chat-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  line-height: 1.3;
}

.veryna-chat-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin: 0;
}

.veryna-chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.veryna-chat-close:hover {
  opacity: 1;
}

/* Chat Messages Area */
.veryna-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

/* Custom Scrollbar for Messages */
.veryna-chat-body::-webkit-scrollbar {
  width: 5px;
}
.veryna-chat-body::-webkit-scrollbar-track {
  background: transparent;
}
.veryna-chat-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Message Bubbles */
.veryna-chat-msg {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: fade-up 0.25s ease-out forwards;
}

@keyframes fade-up {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.veryna-chat-msg.bot {
  align-self: flex-start;
  background-color: #ffffff;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.veryna-chat-msg.bot a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  word-break: break-all;
}

.veryna-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

/* Quick Action Suggestion Chips */
.veryna-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.veryna-chat-chip {
  background-color: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(37, 99, 235, 0.1);
  user-select: none;
}

.veryna-chat-chip:hover {
  background-color: #2563eb;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

/* Typing Indicator Animation */
.veryna-chat-typing {
  align-self: flex-start;
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.veryna-chat-typing span {
  width: 6px;
  height: 6px;
  background-color: #64748b;
  border-radius: 50%;
  display: inline-block;
  animation: typing-dot 1.4s infinite ease-in-out both;
}

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

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

/* Footer Input Area */
.veryna-chat-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.veryna-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

.veryna-chat-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.veryna-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.veryna-chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.veryna-chat-send:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.veryna-chat-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #veryna-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .veryna-chat-card {
    width: calc(100vw - 32px);
    height: 480px;
    max-height: 75vh;
  }
}


/* Admin Live Takeover Message Styling */
.veryna-chat-msg.admin {
  align-self: flex-start;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #f8fafc;
  border-bottom-left-radius: 4px;
  border: 1px solid #4338ca;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

.veryna-chat-msg.admin a {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: underline;
}

.veryna-admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}


/* Header Action Buttons (New Chat, History, Delete) */
.veryna-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.veryna-head-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.veryna-head-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* History overlay pane inside chat card */
.veryna-chat-history-view {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 20;
  display: none;
  flex-direction: column;
  padding: 14px 16px;
  box-sizing: border-box;
}

.veryna-chat-history-view.open {
  display: flex;
}

.veryna-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.veryna-history-head-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.veryna-history-back {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 12.5px;
  cursor: pointer;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
}

.veryna-history-back:hover {
  background: #eff6ff;
}

.veryna-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.veryna-history-item {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
  background: #f8fafc;
}

.veryna-history-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.veryna-history-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.veryna-history-del-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.veryna-history-del-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}
