
.fc-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(62,132,202,0.4), 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s;
  outline: none;
}
.fc-fab .fc-fab-icon { font-size: 20px; transition: none; }
.fc-fab .fc-fab-label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.fc-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(62,132,202,0.5), 0 3px 8px rgba(0,0,0,0.15);
}
.fc-fab:active {
  transform: scale(0.95);
}
.fc-fab.open .fc-fab-icon { transform: none; }

/* Unread Badge on FAB */
.fc-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  line-height: 1;
  pointer-events: none;
}
.fc-fab-badge:empty, .fc-fab-badge[data-count="0"] { display: none; }

/* ================================================================
   Chat Window Container
   ================================================================ */
.fc-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1), transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.fc-window.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ================================================================
   Header
   ================================================================ */
.fc-header {
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 56px;
}
.fc-header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fc-header-title i { font-size: 18px; }
.fc-header-actions { display: flex; gap: 4px; align-items: center; }
.fc-header-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s;
}
.fc-header-btn:hover { background: rgba(255,255,255,0.25); }

/* Back button for conversation view */
.fc-back-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-right: 8px;
  transition: background 0.15s;
}
.fc-back-btn:hover { background: rgba(255,255,255,0.25); }

/* ================================================================
   View Management — List vs Conversation
   ================================================================ */
.fc-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.fc-view.active { display: flex; }

/* ================================================================
   Conversation List View
   ================================================================ */
.fc-search {
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f5;
  flex-shrink: 0;
}
.fc-search input {
  width: 100%;
  border: 1px solid #e0e5ec;
  border-radius: 10px;
  padding: 8px 14px 8px 36px;
  font-size: 14px;
  outline: none;
  background: #f7f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23aab2bd' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fc-search input:focus {
  border-color: #3e84ca;
  box-shadow: 0 0 0 3px rgba(62,132,202,0.12);
}

.fc-conv-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.fc-conv-list::-webkit-scrollbar { width: 5px; }
.fc-conv-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.fc-conv-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
}
.fc-conv-item:hover { background: #f0f5fb; }
.fc-conv-item.active { background: #e8f0fb; }

/* Tech Support pinned item */
.fc-conv-item.fc-conv-tech-support { background: #f0f7ff; border-bottom: 2px solid #3e84ca; }
.fc-conv-item.fc-conv-tech-support .fc-conv-avatar { background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%); color: #fff; }
.fc-conv-item.fc-conv-tech-support .fc-conv-name { color: #2c6bb2; font-weight: 700; }

.fc-conv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0e7ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #5a7da8;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.fc-conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fc-conv-avatar .fc-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border-radius: 50%;
  border: 2px solid #fff;
}

.fc-conv-info {
  flex: 1;
  min-width: 0;
}
.fc-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-conv-preview {
  font-size: 12px;
  color: #8c96a3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.fc-conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.fc-conv-time {
  font-size: 11px;
  color: #aab2bd;
}
.fc-conv-unread {
  background: #3e84ca;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.fc-conv-unread:empty { display: none; }

/* Empty state */
.fc-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #aab2bd;
  padding: 32px;
  text-align: center;
}
.fc-empty i { font-size: 48px; margin-bottom: 12px; color: #d1d5db; }
.fc-empty p { font-size: 14px; margin: 0; }

/* ================================================================
   Conversation (Messages) View
   ================================================================ */
.fc-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fc-messages::-webkit-scrollbar { width: 5px; }
.fc-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* Date divider */
.fc-date-divider {
  text-align: center;
  font-size: 11px;
  color: #aab2bd;
  margin: 8px 0;
  position: relative;
}
.fc-date-divider span {
  background: #f7f9fc;
  padding: 0 10px;
  position: relative;
  z-index: 1;
}
.fc-date-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e0e5ec;
}

/* Message bubbles */
.fc-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: fc-fadeIn 0.2s ease;
}
@keyframes fc-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fc-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.fc-msg.theirs { align-self: flex-start; }

.fc-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e7ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #5a7da8;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}
.fc-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fc-msg.mine .fc-msg-avatar { display: none; }

.fc-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}
.fc-msg.theirs .fc-msg-bubble {
  background: #fff;
  color: #2c3e50;
  border: 1px solid #edf0f5;
  border-top-left-radius: 4px;
}
.fc-msg.mine .fc-msg-bubble {
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  border-top-right-radius: 4px;
}

.fc-msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: #3e84ca;
  margin-bottom: 3px;
}
.fc-msg.mine .fc-msg-sender { display: none; }

