/* ═══════════════════════════════════════════════════════════════════════════
   ATOCH v1.0 — Chat Widget Styles
   PyStatR+ Executive Assistant (FAQ)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Widget Container */
.atoch-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
.atoch-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B1120 0%, #1a2744 100%);
  border: 2px solid #22d3ee;
  color: #22d3ee;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(34, 211, 238, 0.3),
    0 0 40px rgba(34, 211, 238, 0.1);
  transition: all 0.3s ease;
}

.atoch-toggle:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 30px rgba(34, 211, 238, 0.4),
    0 0 60px rgba(34, 211, 238, 0.2);
}

.atoch-toggle svg {
  width: 28px;
  height: 28px;
}

.atoch-icon-close {
  display: none;
}

.atoch-widget:not(.atoch-collapsed) .atoch-icon-open {
  display: none;
}

.atoch-widget:not(.atoch-collapsed) .atoch-icon-close {
  display: block;
}

/* Chat Panel */
.atoch-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-height: 560px;
  background: #0B1120;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(34, 211, 238, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  overflow: hidden;
}

.atoch-widget:not(.atoch-collapsed) .atoch-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.atoch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #1a2744 0%, #0B1120 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
}

.atoch-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.atoch-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22d3ee;
}

.atoch-avatar svg {
  width: 24px;
  height: 24px;
}

.atoch-header-text {
  display: flex;
  flex-direction: column;
}

.atoch-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.atoch-status {
  font-size: 0.7rem;
  color: #22d3ee;
  display: flex;
  align-items: center;
  gap: 4px;
}

.atoch-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  display: inline-block;
}

.atoch-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.atoch-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.atoch-close-btn svg {
  width: 16px;
  height: 16px;
}

/* Disclaimer */
.atoch-disclaimer {
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 0.7rem;
  color: #f59e0b;
  text-align: center;
  line-height: 1.4;
}

/* Messages Container */
.atoch-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 280px;
}

.atoch-messages::-webkit-scrollbar {
  width: 4px;
}

.atoch-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.atoch-messages::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.3);
  border-radius: 2px;
}

/* Message Bubbles */
.atoch-message {
  display: flex;
  max-width: 90%;
}

.atoch-message-assistant {
  align-self: flex-start;
}

.atoch-message-user {
  align-self: flex-end;
}

.atoch-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.atoch-message-assistant .atoch-message-content {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 4px;
}

.atoch-message-user .atoch-message-content {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  color: #0B1120;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.atoch-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.atoch-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.5);
  animation: atoch-bounce 1.4s infinite ease-in-out both;
}

.atoch-typing span:nth-child(1) { animation-delay: -0.32s; }
.atoch-typing span:nth-child(2) { animation-delay: -0.16s; }
.atoch-typing span:nth-child(3) { animation-delay: 0s; }

@keyframes atoch-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Quick Actions */
.atoch-quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  flex-wrap: wrap;
}

.atoch-quick-btn {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.atoch-quick-btn:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
  color: #22d3ee;
}

/* Advanced Button - Links to Claude Project */
.atoch-advanced-btn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.atoch-advanced-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
}

/* Input Area */
.atoch-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.atoch-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

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

.atoch-input:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

.atoch-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  border: none;
  color: #0B1120;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.atoch-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(34, 211, 238, 0.4);
}

.atoch-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Contact Footer */
.atoch-contact-footer {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.atoch-contact-footer a {
  color: #22d3ee;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.atoch-contact-footer a:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .atoch-widget {
    bottom: 16px;
    right: 16px;
  }

  .atoch-panel {
    width: calc(100vw - 32px);
    max-width: 360px;
    right: 0;
    bottom: 76px;
    max-height: 70vh;
  }

  .atoch-toggle {
    width: 54px;
    height: 54px;
  }

  .atoch-title {
    font-size: 0.8rem;
  }
}

/* Ensure visibility above footer */
.footer-enhanced ~ #atoch-chat-widget,
body > #atoch-chat-widget {
  z-index: 10000;
}
