/* EKIPE HELP – Chat flutuante */
.ekipe-chat-launcher {
  position: fixed;
  right: max(20px, calc(var(--safe-right, 0px) + 16px));
  bottom: max(24px, calc(var(--safe-bottom, 0px) + 24px));
  z-index: 220;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal, #0ecfb0), var(--teal2, #09b89c));
  color: #051010;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(14, 207, 176, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ekipe-chat-launcher.has-unread {
  animation: ekipe-chat-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.55), 0 8px 32px rgba(14, 207, 176, 0.35);
}
@keyframes ekipe-chat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.5), 0 8px 32px rgba(14, 207, 176, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0), 0 8px 32px rgba(14, 207, 176, 0.45); }
}
.ekipe-chat-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #ff4757;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border-radius: 10px;
  border: 2px solid #051010;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5);
  z-index: 2;
}
.ekipe-chat-alert {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 50%;
  transform: translateY(50%);
  white-space: nowrap;
  background: #ff4757;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(255, 71, 87, 0.4);
  animation: ekipe-chat-alert-in 0.35s ease;
  pointer-events: none;
}
.ekipe-chat-alert::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #ff4757;
}
@keyframes ekipe-chat-alert-in {
  from { opacity: 0; transform: translateY(50%) translateX(8px); }
  to { opacity: 1; transform: translateY(50%) translateX(0); }
}
.ekipe-chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(14, 207, 176, 0.45);
}
.ekipe-chat-launcher svg { width: 26px; height: 26px; }
.ekipe-chat-panel {
  position: fixed;
  right: max(20px, calc(var(--safe-right, 0px) + 16px));
  bottom: max(92px, calc(var(--safe-bottom, 0px) + 92px));
  z-index: 219;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  background: var(--card, #111820);
  border: 1px solid rgba(14, 207, 176, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.ekipe-chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.ekipe-chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(14, 207, 176, 0.15), rgba(14, 207, 176, 0.05));
  border-bottom: 1px solid var(--border, #1e2d35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ekipe-chat-header-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white, #fff);
  margin-bottom: 2px;
}
.ekipe-chat-header-info p {
  font-size: 0.75rem;
  color: var(--text2, #8fa3ac);
}
.ekipe-chat-close {
  background: transparent;
  border: none;
  color: var(--text2, #8fa3ac);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 1.4rem;
}
.ekipe-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 320px;
}
.ekipe-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.ekipe-chat-msg.visitor {
  align-self: flex-end;
  background: var(--teal, #0ecfb0);
  color: #051010;
  border-bottom-right-radius: 4px;
}
.ekipe-chat-msg.admin {
  align-self: flex-start;
  background: var(--bg3, #131b20);
  color: var(--text, #e8eef0);
  border: 1px solid var(--border, #1e2d35);
  border-bottom-left-radius: 4px;
}
.ekipe-chat-msg time {
  display: block;
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 4px;
}
.ekipe-chat-welcome {
  text-align: center;
  padding: 20px 12px;
  color: var(--text2, #8fa3ac);
  font-size: 0.85rem;
}
.ekipe-chat-form {
  padding: 12px;
  border-top: 1px solid var(--border, #1e2d35);
  background: var(--bg2, #0e1418);
}
.ekipe-chat-name {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border, #1e2d35);
  background: var(--bg3, #131b20);
  color: var(--text, #e8eef0);
  font-family: inherit;
  font-size: 0.88rem;
}
.ekipe-chat-input-row {
  display: flex;
  gap: 8px;
}
.ekipe-chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #1e2d35);
  background: var(--bg3, #131b20);
  color: var(--text, #e8eef0);
  font-family: inherit;
  font-size: 0.88rem;
  resize: none;
  min-height: 42px;
  max-height: 100px;
}
.ekipe-chat-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--teal, #0ecfb0);
  color: #051010;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ekipe-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.ekipe-chat-status {
  font-size: 0.72rem;
  color: var(--text3, #5a7480);
  text-align: center;
  padding: 6px;
}
.ekipe-chat-error {
  font-size: 0.78rem;
  color: #ff6b6b;
  text-align: center;
  padding: 8px 12px;
}
@media (max-width: 768px) {
  .ekipe-chat-launcher {
    bottom: calc(var(--mobile-bar-h, 64px) + var(--safe-bottom, 0px) + 16px);
    right: max(16px, calc(var(--safe-right, 0px) + 12px));
    width: 54px;
    height: 54px;
  }
  .ekipe-chat-panel {
    right: max(12px, var(--safe-right, 0px));
    left: max(12px, var(--safe-left, 0px));
    width: auto;
    bottom: calc(var(--mobile-bar-h, 64px) + var(--safe-bottom, 0px) + 80px);
  }
}
