/* METSUR Virtual Assistant Widget Styles - Professional Style (No Emojis) */
:root {
  --mc-primary: #2f6fb0;
  --mc-primary-dark: #173f66;
  --mc-primary-light: #f1f5f9;
  --mc-accent: #0f8b8d;
  --mc-bg: #f8fafc;
  --mc-card: #ffffff;
  --mc-text: #0f172a;
  --mc-text-muted: #64748b;
  --mc-border: #e2e8f0;
  --mc-shadow: 0 16px 40px -6px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0,0,0,0.06);
  --mc-radius: 16px;
}

/* Floating Launch Button */
#metsur-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #173f66;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(23, 63, 102, 0.32);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

#metsur-chat-btn:hover {
  background: #102d4a;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 63, 102, 0.42);
}

#metsur-chat-btn .mc-icon-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#metsur-chat-btn .mc-dot-online {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border: 2px solid #173f66;
  border-radius: 50%;
}

/* Chat Container Modal */
#metsur-chat-box {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 105px);
  background: #ffffff;
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow);
  display: flex;
  flex-direction: column;
  z-index: 999999;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--mc-border);
}

#metsur-chat-box.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.mc-header {
  background: #173f66;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.mc-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  border: 1px solid rgba(255,255,255,0.2);
}

.mc-header-info h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.mc-header-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.mc-header-info span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
}

.mc-header-actions button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.mc-header-actions button:hover {
  background: rgba(255,255,255,0.25);
}

/* Chat Messages Area with Sleek Minimalist Scrollbar */
.mc-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--mc-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
.mc-messages::-webkit-scrollbar {
  width: 5px;
}
.mc-messages::-webkit-scrollbar-track {
  background: transparent;
}
.mc-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
.mc-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.mc-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  font-size: 13.5px;
  line-height: 1.5;
  animation: mc-fadeIn 0.2s ease-out;
}

@keyframes mc-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.mc-msg.user {
  align-self: flex-end;
}

.mc-bubble {
  padding: 11px 14px;
  border-radius: 12px;
  word-break: break-word;
}

.mc-msg.bot .mc-bubble {
  background: #ffffff;
  color: var(--mc-text);
  border: 1px solid var(--mc-border);
  border-top-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.mc-msg.user .mc-bubble {
  background: #173f66;
  color: #ffffff;
  border-top-right-radius: 3px;
}

.mc-bubble strong {
  color: #173f66;
  font-weight: 600;
}
.mc-msg.user .mc-bubble strong {
  color: #ffffff;
}

.mc-bubble a {
  color: var(--mc-primary);
  text-decoration: underline;
  font-weight: 600;
}
.mc-msg.user .mc-bubble a {
  color: #ffffff;
}

/* Suggestions Chips (Clean Google Gemini Minimalist Style) */
.mc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mc-chip {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.mc-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

/* Typing Indicator */
.mc-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  border-top-left-radius: 3px;
  width: fit-content;
}

.mc-dot {
  width: 5px;
  height: 5px;
  background: var(--mc-text-muted);
  border-radius: 50%;
  animation: mc-bounce 1.2s infinite ease-in-out;
}
.mc-dot:nth-child(2) { animation-delay: 0.2s; }
.mc-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 0.9; }
}

/* Input Area */
.mc-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--mc-border);
}

.mc-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--mc-border);
  border-radius: 20px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mc-form:focus-within {
  border-color: #173f66;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(23, 63, 102, 0.12);
}

.mc-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--mc-text);
  padding: 6px 0;
}

.mc-send-btn {
  background: #173f66;
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}

.mc-send-btn:hover {
  background: #102d4a;
  transform: scale(1.04);
}

.mc-branding {
  text-align: center;
  font-size: 10px;
  color: var(--mc-text-muted);
  margin-top: 5px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #metsur-chat-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
  #metsur-chat-box {
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 90px);
    max-height: 520px;
  }
}

/* Cross-platform, touch and safe-area refinements */
#metsur-chat-btn{min-height:48px;touch-action:manipulation}
#metsur-chat-btn:focus-visible,#metsur-chat-box button:focus-visible,#metsur-chat-box a:focus-visible,#metsur-chat-box input:focus-visible{outline:3px solid #5eb7ff;outline-offset:3px}
#metsur-chat-box{overscroll-behavior:contain}
.mc-messages{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.mc-chip{min-height:40px;padding-top:8px;padding-bottom:8px}
.mc-header-actions button{width:44px;height:44px}
.mc-send-btn{width:44px;height:44px;min-width:44px;touch-action:manipulation}
@media(max-width:480px){
  #metsur-chat-btn{right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));max-width:calc(100vw - 32px)}
  #metsur-chat-box{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:max(74px,calc(58px + env(safe-area-inset-bottom)));width:auto;height:calc(100vh - 105px);max-height:calc(100vh - 105px)}
  .mc-input{font-size:16px;min-width:0}
  .mc-footer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
}
@supports(height:100dvh){
  #metsur-chat-box{max-height:calc(100dvh - 105px)}
  @media(max-width:480px){#metsur-chat-box{height:min(560px,calc(100dvh - 105px));max-height:calc(100dvh - 105px)}}
}
@media(prefers-reduced-motion:reduce){
  #metsur-chat-btn,#metsur-chat-box,.mc-chip,.mc-msg,.mc-dot{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
