/* Chatbot Widget Styles */
.chatbot-widget {
  --widget-accent: #C9A227;
  --widget-accent-hover: #B8911F;
  --widget-bg: #ffffff;
  --widget-header-bg: #1a1a1a;
  --widget-header-text: #ffffff;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Floating Toggle Button */
.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--widget-accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.5);
}

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

/* Pulse animation for attention */
.chatbot-toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--widget-accent);
  opacity: 0;
  animation: chatbot-pulse 2s ease-in-out infinite;
}

@keyframes chatbot-pulse {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.15);
  }
}

/* Icon styles */
.chatbot-icon {
  width: 28px;
  height: 28px;
  fill: white;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.chatbot-widget.open .chatbot-icon-open {
  display: none;
}

.chatbot-widget.open .chatbot-icon-close {
  display: block;
}

/* Stop pulse when open */
.chatbot-widget.open .chatbot-toggle::before {
  animation: none;
  opacity: 0;
}

/* Chat Window */
.chatbot-window {
  display: none;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  height: 560px;
  background: var(--widget-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  flex-direction: column;
  animation: chatbot-slide-up 0.3s ease;
}

@keyframes chatbot-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-widget.open .chatbot-window {
  display: flex;
}

/* Chat Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--widget-header-bg);
  color: var(--widget-header-text);
  flex-shrink: 0;
}

.chatbot-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

.chatbot-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Fullscreen button icon */
#chatbot-fullscreen svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* iframe */
.chatbot-iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
}

/* Fullscreen Mode */
.chatbot-widget.fullscreen .chatbot-window {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  bottom: 0;
  left: 0;
  animation: none;
}

.chatbot-widget.fullscreen .chatbot-toggle {
  display: none;
}

.chatbot-widget.fullscreen .chatbot-header {
  padding: 16px 20px;
}

.chatbot-widget.fullscreen .chatbot-title {
  font-size: 17px;
}

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

  .chatbot-window {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .chatbot-widget.open .chatbot-toggle {
    display: none;
  }

  .chatbot-toggle {
    width: 52px;
    height: 52px;
  }

  .chatbot-icon {
    width: 24px;
    height: 24px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .chatbot-window {
    height: 65vh;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot-window {
    height: 80vh;
    bottom: 60px;
  }
}

/* Loading state for iframe */
.chatbot-iframe-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: #f5f5f5;
  color: #666;
  font-size: 14px;
}

.chatbot-iframe-loading::after {
  content: 'Chat wird geladen...';
}
