/* ── SNAPPY FADE-IN KEYFRAME ─────────────────────────────────────────────────── */
@keyframes fadeInUpHalf {
  from {
    opacity: 0;
    transform: translateY(30%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SNAPPY FADE-OUT KEYFRAME ────────────────────────────────────────────────── */
@keyframes fadeOutDownHalf {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(30%);
  }
}

/* ── BILL SELECTOR POPUP (bottom 50%) ───────────────────────────────────────── */
.fcc-popup {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 50vh;
  background: #121212;
  display: none;
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  font-family: Poppins, sans-serif;
}
.fcc-popup.open {
  display: flex;
}
.fcc-popup.closing .fcc-popup-content {
  animation: fadeOutDownHalf 0.2s ease-in forwards;
}
.fcc-popup-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: #1f1f1f;
  padding: 20px;
  box-sizing: border-box;
  color: #fff;

  /* fade-in from 30% down */
  animation: fadeInUpHalf 0.2s ease-out forwards;
}
.fcc-popup-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ── BACKDROP BEHIND BILL POPUP ─────────────────────────────────────────────── */
.fcc-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 999; /* just below .fcc-popup (1000) */
}
.fcc-backdrop.open {
  display: block;
}

/* ── CHAT PANEL (full screen) ───────────────────────────────────────────────── */
.fcc-chat-app {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: #121212;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-family: Poppins, sans-serif;

  opacity: 0;
  transform: translateY(30%);
}
.fcc-chat-app.open {
  animation: fadeInUpHalf 0.2s ease-out forwards;
}
.fcc-chat-app.closing {
  animation: fadeOutDownHalf 0.2s ease-in forwards;
}

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
.fcc-chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181818;
  padding: 15px;
  border-bottom: 1px solid #333;
}
.fcc-btn-back {
  position: absolute;
  left: 10px;
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 24px !important;
  cursor: pointer !important;
}
.fcc-chat-logo {
  height: 32px !important; margin: 0 8px;
}
.fcc-chat-title {
  font-size: 18px;
}
.fcc-btn-call {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* ── MESSAGES ───────────────────────────────────────────────────────────────── */
.fcc-messages {
  flex: 1;
  overflow-y: auto;
  background: #181818;
  padding: 10px;
  font-size: 13px;
}
.fcc-typing {
  font-size: 12px;
  color: #aaa;
  padding: 4px 10px;
  display: none;
}

/* message container */
.fcc-message {
  display: flex;
  align-items: flex-end;
  margin: 8px 0;
}
.fcc-message.user  { flex-direction: row-reverse; }
.fcc-message.admin { flex-direction: row; }

/* avatar */
.fcc-message .avatar {
  width: 32px;
  height: auto;
  border-radius: 20%;
  object-fit: cover;
  margin: 0 8px;
  background: #1f1f1f;
  padding: 6px; 
}

/* ── BUBBLE + TAIL ───────────────────────────────────────────────────────────── */
/* base pill shape */
.fcc-message .bubble-content {
  position: relative;
  background: #1f1f1f;
  color: #fff;
  padding: 10px 14px;
  max-width: 75%;
  line-height: 1.4;
  border-radius: 14px;
}
/* admin bubble: sharp bottom-left corner */
.fcc-message.admin .bubble-content {
  border-radius: 14px 14px 14px 4px;
}
/* user bubble: sharp bottom-right corner */
.fcc-message.user .bubble-content {
  border-radius: 14px 14px 4px 14px;
}
/* tiny triangular “tail” */
.fcc-message .bubble-content::before {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}
.fcc-message.admin .bubble-content::before {
  left: -10px;
  border-top-color: #1f1f1f;
  transform: rotate(90deg);
}
.fcc-message.user .bubble-content::before {
  right: -10px;
  border-top-color: #1f1f1f;
  transform: rotate(-90deg);
}

/* timestamp under each bubble */
.timestamp {
  font-size: 10px;
  color: #888;
  margin-top: 6px;
  text-align: right;
}

/* ── INPUT AREA ──────────────────────────────────────────────────────────────── */
.fcc-input-area {
  display: flex;
  padding: 15px;
  background: #181818;
  border-top: 1px solid #333;
}
#fcc-input {
  flex: 1;
  padding: 10px;
  border-radius: 20px;
  border: none;
  background: #2a2a2a;
  color: #fff;
  outline: none;
}
.fcc-btn-send {
  margin-left: 8px;
  padding: 0 11px !important;
  border: none !important;
  border-radius: 20px !important;
  background: #2563eb !important;
  color: #fff !important;
  font-size: 24px !important;
  cursor: pointer !important;
}

/* ── SPINNER ───────────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
