/* ============================================================
   CSS CHO CHAT WIDGET (tách từ _ChatWidget.cshtml)
   ============================================================ */

.product-banner {
  background: #f0f8ff;
  padding: 8px 10px;
  display: none;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #dee2e6;
  font-size: 13px;
  color: #333;
}

.product-banner img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #eee;
}

.product-banner .product-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-banner .close-banner {
  cursor: pointer;
  font-size: 16px;
  color: #888;
  padding: 0 2px;
}

/* Container chính */
.chat-floating-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  font-family: "Roboto", sans-serif;
}

/* Các nút tròn */
.float-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  color: white;
  font-size: 26px;
  background-color: #007bff;
  border: none;
  position: relative;
}

.float-phone {
  background-color: #e74c3c;
}
.float-zalo {
  background-color: #0068ff;
}
.chat-icon {
  background-color: #25d366;
}

.float-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Badge thông báo */
#unreadBadge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Khung chat */
.chat-box {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  height: 450px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e9ecef;
  z-index: 10000;
}

.chat-header {
  background: #2c3e50;
  color: white;
  padding: 12px 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13px;
  word-wrap: break-word;
}

.user-message {
  background: #007bff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.admin-message {
  background: #e9ecef;
  color: #212529;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #dee2e6;
  background: white;
}

.chat-input input {
  flex: 1;
  border: 1px solid #ced4da;
  border-radius: 24px;
  padding: 8px 14px;
  outline: none;
}

.chat-input button {
  background: #007bff;
  border: none;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.chat-input button:active {
  transform: scale(0.95);
  background-color: #0056b3;
}

.chat-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner nhỏ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 576px) {
  .chat-floating-container {
    bottom: 15px;
    right: 15px;
    gap: 10px;
  }
  .float-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .chat-box {
    width: 300px;
    height: 420px;
    bottom: 65px;
  }
}
