/**
 * 0-INTEL Support Widget v2.20.0
 * Live chat with support operator via Telegram bridge.
 */

/* ── FAB (Floating Action Button) ─────────────────────────────── */
.support-fab {
  position: fixed;
  bottom: 24px;
  right: 90px; /* offset from RAG widget FAB */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 24px;
  line-height: 1;
}
.support-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.support-fab.hidden { display: none; }
.support-fab .support-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d32f2f;
  color: #fff;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.support-badge.hidden { display: none; }

/* ── Chat Panel ───────────────────────────────────────────────── */
.support-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.support-panel.hidden {
  display: none;
}

/* ── Header ───────────────────────────────────────────────────── */
.support-header {
  background: #2e7d32;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.support-header-title {
  font-size: 15px;
  font-weight: 600;
}
.support-header-status {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}
.support-header-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
}
.support-header-close:hover { opacity: 1; }

/* ── Name Input ───────────────────────────────────────────────── */
.support-name-form {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.support-name-form h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}
.support-name-form p {
  margin: 0;
  font-size: 13px;
  color: #666;
}
.support-name-form input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.support-name-form input:focus {
  border-color: #2e7d32;
}
.support-name-form button {
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.support-name-form button:hover { background: #1b5e20; }

/* ── Messages ─────────────────────────────────────────────────── */
.support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 340px;
}
.support-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}
.support-msg-visitor {
  align-self: flex-end;
  background: #e8f5e9;
  color: #1b5e20;
  border-bottom-right-radius: 4px;
}
.support-msg-operator {
  align-self: flex-start;
  background: #f5f5f5;
  color: #333;
  border-bottom-left-radius: 4px;
}
.support-msg-time {
  font-size: 10px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}
.support-msg-operator .support-msg-time { text-align: left; }

.support-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 40px 16px;
}

/* ── Input ────────────────────────────────────────────────────── */
.support-input-area {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.support-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.2s;
}
.support-input:focus { border-color: #2e7d32; }
.support-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.support-send:hover { background: #1b5e20; }
.support-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .support-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    max-height: 70vh;
  }
  .support-fab { bottom: 16px; right: 72px; }
}
