/* Goshen Vietnam Chatbot Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* iOS-inspired Design System */
  --ios-green-primary: #32D74B;
  --ios-green-secondary: #30D158;
  --ios-green-light: rgba(50, 215, 75, 0.1);
  --ios-blue-primary: #007AFF;
  --ios-blue-secondary: #5856D6;
  
  /* iOS Neutral Colors */
  --ios-gray-1: #8E8E93;
  --ios-gray-2: #AEAEB2;
  --ios-gray-3: #C7C7CC;
  --ios-gray-4: #D1D1D6;
  --ios-gray-5: #E5E5EA;
  --ios-gray-6: #F2F2F7;
  
  /* iOS System Colors */
  --ios-label-primary: #000000;
  --ios-label-secondary: #3C3C43;
  --ios-label-tertiary: #3C3C4399;
  --ios-separator: #3C3C434A;
  --ios-background: #FFFFFF;
  --ios-secondary-background: #F2F2F7;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-backdrop: blur(20px);
  
  /* Main palette - iOS inspired */
  --goshen-primary: var(--ios-green-primary);
  --goshen-primary-dark: var(--ios-green-secondary);
  --goshen-secondary: var(--ios-blue-primary);
  --goshen-accent: var(--ios-green-primary);
  --goshen-success: var(--ios-green-primary);
  --goshen-warning: #FF9500;
  --goshen-error: #FF3B30;
  --goshen-text: var(--ios-label-primary);
  --goshen-text-light: var(--ios-gray-1);
  --goshen-bg: var(--ios-background);
  --goshen-bg-light: var(--ios-secondary-background);
  --goshen-border: var(--ios-separator);
  
  /* iOS-style shadows */
  --ios-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --ios-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --ios-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --ios-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  
  /* Continuous corner radius */
  --radius-continuous-sm: 12px;
  --radius-continuous-md: 16px;
  --radius-continuous-lg: 20px;
  --radius-continuous-xl: 24px;
}

* { box-sizing: border-box; }

/* iOS-style Chatbot Toggle Button */
.goshen-chatbot-toggler {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: var(--goshen-primary);
  border: none;
  border-radius: var(--radius-continuous-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ios-shadow-lg);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
}

.goshen-chatbot-toggler:hover { 
  transform: scale(1.05);
  box-shadow: var(--ios-shadow-xl);
  background: var(--goshen-primary-dark);
}

.goshen-chatbot-toggler:active {
  transform: scale(0.95);
  transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.goshen-chatbot-toggler .icon { 
  color: white; 
  font-size: 24px; 
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  line-height: 1;
}

.goshen-chatbot-toggler.active { 
  transform: rotate(135deg);
  background: var(--ios-gray-1);
}

.goshen-chatbot-toggler .close-icon { 
  opacity: 0; 
  position: absolute;
  transform: rotate(-135deg);
}

.goshen-chatbot-toggler.active .chat-icon { 
  opacity: 0;
  transform: rotate(-135deg);
}

.goshen-chatbot-toggler.active .close-icon { 
  opacity: 1;
  transform: rotate(0deg);
}

/* iOS-style Glassmorphism Chatbot Container */
.goshen-chatbot {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 380px;
  max-height: 600px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-radius: var(--radius-continuous-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--ios-shadow-xl);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}

.goshen-chatbot.active { 
  opacity: 1; 
  transform: translateY(0) scale(1); 
  pointer-events: all; 
}

.goshen-chatbot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    rgba(255, 255, 255, 0) 100%);
  border-radius: var(--radius-continuous-xl);
  pointer-events: none;
}

/* iOS-style Glassmorphism Header */
.goshen-chatbot-header { 
  background: linear-gradient(135deg, var(--goshen-primary), var(--goshen-primary-dark));
  padding: 20px; 
  color: white; 
  position: relative; 
  overflow: hidden;
  border-radius: var(--radius-continuous-xl) var(--radius-continuous-xl) 0 0;
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
}