.fc-msg-time {
  font-size: 10px;
  margin-top: 4px;
  text-align: right;
}
.fc-msg.theirs .fc-msg-time { color: #aab2bd; }
.fc-msg.mine .fc-msg-time { color: rgba(255,255,255,0.7); }

/* File attachment in messages */
.fc-msg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.fc-msg-file a {
  font-size: 12px;
  text-decoration: underline;
}
.fc-msg.mine .fc-msg-file a { color: rgba(255,255,255,0.9); }
.fc-msg.theirs .fc-msg-file a { color: #3e84ca; }

.fc-msg-img { max-width: 200px; border-radius: 8px; margin-top: 4px; cursor: pointer; }

/* Typing indicator */
.fc-typing {
  font-size: 12px;
  color: #aab2bd;
  padding: 4px 0;
  display: none;
  align-items: center;
  gap: 6px;
}
.fc-typing.visible { display: flex; }
.fc-typing-dots span {
  width: 5px;
  height: 5px;
  background: #aab2bd;
  border-radius: 50%;
  display: inline-block;
  animation: fc-dot 1.4s infinite;
}
.fc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.fc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fc-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ================================================================
   Message Input
   ================================================================ */
.fc-input-area {
  padding: 10px 14px;
  border-top: 1px solid #edf0f5;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.fc-input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: #f7f9fc;
  border: 1px solid #e0e5ec;
  border-radius: 12px;
  padding: 4px 8px;
  transition: border-color 0.15s;
}
.fc-input-wrap:focus-within {
  border-color: #3e84ca;
  box-shadow: 0 0 0 3px rgba(62,132,202,0.1);
}
.fc-input-wrap textarea {
  flex: 1;
  border: none;
  background: none;
  resize: none;
  outline: none;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 6px 4px;
  max-height: 80px;
  min-height: 20px;
  font-family: inherit;
  color: #2c3e50;
}
.fc-input-wrap textarea::placeholder { color: #b0b8c4; }

.fc-attach-btn {
  background: none;
  border: none;
  color: #aab2bd;
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.fc-attach-btn:hover { color: #3e84ca; }

.fc-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.fc-send-btn:hover { transform: scale(1.05); }
.fc-send-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ================================================================
   New Chat Modal
   ================================================================ */
.fc-new-chat {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fc-new-chat label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
}
.fc-new-chat input {
  width: 100%;
  border: 1px solid #e0e5ec;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.fc-new-chat input:focus {
  border-color: #3e84ca;
  box-shadow: 0 0 0 3px rgba(62,132,202,0.12);
}
.fc-new-chat-btn {
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.fc-new-chat-btn:hover { opacity: 0.9; }

/* ================================================================
   Responsive — Mobile
   ================================================================ */
@media (max-width: 480px) {
  .fc-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .fc-fab { bottom: 16px; left: 16px; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .fc-window {
    width: 340px;
    height: 480px;
    bottom: 80px;
    right: 16px;
  }
}

/* ================================================================
   Screen Sharing — Button in Conversation Header
   ================================================================ */
.fc-screen-share-btn {
  transition: color 0.2s, background 0.2s;
}
.fc-screen-share-btn.active {
  color: #e74c3c !important;
  animation: fc-pulse 1.5s infinite;
}
.fc-screen-share-btn.viewing {
  color: #27ae60 !important;
}
@keyframes fc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ================================================================
   Screen Sharing — Full Overlay (viewer)
   ================================================================ */
.fc-screen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  z-index: 10100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1);
}
.fc-screen-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Toolbar */
.fc-screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fc-screen-toolbar-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.fc-screen-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fc-screen-toolbar-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-screen-toolbar-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
}
.fc-screen-stop-btn {
  background: rgba(231,76,60,0.8) !important;
  border-color: rgba(231,76,60,0.6) !important;
}
.fc-screen-stop-btn:hover {
  background: rgba(231,76,60,1) !important;
}

/* Video Container */
.fc-screen-video-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 12px;
}
.fc-screen-video-wrap video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
.fc-screen-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 15px;
}
.fc-screen-placeholder i {
  font-size: 48px;
}

/* ================================================================
   Screen Sharing — Mini PiP Window (presenter preview)
   ================================================================ */
.fc-screen-mini {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 240px;
  height: 150px;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
  z-index: 10102;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  transition: box-shadow 0.2s;
}
.fc-screen-mini:hover {
  box-shadow: 0 10px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.15);
}
.fc-screen-mini video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.fc-screen-mini-expand,
.fc-screen-mini-close {
  position: absolute;
  top: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.fc-screen-mini:hover .fc-screen-mini-expand,
.fc-screen-mini:hover .fc-screen-mini-close {
  opacity: 1;
}
.fc-screen-mini-expand { right: 38px; }
.fc-screen-mini-close { right: 6px; }
.fc-screen-mini-expand:hover,
.fc-screen-mini-close:hover {
  background: rgba(0,0,0,0.85);
}

/* ================================================================
   Screen Sharing — Responsive
   ================================================================ */
@media (max-width: 480px) {
  .fc-screen-mini {
    width: 180px;
    height: 112px;
    bottom: 80px;
    right: 12px;
  }
  .fc-screen-toolbar {
    padding: 8px 12px;
  }
  .fc-screen-toolbar-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ================================================================
   Screen Share — Toast Notification
   ================================================================ */
.fc-screen-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10200;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  padding: 14px 16px;
  max-width: 380px;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s;
  pointer-events: none;
}
.fc-screen-toast.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.fc-screen-toast-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3e84ca 0%, #2c6bb2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.fc-screen-toast-body {
  flex: 1;
  min-width: 0;
}
.fc-screen-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d1d1f;
  line-height: 1.2;
}
.fc-screen-toast-text {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-screen-toast-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
}
.fc-screen-toast-btn {
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.fc-screen-toast-btn:active {
  transform: scale(0.96);
}
.fc-screen-toast-view {
  background: #3e84ca;
  color: #fff;
}
.fc-screen-toast-view:hover {
  background: #2c6bb2;
}
.fc-screen-toast-dismiss {
  background: #f0f0f0;
  color: #555;
}
.fc-screen-toast-dismiss:hover {
  background: #e4e4e4;
}
@media (max-width: 480px) {
  .fc-screen-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
