/* Chat Widget Shadow CSS - Main Widget */
:host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Chat Button Styles */
.chat-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.chat-button:active {
  transform: scale(0.95);
}

.chat-button svg {
  width: 24px;
  height: 24px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
}

/* Modal Content */
.modal-content {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 384px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 9999;
}

.modal-content.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-content.chat-mode {
  height: 500px;
}

/* Close Button */
.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.close-button:hover {
  opacity: 1;
}

.close-button svg {
  width: 16px;
  height: 16px;
}

/* Header */
.modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

/* Loading Spinner */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
  :host {
    bottom: 16px;
    right: 16px;
  }
  
  .modal-content {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    border-radius: 12px;
  }

  .modal-content.chat-mode {
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
  }

  .modal-header {
    padding: 20px;
  }
}