/* Chat Widget Styles - MTX ICO Theme */

.chat-widget {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
.chat-toggle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D5A128 0%, #e6b84a 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(213, 161, 40, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(213, 161, 40, 0.5);
}

.chat-toggle svg {
  width: 39px;
  height: 39px;
  fill: #0a0a14;
}

.chat-toggle .chat-close {
  display: none;
}

.chat-widget.open .chat-toggle .chat-icon {
  display: none;
}

.chat-widget.open .chat-toggle .chat-close {
  display: block;
}

/* Unread Badge */
.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.chat-badge.show {
  display: flex;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 100px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #0a0a14;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(213, 161, 40, 0.2);
}

.chat-widget.open .chat-window {
  display: flex;
}

/* Header */
.chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(213, 161, 40, 0.15) 0%, rgba(213, 161, 40, 0.05) 100%);
  border-bottom: 1px solid rgba(213, 161, 40, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D5A128, #e6b84a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar svg {
  width: 22px;
  height: 22px;
  fill: #0a0a14;
}

.chat-header-info h4 {
  color: white;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.chat-header-info p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin: 2px 0 0;
}

.chat-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  margin-right: 6px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0a0a14;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(213, 161, 40, 0.3);
  border-radius: 3px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #D5A128 0%, #b8891f 100%);
  color: #0a0a14;
  border-bottom-right-radius: 4px;
}

.chat-message.manager {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-bottom-left-radius: 4px;
}

.chat-message-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.chat-message.manager .chat-message-time {
  text-align: left;
}

/* Welcome message */
.chat-welcome {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.chat-welcome strong {
  color: #D5A128;
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

/* Input */
.chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid rgba(213, 161, 40, 0.2);
  display: flex;
  gap: 10px;
  background: #12121f;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(213, 161, 40, 0.2);
  border-radius: 24px;
  padding: 12px 18px;
  color: white;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
  border-color: rgba(213, 161, 40, 0.5);
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D5A128 0%, #e6b84a 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-send:hover {
  transform: scale(1.05);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-send svg {
  width: 20px;
  height: 20px;
  fill: #0a0a14;
}

/* Typing indicator */
.chat-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.chat-typing.show {
  display: flex;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(213, 161, 40, 0.6);
  animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Contact Form Overlay */
.chat-contact-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 20px;
}

.chat-contact-overlay.show {
  display: flex;
}

.chat-contact-form {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 300px;
  border: 1px solid rgba(213, 161, 40, 0.2);
}

.chat-contact-form h4 {
  color: #D5A128;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  text-align: center;
}

.chat-contact-form > p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin: 0 0 16px;
  text-align: center;
}

.chat-contact-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(213, 161, 40, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.chat-contact-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-contact-form input:focus {
  border-color: rgba(213, 161, 40, 0.6);
}

.chat-contact-form button {
  width: 100%;
  background: linear-gradient(135deg, #D5A128 0%, #e6b84a 100%);
  border: none;
  border-radius: 10px;
  padding: 14px;
  color: #0a0a14;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.chat-contact-form button:hover {
  transform: scale(1.02);
}

.chat-contact-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.chat-contact-note {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  margin: 12px 0 0 !important;
}

/* Language selector in greeting */
.chat-greeting-text {
  margin-bottom: 12px;
  line-height: 1.5;
}

.chat-lang-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.chat-lang-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(213, 161, 40, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: white;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.chat-lang-select:focus {
  border-color: rgba(213, 161, 40, 0.7);
}

.chat-lang-select option {
  background: #1a1a2e;
  color: white;
}

.chat-lang-confirm {
  background: linear-gradient(135deg, #D5A128 0%, #e6b84a 100%);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  color: #0a0a14;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.chat-lang-confirm:hover {
  opacity: 0.85;
}

.chat-lang-chosen {
  font-size: 13px;
  color: rgba(213, 161, 40, 0.9);
}

/* Mobile */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 90px;
    right: -10px;
    border-radius: 12px;
  }

  .chat-toggle {
    width: 76px;
    height: 76px;
  }
}
