/* File: wp-content/plugins/cc-marketing-chat/assets/chat.css */

/* -------- Layout variables -------- */
:root {
  --cc-mc-gap: 20px;
  --cc-mc-teaser-bottom: 110px; /* adjust vertical placement */
}

/* Teaser — sole launcher, RIGHT-JUSTIFIED, STACKED LINES */
.cc-mc-teaser {
  position: fixed;
  right: var(--cc-mc-gap);
  bottom: var(--cc-mc-teaser-bottom);
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 12px;
  font: 14px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  text-align: right;             /* right-align both lines */
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  z-index: 99998;
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  max-width: 260px;
  white-space: normal;           /* allow stacking */
}
.cc-mc-teaser .cc-mc-teaser-top,
.cc-mc-teaser .cc-mc-teaser-bottom {
  display: block;                /* stack */
}
.cc-mc-teaser .cc-mc-teaser-top { font-weight: 700; }
.cc-mc-teaser .cc-mc-teaser-bottom { opacity: .9; }

/* Right-edge tail */
.cc-mc-teaser::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 8px solid #ffffff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  box-shadow: 0 0 0 1px #e5e7eb inset;
}

/* Hide teaser when chat is open */
body.cc-mc-open .cc-mc-teaser {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
}

/* Dim background when open */
.cc-mc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 99996;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.cc-mc-open .cc-mc-overlay { opacity: 1; pointer-events: auto; }

/* Chat container — floating */
.cc-mc-container {
  position: fixed;
  right: var(--cc-mc-gap);
  bottom: calc(var(--cc-mc-gap) + 24px);
  max-width: 420px;
  width: 92vw;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  font: 14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  box-shadow: 0 16px 48px rgba(0,0,0,.20);
  background: #fff;
  z-index: 99997;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
body.cc-mc-open .cc-mc-container {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header with close button */
.cc-mc-header { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.cc-mc-close {
  border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.cc-mc-close:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Messages + input */
.cc-mc-messages { height: 360px; overflow-y: auto; padding: 8px; background: #fafafa; border-radius: 12px; }
.cc-mc-bubble { padding: 8px 10px; margin: 6px 0; border-radius: 12px; max-width: 85%; white-space: pre-wrap; }
.cc-mc-bubble.user { background: #e0f2fe; margin-left: auto; }
.cc-mc-bubble.bot { background: #fff; border: 1px solid #eee; }
.cc-mc-bubble.typing { opacity: .7; font-style: italic; }
.cc-mc-input { display: flex; gap: 8px; margin-top: 10px; }
#cc-mc-text { flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 10px; }
#cc-mc-send { padding: 8px 12px; border: 0; border-radius: 10px; background: #111827; color: #fff; cursor: pointer; }
.cc-mc-form { margin-top: 12px; }

/* Choice buttons (Yes/No) */
.cc-mc-choices { display: flex; gap: 8px; margin: 6px 0 0 0; }
.cc-mc-choice {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.cc-mc-choice:hover { background: #f3f4f6; }
.cc-mc-choice:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Back to chat button under iframe */
.cc-mc-backwrap { display: flex; justify-content: flex-start; margin-top: 10px; }
.cc-mc-back {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.cc-mc-back:hover { background: #f3f4f6; }
.cc-mc-back:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Mobile */
@media (max-width: 640px) {
  :root { --cc-mc-teaser-bottom: 96px; }
  .cc-mc-container {
    right: 12px;
    bottom: calc(12px + 24px);
    width: calc(100vw - 24px);
    max-width: none;
  }
}



