/* Chat Widget Styles */
.chat-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Manrope', sans-serif;
}

/* Chat Toggle Button */
.chat-widget-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bybit-gold, #F0A500);
  border: none;
  color: var(--bybit-dark, #0B0B0B);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(240, 165, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.chat-widget-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(240, 165, 0, 0.5);
}

.chat-widget-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--bybit-red, #E53E3E);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid var(--bybit-dark, #0B0B0B);
}

/* Chat Window */
.chat-widget-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--bybit-card, #121212);
  border: 1px solid var(--bybit-border, #2E2E2E);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Chat Header */
.chat-widget-header {
  background: var(--bybit-dark, #0B0B0B);
  border-bottom: 1px solid var(--bybit-border, #2E2E2E);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-widget-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(240, 165, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bybit-gold, #F0A500);
}

.chat-widget-title {
  font-weight: 600;
  color: white;
  font-size: 16px;
}

.chat-widget-subtitle {
  font-size: 12px;
  color: var(--bybit-gray, #888888);
}

.chat-widget-minimize {
  background: transparent;
  border: none;
  color: var(--bybit-gray, #888888);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.chat-widget-minimize:hover {
  color: white;
}

/* Guest Form */
.chat-widget-guest-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.chat-widget-guest-form-content {
  width: 100%;
}

.chat-widget-guest-form-content h6 {
  color: white;
  font-weight: 600;
  text-align: center;
}

.chat-widget-guest-form-content .form-label {
  color: var(--bybit-gray, #888888);
  font-size: 12px;
  margin-bottom: 6px;
}

.chat-widget-guest-form-content .form-control {
  background: var(--bybit-dark, #0B0B0B);
  border: 1px solid var(--bybit-border, #2E2E2E);
  color: white;
  font-size: 14px;
}

.chat-widget-guest-form-content .form-control:focus {
  background: var(--bybit-dark, #0B0B0B);
  border-color: var(--bybit-gold, #F0A500);
  color: white;
  box-shadow: 0 0 0 0.2rem rgba(240, 165, 0, 0.25);
}

.chat-widget-guest-form-content small {
  font-size: 11px;
  color: var(--bybit-gray, #888888);
}

/* Messages Area */
.chat-widget-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-widget-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-widget-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-widget-message.user {
  align-self: flex-start;
}

.chat-widget-message.support {
  align-self: flex-end;
}

.chat-widget-message.user .chat-widget-message-time {
  justify-content: flex-start;
}

.chat-widget-message.support .chat-widget-message-time {
  justify-content: flex-end;
}

.chat-widget-message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-widget-message.user .chat-widget-message-bubble {
  background: var(--bybit-dark, #0B0B0B);
  color: white;
  border: 1px solid var(--bybit-border, #2E2E2E);
  border-bottom-left-radius: 4px;
}

.chat-widget-message.support .chat-widget-message-bubble {
  background: var(--bybit-gold, #F0A500);
  color: var(--bybit-dark, #0B0B0B);
  border-bottom-right-radius: 4px;
}

.chat-widget-message-time {
  font-size: 11px;
  color: var(--bybit-gray, #888888);
  margin-top: 4px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-widget-message.user .chat-widget-message-time {
  text-align: left;
}

.chat-widget-message.support .chat-widget-message-time {
  text-align: right;
}

/* Input Area */
.chat-widget-input {
  border-top: 1px solid var(--bybit-border, #2E2E2E);
  padding: 12px;
  background: var(--bybit-dark, #0B0B0B);
  width: 100%;
  box-sizing: border-box;
}

.chat-widget-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.chat-widget-message-input {
  flex: 1;
  min-width: 0;
  background: var(--bybit-card, #121212);
  border: 1px solid var(--bybit-border, #2E2E2E);
  border-radius: 20px;
  padding: 10px 16px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.chat-widget-message-input:focus {
  border-color: var(--bybit-gold, #F0A500);
}

.chat-widget-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bybit-gold, #F0A500);
  border: none;
  color: var(--bybit-dark, #0B0B0B);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-widget-send-btn:hover {
  background: #D49400;
  transform: scale(1.05);
}

.chat-widget-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.chat-widget-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--bybit-gray, #888888);
  font-size: 14px;
}

/* Error State */
.chat-widget-error {
  padding: 16px;
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 8px;
  color: var(--bybit-red, #E53E3E);
  font-size: 13px;
  margin: 16px;
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .chat-widget-container {
    bottom: 15px;
    right: 15px;
  }

  .chat-widget-toggle {
    width: 56px;
    height: 56px;
  }

  .chat-widget-window {
    width: calc(100vw - 30px);
    height: calc(100vh - 80px);
    bottom: 76px;
    right: 0;
    border-radius: 12px 12px 0 0;
  }
}

/* Scrollbar Styling */
.chat-widget-messages-list::-webkit-scrollbar {
  width: 6px;
}

.chat-widget-messages-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-widget-messages-list::-webkit-scrollbar-thumb {
  background: var(--bybit-border, #2E2E2E);
  border-radius: 3px;
}

.chat-widget-messages-list::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

