/* ATG Japan Chat Widget Styles */
.atg-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Chat Bubble */
.atg-chat-bubble {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
  transition: all 0.3s ease;
  position: relative;
  box-sizing: border-box;
}

.atg-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

.atg-chat-bubble svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Notification Badge */
.atg-chat-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Chat Window - Zendesk Style */
.atg-chat-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 370px;
  max-width: 90vw;
  height: 500px;
  max-height: 80vh;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  transform: translateY(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.atg-chat-window.open {
  display: flex;
  transform: translateY(0);
}

/* Chat Header - Dark/Black */
.atg-chat-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.atg-chat-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.atg-chat-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.atg-header-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atg-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.atg-header-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Chat Messages - Clean Layout */
.atg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atg-message {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.atg-message.user {
  align-items: flex-end;
}

.atg-message.bot {
  align-items: flex-start;
}

/* Chat Bubbles - Zendesk Style */
.atg-message-content {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.atg-message.bot .atg-message-content {
  background-color: #f1f3f4;
  color: #202124;
  border-bottom-left-radius: 4px;
}

.atg-message.user .atg-message-content {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.atg-message-time {
  font-size: 11px;
  color: #5f6368;
  margin-top: 4px;
  opacity: 0.7;
}

.atg-message.user .atg-message-time {
  text-align: right;
}

/* Chat Input - Zendesk Style */
.atg-chat-input {
  background: white;
  border-top: 1px solid #e8eaed;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.atg-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background-color: #f1f3f4;
  border-radius: 24px;
  padding: 8px 16px;
  transition: background-color 0.2s ease;
}

.atg-input-wrapper:focus-within {
  background-color: #e8f0fe;
  box-shadow: 0 1px 6px rgba(26, 115, 232, 0.15);
}

.atg-input-field {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: #202124;
  padding: 4px 0;
}

.atg-input-field::placeholder {
  color: #5f6368;
}

.atg-attachment-btn {
  background: none;
  border: none;
  color: #5f6368;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atg-attachment-btn:hover {
  background-color: #f1f3f4;
  color: #1a73e8;
}

.atg-attachment-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.atg-send-btn {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.atg-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.atg-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.atg-send-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  /* Disable horizontal scroll */
  body, html {
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  .atg-chat-widget {
    bottom: 20px;
    right: 15px;
    max-width: 85vw;
  }

  .atg-chat-window {
    width: 95vw !important;
    max-width: 95vw !important;
    min-width: 280px !important;
    max-height: 80vh;
    height: auto;
    right: 2.5vw !important;
    left: auto !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    position: fixed;
    overflow: hidden;
    z-index: 10000;
  }
  
  .atg-chat-bubble {
    width: 50px;
    height: 50px;
  }
  
  .atg-chat-bubble svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  /* Disable horizontal scroll */
  body, html {
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  .atg-chat-window {
    width: 95vw !important;
    max-width: 95vw !important;
    min-width: 280px !important;
    max-height: 85vh;
    height: auto;
    right: 2.5vw !important;
    left: auto !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    position: fixed;
    overflow: hidden;
    z-index: 10000;
  }
  
  .atg-chat-bubble {
    width: 45px;
    height: 45px;
  }
  
  .atg-chat-bubble svg {
    width: 22px;
    height: 22px;
  }
}

/* Scrollbar Styling */
.atg-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.atg-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.atg-chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.atg-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Chat Bubble Button Styles */
.chat-bubble-btn {
    display: inline-block;
    background: linear-gradient(135deg, #0066cc, #0099ff);
    color: white !important;
    padding: 8px 16px;
    margin-top: 8px;
    margin-right: 8px;
    border-radius: 20px; /* Bubble shape */
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
}

.chat-bubble-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #0052a3, #007acc);
    color: white !important;
    text-decoration: none;
}

.chat-bubble-btn:active {
    transform: scale(0.98);
}
