/**
 * 🎨 GAMEE COPILOT FLOATING WIDGET STYLES
 * Theme: Enterprise Clean & Modern Gamee Red (#DC2626)
 */

/* NÚT TRÒN NỔI (FLOATING ACTION BUTTON) */
.gamee-copilot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 999990;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #FFFFFF;
}

.gamee-copilot-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.45);
}

.gamee-copilot-fab:active {
  transform: scale(0.96);
}

/* KÉO THẢ: chặn cuộn trang khi chạm kéo, tắt hiệu ứng trễ để nút bám sát con trỏ */
.gamee-copilot-fab {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.gamee-copilot-fab.dragging {
  cursor: grabbing;
  transition: none;
  transform: scale(1.06);
}

.copilot-dragging .gamee-copilot-window {
  transition: none;
}

/* VÒNG HIỆU ỨNG PULSE PHÁT SÁNG */
.gamee-copilot-fab::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(220, 38, 38, 0.5);
  animation: copilot-pulse 2.2s infinite;
  pointer-events: none;
}

@keyframes copilot-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* CHIP NHÃN GỢI Ý ĐÍNH KÈM FAB */
.gamee-copilot-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* KHUNG HỘI THOẠI POPUP */
.gamee-copilot-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 390px;
  height: 590px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #E2E8F0;
  display: none;
  flex-direction: column;
  z-index: 999995;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.gamee-copilot-window.open {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* HEADER CỦA CỬA SỔ */
.copilot-header {
  background: #0F172A;
  color: #FFFFFF;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #DC2626;
  flex-shrink: 0;
}

.copilot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copilot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.copilot-title-box {
  line-height: 1.25;
}

.copilot-main-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
  box-shadow: 0 0 6px #22C55E;
}

.copilot-sub-title {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

.copilot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #CBD5E1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.copilot-btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* KHU VỰC QUICK PILLS (GỢI Ý NHANH 1-CHẠM) */
.copilot-pills-bar {
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}

.copilot-pills-bar::-webkit-scrollbar {
  display: none;
}

.copilot-pill {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copilot-pill:hover {
  background: #FEF2F2;
  border-color: #F87171;
  color: #DC2626;
}

/* KHU VỰC CUỘN TIN NHẮN (MESSAGES SCROLLER) */
.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F8FAFC;
}

/* TIN NHẮN CỦA BOT VÀ USER */
.copilot-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  animation: copilot-fade-in 0.2s ease-out;
}

@keyframes copilot-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.copilot-msg.bot {
  align-self: flex-start;
}

.copilot-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.copilot-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.copilot-msg.bot .copilot-bubble {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #1E293B;
  border-top-left-radius: 2px;
}

.copilot-msg.user .copilot-bubble {
  background: #DC2626;
  color: #FFFFFF;
  border-top-right-radius: 2px;
}

.copilot-time {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 4px;
  text-align: right;
}

.copilot-msg.user .copilot-time {
  color: #FECACA;
}

/* KHỐI NÚT HÀNH ĐỘNG DẪN ĐƯỜNG 1-CHẠM (ACTION CARDS) */
.copilot-action-group {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.copilot-action-btn {
  background: #FEF2F2;
  border: 1.5px solid #F87171;
  color: #B91C1C;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.08);
}

.copilot-action-btn:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
}

.copilot-action-btn:active {
  transform: translateY(0);
}

/* BADGE TRẠNG THÁI TÍNH NĂNG */
.copilot-status-badge {
  display: inline-block;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #86EFAC;
  margin-bottom: 6px;
}

/* LOADING DOTS */
.copilot-loading {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}

.copilot-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #DC2626;
  animation: copilot-bounce 1.2s infinite ease-in-out;
}

.copilot-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.copilot-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes copilot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* KHU VỰC NHẬP LỆNH DƯỚI ĐÁY */
.copilot-footer {
  padding: 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.copilot-input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 6px 10px;
  transition: all 0.2s;
}

.copilot-input-box:focus-within {
  border-color: #DC2626;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.copilot-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  font-family: inherit;
  color: #0F172A;
  padding: 2px 0;
}

.copilot-textarea::placeholder {
  color: #94A3B8;
}

.copilot-btn-send {
  background: #DC2626;
  color: #FFFFFF;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copilot-btn-send:hover {
  background: #B91C1C;
  transform: scale(1.05);
}

.copilot-btn-send:disabled {
  background: #E2E8F0;
  color: #94A3B8;
  cursor: not-allowed;
  transform: none;
}

.copilot-footnote {
  font-size: 10px;
  color: #94A3B8;
  text-align: center;
  margin-top: 6px;
}

/* RESPONSIVE TRÊN ĐIỆN THOẠI */
@media (max-width: 480px) {
  .gamee-copilot-window {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    height: 75vh;
  }
  .gamee-copilot-fab {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
}