.goshen-chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.goshen-chatbot-header-content { 
  position: relative; 
  z-index: 1; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.goshen-chatbot-avatar { 
  width: 40px; 
  height: 40px; 
  border-radius: var(--radius-continuous-md); 
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 20px;
  box-shadow: var(--ios-shadow-sm);
}

.goshen-chatbot-info h3 { 
  font-size: 17px; 
  font-weight: 600; 
  margin: 0; 
  line-height: 1.2;
  letter-spacing: -0.4px;
}

.goshen-chatbot-info p { 
  font-size: 13px; 
  margin: 2px 0 0 0; 
  opacity: 0.8; 
  line-height: 1.2; 
  font-weight: 400;
}

.goshen-chatbot-close { 
  position: absolute; 
  top: 16px; 
  right: 16px; 
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white; 
  cursor: pointer; 
  padding: 0; 
  border-radius: var(--radius-continuous-sm); 
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goshen-chatbot-close:hover { 
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.goshen-chatbot-close:active {
  transform: scale(0.95);
}

/* iOS-style Messages Area */
.goshen-chatbot-messages { 
  height: 400px; 
  overflow-y: auto; 
  padding: 16px; 
  background: transparent;
}

.goshen-chatbot-messages::-webkit-scrollbar { width: 3px; }
.goshen-chatbot-messages::-webkit-scrollbar-track { 
  background: transparent; 
}
.goshen-chatbot-messages::-webkit-scrollbar-thumb { 
  background: var(--ios-gray-3); 
  border-radius: 3px; 
}
.goshen-chatbot-messages::-webkit-scrollbar-thumb:hover { 
  background: var(--ios-gray-2); 
}

.goshen-message { 
  display: flex; 
  margin-bottom: 12px; 
  animation: messageSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}

@keyframes messageSlideIn { 
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  } 
  to { 
    opacity: 1; 
    transform: translateY(0); 
  } 
}

.goshen-message.user { justify-content: flex-end; }
.goshen-message.bot { justify-content: flex-start; }

.goshen-message-content { 
  max-width: 75%; 
  padding: 12px 16px; 
  font-size: 15px; 
  line-height: 1.4; 
  position: relative;
  word-wrap: break-word;
  font-weight: 400;
}

/* iOS-style user messages */
.goshen-message.user .goshen-message-content { 
  background: var(--goshen-primary); 
  color: white; 
  border-radius: 18px 18px 4px 18px;
  box-shadow: var(--ios-shadow-sm);
}

/* iOS-style bot messages */
.goshen-message.bot .goshen-message-content { 
  background: var(--ios-gray-5); 
  color: var(--goshen-text); 
  border-radius: 18px 18px 18px 4px; 
  box-shadow: var(--ios-shadow-sm);
}

.goshen-message-avatar { 
  width: 28px; 
  height: 28px; 
  border-radius: 50%; 
  margin: 0 8px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 12px; 
  flex-shrink: 0;
  box-shadow: var(--ios-shadow-sm);
}

.goshen-message.bot .goshen-message-avatar { 
  background: var(--goshen-primary); 
  color: white; 
  order: -1; 
}

.goshen-message.user .goshen-message-avatar { 
  background: var(--ios-gray-2); 
  color: white; 
}

/* iOS-style Typing Indicator */
.goshen-typing { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 12px 16px; 
  background: var(--ios-gray-5); 
  border-radius: 18px 18px 18px 4px; 
  box-shadow: var(--ios-shadow-sm); 
  max-width: 75%; 
}

.goshen-typing-dots { display: flex; gap: 4px; }

.goshen-typing-dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: var(--ios-gray-2); 
  animation: typingDot 1.4s infinite ease-in-out; 
}

.goshen-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.goshen-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot { 
  0%, 60%, 100% { 
    transform: scale(0.7); 
    opacity: 0.4; 
  } 
  30% { 
    transform: scale(1); 
    opacity: 1; 
  } 
}

/* iOS-style Input Area */
.goshen-chatbot-input { 
  padding: 16px; 
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
  border-radius: 0 0 var(--radius-continuous-xl) var(--radius-continuous-xl);
}

.goshen-input-container { 
  display: flex; 
  gap: 8px; 
  align-items: flex-end; 
}

.goshen-input-wrapper { 
  flex: 1; 
  position: relative; 
}

.goshen-chatbot-textarea { 
  width: 100%; 
  min-height: 20px; 
  max-height: 100px; 
  padding: 12px 16px; 
  border: 1px solid var(--ios-separator); 
  border-radius: var(--radius-continuous-lg); 
  resize: none; 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
  font-size: 16px; 
  line-height: 1.4; 
  background: var(--ios-background); 
  color: var(--goshen-text) !important;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: var(--ios-shadow-sm);
}

.goshen-chatbot-textarea:focus { 
  outline: none; 
  border-color: var(--goshen-primary); 
  background: var(--ios-background) !important; 
  color: var(--goshen-text) !important;
  box-shadow: 0 0 0 3px rgba(50, 215, 75, 0.1), var(--ios-shadow-md); 
}

.goshen-chatbot-textarea::placeholder { 
  color: var(--ios-gray-1); 
  font-weight: 400;
}

/* CRITICAL: Fix white text issue with maximum specificity */
.goshen-chatbot .goshen-chatbot-input .goshen-chatbot-textarea,
.goshen-chatbot .goshen-chatbot-input .goshen-chatbot-textarea:focus,
.goshen-chatbot .goshen-chatbot-input .goshen-chatbot-textarea:active,
.goshen-chatbot .goshen-chatbot-input .goshen-chatbot-textarea:hover,
input.goshen-chatbot-textarea,
textarea.goshen-chatbot-textarea {
  color: #000000 !important;
  background: #ffffff !important;
  -webkit-text-fill-color: #000000 !important;
}

.goshen-send-button { 
  width: 40px; 
  height: 40px; 
  border: none; 
  border-radius: 50%; 
  background: var(--goshen-primary); 
  color: white; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
  flex-shrink: 0;
  box-shadow: var(--ios-shadow-md);
}

.goshen-send-button:hover { 
  transform: scale(1.05); 
  background: var(--goshen-primary-dark);
  box-shadow: var(--ios-shadow-lg);
}

.goshen-send-button:active {
  transform: scale(0.95);
}

.goshen-send-button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
  transform: none; 
  background: var(--ios-gray-2);
}

