/* Dot — Chat Widget Styles */

#dot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle Button */
#dot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #bf8f56;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
  position: relative;
}

#dot-toggle:hover {
  transform: scale(1.05);
  background: #d4a76a;
}

#dot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #0a0a0b;
}

/* Chat Panel */
#dot-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #141416;
  border: 1px solid #2a2a2e;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: dot-slide-up 0.25s ease-out;
}

@keyframes dot-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
#dot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #2a2a2e;
  background: #1a1a1d;
}

#dot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#dot-avatar {
  font-size: 24px;
  color: #bf8f56;
  line-height: 1;
}

#dot-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #f5f5f7;
}

#dot-status {
  display: block;
  font-size: 11px;
  color: #6e6e73;
}

#dot-minimize {
  background: none;
  border: none;
  color: #6e6e73;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

#dot-minimize:hover {
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.05);
}

/* Messages */
#dot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dot-msg {
  display: flex;
  max-width: 85%;
}

.dot-msg-bot {
  align-self: flex-start;
}

.dot-msg-user {
  align-self: flex-end;
}

.dot-msg-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.dot-msg-bot .dot-msg-content {
  background: #1e1e21;
  color: #e4e4e7;
  border-bottom-left-radius: 4px;
}

.dot-msg-user .dot-msg-content {
  background: #bf8f56;
  color: #0a0a0b;
  border-bottom-right-radius: 4px;
}

.dot-msg-content a.dot-link {
  color: #d4a76a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dot-msg-bot .dot-msg-content strong {
  color: #f5f5f7;
}

/* Typing indicator */
.dot-dots span {
  animation: dot-bounce 1.4s infinite;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: #6e6e73;
}

.dot-dots span:nth-child(2) { animation-delay: 0.2s; }
.dot-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Input */
#dot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #2a2a2e;
  background: #1a1a1d;
}

#dot-input {
  flex: 1;
  background: #252528;
  border: 1px solid #2a2a2e;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f5f5f7;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#dot-input::placeholder {
  color: #6e6e73;
}

#dot-input:focus {
  border-color: #bf8f56;
}

#dot-send {
  background: #bf8f56;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0a0a0b;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

#dot-send:disabled {
  opacity: 0.4;
  cursor: default;
}

#dot-send:not(:disabled):hover {
  background: #d4a76a;
}

/* Scrollbar */
#dot-messages::-webkit-scrollbar {
  width: 4px;
}

#dot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#dot-messages::-webkit-scrollbar-thumb {
  background: #2a2a2e;
  border-radius: 4px;
}

/* Light mode */
[data-theme="light"] #dot-panel {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #dot-header {
  background: #f8f8f8;
  border-bottom-color: #e0e0e0;
}

[data-theme="light"] #dot-name {
  color: #1a1a1d;
}

[data-theme="light"] #dot-messages {
  background: #ffffff;
}

[data-theme="light"] .dot-msg-bot .dot-msg-content {
  background: #f0f0f2;
  color: #333;
}

[data-theme="light"] .dot-msg-bot .dot-msg-content strong {
  color: #1a1a1d;
}

[data-theme="light"] .dot-msg-content a.dot-link {
  color: #9a7040;
}

[data-theme="light"] #dot-input-area {
  background: #f8f8f8;
  border-top-color: #e0e0e0;
}

[data-theme="light"] #dot-input {
  background: #fff;
  border-color: #d0d0d0;
  color: #1a1a1d;
}

[data-theme="light"] #dot-input::placeholder {
  color: #999;
}

[data-theme="light"] #dot-badge {
  border-color: #fff;
}

/* Mobile */
@media (max-width: 480px) {
  #dot-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 68px;
    right: -8px;
    border-radius: 12px;
  }
  
  #dot-widget {
    bottom: 16px;
    right: 16px;
  }
  
  #dot-toggle {
    width: 48px;
    height: 48px;
  }
}
