/* Customer chat window (chat.js) + the "Chat with us" card on the contact section. Uses colours from styles.css. */
.chat-root { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 1500; }
.chat-root[hidden] { display: none !important; }

.chat-fab {
  position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--accent, #6366f1), #8b5cf6); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6); }
.chat-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.chat-fab.is-ringing { animation: chat-pulse 1.2s ease-out 2; }
@keyframes chat-pulse { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, .7); } 100% { box-shadow: 0 0 0 22px rgba(99, 102, 241, 0); } }
.chat-badge {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; background: #ef4444; color: #fff;
  font-size: .75rem; font-weight: 700; border: 2px solid var(--bg-primary, #0a0a0f); font-variant-numeric: tabular-nums;
}
.chat-badge[hidden] { display: none; }

.chat-panel {
  position: absolute; bottom: 72px; inset-inline-end: 0; width: 370px; max-width: calc(100vw - 24px);
  height: 540px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card, #14151f); border: 1px solid var(--border-light, #2a2f45); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6); color: var(--text-primary, #fff);
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: linear-gradient(135deg, var(--accent, #6366f1), #8b5cf6); }
.chat-title { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; }
.chat-close { background: rgba(255, 255, 255, .18); color: #fff; border: 0; border-radius: 50%; width: 30px; height: 30px; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.chat-close:hover { background: rgba(255, 255, 255, .3); }

.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-primary, #0a0a0f); }
.chat-empty { margin: auto; text-align: center; color: var(--text-muted, #7c8099); font-size: .92rem; padding: 0 12px; }
.chat-day { align-self: center; font-size: .72rem; color: var(--text-muted, #7c8099); background: rgba(255, 255, 255, .06); padding: 3px 10px; border-radius: 10px; margin: 6px 0 2px; }
.chat-msg { max-width: 84%; padding: 8px 12px 6px; border-radius: 14px; font-size: .93rem; line-height: 1.5; }
.chat-msg.from-user { align-self: flex-end; background: var(--accent, #6366f1); color: #fff; border-end-end-radius: 4px; }
.chat-msg.from-owner { align-self: flex-start; background: rgba(255, 255, 255, .09); color: var(--text-primary, #fff); border-end-start-radius: 4px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 3px; font-size: .68rem; opacity: .75; }
.chat-tick.is-read { color: #67e8f9; opacity: 1; }

.chat-error { margin: 0; padding: 8px 14px; font-size: .82rem; color: #fecaca; background: rgba(239, 68, 68, .15); }
.chat-error[hidden] { display: none; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border, #20233a); background: var(--bg-card, #14151f); }
.chat-input {
  flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px; box-sizing: border-box; font: inherit; font-size: .93rem;
  color: #fff; background: #000; border: 1px solid var(--border-light, #2a2f45); border-radius: 12px;
}
.chat-input:focus { outline: 2px solid var(--accent, #6366f1); outline-offset: 1px; }
.chat-send { height: 40px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700; color: #fff; background: var(--accent, #6366f1); }
.chat-send:hover:not(:disabled) { filter: brightness(1.12); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 640px) {   /* phones: the window covers the screen below the navbar */
  .chat-root { inset-inline-end: 14px; bottom: 14px; }
  .chat-panel { position: fixed; top: 56px; bottom: 0; inset-inline: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 16px 16px 0 0; }
  .chat-root.is-open .chat-fab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .chat-fab.is-ringing { animation: none; } .chat-fab { transition: none; } }

/* "Chat with us" card (replaces the old contact form) */
.chat-cta { max-width: 560px; margin: 0 auto; padding: 36px 28px; text-align: center; border: 1px solid var(--border, #20233a); border-radius: var(--radius-lg, 16px); background: var(--bg-card, #14151f); }
.chat-cta-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; margin-bottom: 16px; color: #fff; background: linear-gradient(135deg, var(--accent, #6366f1), #8b5cf6); }
.chat-cta h3 { margin: 0 0 8px; font-size: 1.35rem; }
.chat-cta p { margin: 0 0 22px; color: var(--text-secondary, #b4b8cc); line-height: 1.7; }