.goshen-send-button .icon { 
  font-size: 16px; 
  line-height: 1;
}

/* iOS-style Table */
.goshen-price-table { 
  border-collapse: collapse; 
  width: 100%; 
  margin: 12px 0; 
  font-size: 13px; 
  border-radius: var(--radius-continuous-sm); 
  overflow: hidden; 
  box-shadow: var(--ios-shadow-sm); 
}

.goshen-price-table th, .goshen-price-table td { 
  padding: 10px 14px; 
  text-align: left; 
  border-bottom: 1px solid var(--ios-separator); 
}

.goshen-price-table th { 
  background: var(--goshen-primary); 
  color: white; 
  font-weight: 600; 
}

.goshen-price-table tbody tr:hover { 
  background: var(--ios-gray-6);
  color: var(--goshen-text);
}

.goshen-price-table tbody tr:last-child td { 
  border-bottom: none; 
}

/* Links */
.goshen-message-content a { color: var(--goshen-primary); text-decoration: none; font-weight: 500; }
.goshen-message-content a:hover { text-decoration: underline; }

/* Error */
.goshen-message.error .goshen-message-content { background: var(--goshen-error); color: white; }

/* iOS-style Quick Actions */
.goshen-quick-actions { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-top: 12px; 
}

.goshen-quick-action { 
  padding: 8px 14px; 
  background: var(--ios-gray-6); 
  border: 1px solid var(--ios-separator); 
  border-radius: 16px; 
  font-size: 13px; 
  cursor: pointer; 
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
  color: var(--goshen-primary);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.goshen-quick-action:hover { 
  transform: translateY(-1px);
  background: var(--goshen-primary);
  color: white;
  border-color: var(--goshen-primary);
  box-shadow: var(--ios-shadow-md);
}

.goshen-quick-action:active {
  transform: translateY(0);
  transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.goshen-quick-action span {
  position: relative;
  z-index: 1;
}

/* Mobile First - iPhone and Android */
@media (max-width: 480px) {
  .goshen-chatbot { 
    left: 8px; 
    right: 8px; 
    bottom: 80px; 
    width: calc(100vw - 16px);
    max-height: calc(100vh - 160px); 
    min-height: 400px;
    border-radius: 16px; 
  }
  
  .goshen-chatbot-toggler { 
    bottom: 16px; 
    right: 16px; 
    width: 56px; 
    height: 56px; 
    box-shadow: var(--ios-shadow-lg);
  }
  
  .goshen-chatbot-messages { 
    height: calc(100vh - 280px); 
    max-height: calc(100vh - 280px);
    min-height: 300px;
    padding: 12px;
  }
  
  .goshen-message-content { 
    max-width: 88%; 
    font-size: 14px; 
    padding: 12px 14px;
  }
  
  .goshen-chatbot-header { 
    padding: 16px; 
  }
  
  .goshen-chatbot-input { 
    padding: 12px; 
  }
  
  .goshen-send-button {
    width: 42px;
    height: 42px;
  }
  
  .goshen-chatbot-textarea {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 18px;
  }
}

/* iPhone X/XS and similar (375px width, notched devices) */
@media (max-width: 414px) and (max-height: 896px) {
  .goshen-chatbot { 
    left: 6px; 
    right: 6px; 
    bottom: 80px; 
    width: calc(100vw - 12px);
    max-height: calc(100vh - 160px); 
    min-height: 350px;
  }
  
  .goshen-chatbot-messages { 
    height: calc(100vh - 240px); 
    max-height: calc(100vh - 240px);
    padding: 10px;
  }
  
  .goshen-chatbot-header { 
    padding: 14px; 
  }
  
  .goshen-chatbot-info h3 {
    font-size: 16px;
  }
  
  .goshen-chatbot-info p {
    font-size: 12px;
  }
  
  .goshen-chatbot-input { 
    padding: 10px; 
  }
}

@media (max-width: 320px) {
  .goshen-chatbot-header {
    padding: 16px;
  }
  
  .goshen-chatbot-info h3 {
    font-size: 16px;
  }
  
  .goshen-chatbot-info p {
    font-size: 12px;
  }
  
  .goshen-message-content {
    font-size: 12px;
    padding: 10px 14px;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root { --goshen-text: #e2e8f0; --goshen-text-light: #a0aec0; --goshen-bg: #2d3748; --goshen-bg-light: #4a5568; --goshen-border: #4a5568; }
  .goshen-message.bot .goshen-message-content { background: #4a5568; color: #e2e8f0; border-color: #718096; }
  .goshen-chatbot-textarea { background: #4a5568; color: #e2e8f0; }
  .goshen-chatbot-textarea::placeholder { color: #a0aec0; }
}


