/* ============================================
   CHATBOT WIDGET CSS
   Professional chat interface with modern design
   ============================================ */

/* Main Chatbot Container */
.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a574 0%, #b8926f 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chatbot-toggle:hover {
  background: linear-gradient(135deg, #e0b784 0%, #c4a07d 100%);
  box-shadow: 0 6px 16px rgba(212, 165, 116, 0.4);
  transform: scale(1.05);
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-toggle.open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.8);
}

/* Chat Window Container */
.chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 400px;
  max-height: 70vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  overflow: hidden;
}

.chatbot-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header Section */
.chatbot-header {
  background: linear-gradient(135deg, #d4a574 0%, #b8926f 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.chatbot-header-icon {
  font-size: 20px;
}

.chatbot-header-actions {
  display: flex;
  gap: 8px;
}

.chatbot-info-btn,
.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.chatbot-info-btn:hover,
.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Message Bubble - User */
.chatbot-message {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chatbot-message.user {
  justify-content: flex-end;
}

.chatbot-message.assistant {
  justify-content: flex-start;
}

.chatbot-message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message.user .chatbot-message-bubble {
  background: linear-gradient(135deg, #d4a574 0%, #b8926f 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.chatbot-message.assistant .chatbot-message-bubble {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Info Message */
.chatbot-info-message {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #1565c0;
  margin: 8px 0;
}

/* Data Display Boxes */
.chatbot-data-box {
  background: white;
  border: 2px solid #d4a574;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  font-size: 13px;
}

.chatbot-data-box.reservation {
  border-left: 4px solid #27ae60;
  background: #f0fff4;
}

.chatbot-data-box.procedure {
  border-left: 4px solid #d4a574;
  background: #fff8f0;
}

.chatbot-data-box.error {
  border-left: 4px solid #e74c3c;
  background: #ffe6e6;
}

.chatbot-data-item {
  margin: 8px 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-data-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.chatbot-data-label {
  font-weight: 600;
  color: #555;
  font-size: 12px;
}

.chatbot-data-value {
  color: #333;
  margin-top: 2px;
}

/* SMS Verification Box */
.chatbot-sms-verification {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
}

.chatbot-sms-title {
  font-weight: 600;
  color: #856404;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-phone-display {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.chatbot-phone-display-label {
  color: #666;
  font-size: 12px;
}

.chatbot-phone-display-value {
  font-weight: 600;
  color: #333;
  margin-top: 4px;
  font-family: 'Courier New', monospace;
}

.chatbot-sms-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chatbot-sms-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.chatbot-sms-input::placeholder {
  letter-spacing: normal;
}

.chatbot-sms-button {
  background: #ffc107;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.chatbot-sms-button:hover {
  background: #ffb300;
}

.chatbot-sms-button:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
}

.chatbot-sms-resend {
  text-align: center;
  margin-top: 8px;
}

.chatbot-sms-resend-btn {
  background: none;
  border: none;
  color: #856404;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}

.chatbot-sms-resend-btn:hover {
  color: #c7680e;
}

/* Action Buttons */
.chatbot-button-group {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.chatbot-action-btn {
  background: linear-gradient(135deg, #d4a574 0%, #b8926f 100%);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 100px;
}

.chatbot-action-btn:hover {
  background: linear-gradient(135deg, #e0b784 0%, #c4a07d 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 165, 116, 0.3);
}

/* Input Area */
.chatbot-input-area {
  border-top: 1px solid #e0e0e0;
  padding: 12px;
  background: white;
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
}

.chatbot-input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.chatbot-send-btn {
  background: linear-gradient(135deg, #d4a574 0%, #b8926f 100%);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
  background: linear-gradient(135deg, #e0b784 0%, #c4a07d 100%);
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

.chatbot-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Info Tooltip/Modal */
.chatbot-info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  align-items: center;
  justify-content: center;
}

.chatbot-info-modal.show {
  display: flex;
}

.chatbot-info-modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.chatbot-info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.chatbot-info-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.chatbot-info-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.chatbot-info-modal-close:hover {
  color: #333;
}

.chatbot-info-modal-body {
  color: #555;
  line-height: 1.6;
}

.chatbot-info-section {
  margin-bottom: 16px;
}

.chatbot-info-section:last-child {
  margin-bottom: 0;
}

.chatbot-info-section-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chatbot-info-list-item {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
}

.chatbot-info-list-item::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #d4a574;
  font-weight: bold;
}

/* Empty State */
.chatbot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #999;
  text-align: center;
  padding: 20px;
}

.chatbot-empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.chatbot-empty-state-text {
  font-size: 14px;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 480px) {
  .chatbot-container {
    width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    bottom: 80px;
  }

  .chatbot-message-bubble {
    max-width: 90%;
  }

  .chatbot-info-modal-content {
    width: 95%;
    max-height: 80vh;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .chatbot-container {
    background: #2a2a2a;
  }

  .chatbot-messages {
    background: #1a1a1a;
  }

  .chatbot-message.assistant .chatbot-message-bubble {
    background: #333;
    color: #f0f0f0;
    border-color: #444;
  }

  .chatbot-input-area {
    background: #2a2a2a;
    border-color: #444;
  }

  .chatbot-input {
    background: #333;
    color: #f0f0f0;
    border-color: #444;
  }

  .chatbot-info-modal-content {
    background: #2a2a2a;
    color: #f0f0f0;
  }

  .chatbot-info-modal-close {
    color: #999;
  }

  .chatbot-error-report-form {
    background: #f0f0f0;
    border: 1px solid #999;
  }

  .chatbot-error-details-input,
  .chatbot-phone-input {
    background: #333;
    color: #fff;
    border-color: #555;
  }

  .chatbot-error-details-input::placeholder,
  .chatbot-phone-input::placeholder {
    color: #999;
  }
}

/* Error Report Form Styles */
.chatbot-error-report-form {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-error-details-input,
.chatbot-phone-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  box-sizing: border-box;
}

.chatbot-error-details-input:focus,
.chatbot-phone-input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 4px rgba(212, 165, 116, 0.3);
}

.chatbot-error-details-input::placeholder,
.chatbot-phone-input::placeholder {
  color: #999;
