/* medzidvomi.sk – Live chat widget */

.mdv-chat {
  --mdv-chat-primary: #26ABA3;
  --mdv-chat-secondary: #F7AB1E;
  --mdv-chat-dark: #293039;
  --mdv-chat-panel-bg: #ffffff;
  --mdv-chat-text: #51565D;
  --mdv-chat-muted: #7a828a;
  --mdv-chat-shadow: 0 18px 50px rgba(41, 48, 57, 0.18);
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  font-family: "Roboto", Arial, sans-serif;
}

.mdv-chat--warm {
  --mdv-chat-primary: #F7AB1E;
  --mdv-chat-secondary: #ff8c42;
}

.mdv-chat--minimal {
  --mdv-chat-primary: #293039;
  --mdv-chat-secondary: #51565D;
  --mdv-chat-panel-bg: #fafbfc;
}

.mdv-chat--soft {
  --mdv-chat-primary: #5bbfb8;
  --mdv-chat-secondary: #F7AB1E;
  --mdv-chat-panel-bg: #f8fffe;
  --mdv-chat-shadow: 0 20px 60px rgba(38, 171, 163, 0.15);
}

.mdv-chat-toggle {
  position: relative;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mdv-chat-primary), var(--mdv-chat-secondary));
  color: #fff;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: var(--mdv-chat-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mdv-chat-toggle:hover {
  transform: scale(1.05);
}

.mdv-chat-toggle-icon,
.mdv-chat-toggle-close {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mdv-chat-toggle-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.mdv-chat.is-open .mdv-chat-toggle-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.mdv-chat.is-open .mdv-chat-toggle-close {
  opacity: 1;
  transform: none;
}

.mdv-chat-toggle-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--mdv-chat-primary);
  opacity: 0;
  animation: mdvChatPulse 2.4s ease-out infinite;
  pointer-events: none;
}

.mdv-chat:not(.is-open) .mdv-chat-toggle-pulse {
  opacity: 1;
}

@keyframes mdvChatPulse {
  0% { transform: scale(1); opacity: 0.65; }
  100% { transform: scale(1.35); opacity: 0; }
}

.mdv-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.85rem);
  width: min(360px, calc(100vw - 2rem));
  background: var(--mdv-chat-panel-bg);
  border-radius: 18px;
  box-shadow: var(--mdv-chat-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

.mdv-chat.is-open .mdv-chat-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mdv-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.85rem;
  background: linear-gradient(135deg, var(--mdv-chat-primary), var(--mdv-chat-secondary));
  color: #fff;
}

.mdv-chat-header-text {
  display: grid;
  gap: 0.15rem;
}

.mdv-chat-header-text strong {
  font-size: 1rem;
  line-height: 1.2;
}

.mdv-chat-header-text span {
  font-size: 0.82rem;
  opacity: 0.92;
}

.mdv-chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.mdv-chat-messages {
  max-height: 280px;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  background: var(--mdv-chat-panel-bg);
}

.mdv-chat-message {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  animation: mdvChatMessageIn 0.35s ease;
}

.mdv-chat-message--user {
  flex-direction: row-reverse;
}

.mdv-chat-message--user .mdv-chat-bubble {
  background: var(--mdv-chat-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mdv-chat-message--user .mdv-chat-avatar {
  background: rgba(38, 171, 163, 0.15);
  color: var(--mdv-chat-primary);
}

.mdv-chat-message--bot .mdv-chat-bubble {
  background: #eef7f6;
  color: var(--mdv-chat-text);
  border-bottom-left-radius: 4px;
}

.mdv-chat--minimal .mdv-chat-message--bot .mdv-chat-bubble {
  background: #eceff2;
}

.mdv-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(38, 171, 163, 0.12);
  color: var(--mdv-chat-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.mdv-chat-bubble {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: calc(100% - 42px);
}

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

.mdv-chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--mdv-chat-panel-bg);
}

.mdv-chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #d8dde2;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 42px;
  max-height: 100px;
}

.mdv-chat-form textarea:focus {
  outline: none;
  border-color: var(--mdv-chat-primary);
  box-shadow: 0 0 0 3px rgba(38, 171, 163, 0.15);
}

.mdv-chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--mdv-chat-primary);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.mdv-chat-footer {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1rem 0.85rem;
  font-size: 0.82rem;
}

.mdv-chat-footer a {
  color: var(--mdv-chat-muted);
  text-decoration: none;
}

.mdv-chat-footer a:hover {
  color: var(--mdv-chat-primary);
}

@media (max-width: 480px) {
  .mdv-chat {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .mdv-chat-panel {
    width: calc(100vw - 1.7rem);
  }
}
