/* Modern Floating Buttons - WhatsApp & Termin Buchen */

/* Floating Buttons Container */
.floating-buttons {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: none;
}

/* Individual Floating Button */
.floating-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  overflow: hidden;
  text-decoration: none;
  border: none;
  outline: none;
}

/* WhatsApp Button */
.floating-btn.whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
}

.floating-btn.whatsapp:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}

/* Termin Button */
.floating-btn.termin {
  background: linear-gradient(135deg, var(--main-color) 0%, #3d2bcc 100%);
  color: white;
}

.floating-btn.termin:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(81, 55, 255, 0.4);
}

/* Button Icons */
.floating-btn svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.floating-btn:hover svg {
  transform: scale(1.1);
}

/* Pulse Animation */
.floating-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.7;
  animation: pulse 2s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Tooltip */
.floating-btn .tooltip {
  position: absolute;
  right: 75px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.floating-btn .tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.9);
}

.floating-btn:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-5px);
}

/* WhatsApp Chat Window */
.whatsapp-chat {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 360px;
 
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.85);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.whatsapp-chat.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
  min-height: 70px;
  position: relative;
  z-index: 1;
}

.chat-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.chat-info {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.chat-info h4 {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: white;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.chat-info p {
  margin: 2px 0 0 0;
  font-size: 13px;
  opacity: 0.95;
  font-weight: 400;
  color: white;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-body {
  padding: 20px;
  height: 300px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 80%, rgba(37, 211, 102, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(81, 55, 255, 0.03) 0%, transparent 50%),
    linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  position: relative;
}

.chat-body::-webkit-scrollbar {
  width: 4px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
  background: rgba(37, 211, 102, 0.3);
  border-radius: 2px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 211, 102, 0.5);
}

.chat-message {
  background: white;
  padding: 16px 18px;
  border-radius: 20px 20px 20px 8px;
  margin-bottom: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-time {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.service-list {
  margin-top: 8px;
}

.service-item {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  transition: color 0.2s ease;
}

.service-item:last-child {
  border-bottom: none;
}

.service-item:hover {
  color: var(--main-color);
}

.welcome-message {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
  border-left: 5px solid var(--main-color);
  position: relative;
  overflow: hidden;
}

.welcome-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.services-message {
  background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
  border-left: 5px solid #25d366;
}

.cta-message {
  background: linear-gradient(135deg, #fff8f0 0%, #fff2e6 100%);
  border-left: 5px solid #ff9f43;
}

/* Chat Footer */
.chat-footer {
  padding: 16px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

/* Quick Replies */
.quick-replies {
  margin-bottom: 15px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  max-height: 140px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.quick-replies::-webkit-scrollbar {
  width: 4px;
}

.quick-replies::-webkit-scrollbar-track {
  background: transparent;
}

.quick-replies::-webkit-scrollbar-thumb {
  background: rgba(37, 211, 102, 0.3);
  border-radius: 2px;
}

.quick-replies::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 211, 102, 0.5);
}

.quick-reply-title {
  font-size: 11px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-reply-btn {
  display: block;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  white-space: nowrap;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-reply-btn:last-child {
  margin-bottom: 0;
}

.quick-reply-btn:hover {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  border-color: #25d366;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.quick-reply-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
  .quick-reply-btn {
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    min-height: 48px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  .quick-reply-btn:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .quick-reply-btn:active {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    transform: scale(0.98);
  }
}

.chat-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}

.chat-input {
  flex: 1;
  padding: 12px 15px !important;
  border: 1px solid #ddd;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  border-color: #25d366;
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chat-send:hover {
  background: #128c7e;
  transform: scale(1.05);
}

.chat-send.sending {
  background: #ffa500;
  animation: sendingPulse 0.5s infinite;
}

.chat-send.typing {
  background: #17a2b8;
}

@keyframes sendingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Character Counter */
.char-counter {
  position: absolute;
  bottom: -20px;
  right: 50px;
  font-size: 11px;
  color: #666;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

.char-counter.limit-reached {
  color: #dc3545;
  font-weight: 600;
}

.chat-footer-info {
  margin-top: 10px;
  text-align: center;
}

.chat-footer-info small {
  color: #666;
  font-size: 11px;
}

/* Thank You Message */
.thank-you-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 30px;
  text-align: center;
  min-width: 280px;
}

.thank-you-message.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.thank-you-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.thank-you-text {
  font-size: 18px;
  font-weight: 600;
  color: #25d366;
  margin-bottom: 8px;
}

.thank-you-subtext {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
  .floating-buttons {
    bottom: 20px;
    right: 20px;
    gap: 12px;
  }
  
  .floating-btn {
    width: 55px;
    height: 55px;
  }
  
  .floating-btn svg {
    width: 24px;
    height: 24px;
  }
  
  .whatsapp-chat {
    width: calc(100vw - 40px);
/*     height: 400px; */
    bottom: 90px;
    right: 20px;
  }
  
  .floating-btn .tooltip {
    display: none;
  }
}

/* Smooth entrance animation */
.floating-buttons {
  animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Focus states for accessibility */
.floating-btn:focus {
  outline: 3px solid rgba(81, 55, 255, 0.5);
  outline-offset: 2px;
}

.floating-btn.whatsapp:focus {
  outline-color: rgba(37, 211, 102, 0.5);
}

.chat-input:focus,
.chat-send:focus,
.chat-close:focus {
  outline: 2px solid var(--main-color);
  outline-offset: 1px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .floating-btn {
    border: 2px solid currentColor;
  }

  .whatsapp-chat {
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .floating-btn,
  .floating-btn::before,
  .floating-btn svg,
  .floating-btn .tooltip,
  .whatsapp-chat {
    animation: none;
    transition: none;
  }

  .floating-btn:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .whatsapp-chat {
    background: #1a1a1a;
    color: #e0e0e0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  .chat-header {
    background: linear-gradient(135deg, #1f4037 0%, #99f2c8 100%);
    color: white !important;
  }

  .chat-header .chat-info h4 {
    color: white !important;
  }

  .chat-header .chat-info p {
    color: white !important;
    opacity: 0.9;
  }

  .chat-body {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  }

  .chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }

  .chat-message {
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .welcome-message {
    background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2a 100%);
    border-left-color: #6c5ce7;
  }

  .services-message {
    background: linear-gradient(135deg, #1a2a1a 0%, #0a1a0a 100%);
    border-left-color: #00b894;
  }

  .cta-message {
    background: linear-gradient(135deg, #2a1a0a 0%, #1a1a0a 100%);
    border-left-color: #fdcb6e;
  }

  .message-time {
    color: #999;
  }

  .service-item {
    border-bottom-color: #333;
  }

  .service-item:hover {
    color: #6c5ce7;
  }

  .chat-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-top-color: #333;
  }

  .quick-replies {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .quick-reply-title {
    color: #999;
  }

  .quick-reply-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  .quick-reply-btn:hover {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-color: #25d366;
  }

  .chat-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .chat-input::placeholder {
    color: #999;
  }

  .chat-input:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
  }

  .chat-send {
    background: #25d366;
  }

  .chat-footer-info small {
    color: #999;
  }

  .char-counter {
    background: rgba(26, 26, 26, 0.9);
    color: #999;
  }

  .char-counter.limit-reached {
    color: #ff6b6b;
  }

  .thank-you-message {
    background: #1a1a1a;
    color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .thank-you-text {
    color: #25d366;
  }

  .thank-you-subtext {
    color: #999;
  }
}

/* Print styles - hide floating buttons */
@media print {
  .floating-buttons,
  .whatsapp-chat {
    display: none !important;
  }
}

/* Mobile body scroll prevention */
body.chat-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
  .whatsapp-chat {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 20px;
    top: 20px;
    height: auto;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    z-index: 99999;
  }

  .chat-body {
    flex: 1;
    height: auto;
    min-height: 200px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-footer {
    flex-shrink: 0;
  }

  .quick-replies {
    max-height: 100px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quick-reply-btn {
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 14px;
    border-radius: 15px;
  }

  .floating-buttons {
    bottom: 15px;
    right: 15px;
  }

  .floating-btn {
    width: 55px;
    height: 55px;
  }

  .floating-btn svg {
    width: 24px;
    height: 24px;
  }

  .chat-header {
    padding: 18px 20px;
    min-height: 75px;
  }

  .chat-avatar {
    width: 50px;
    height: 50px;
  }

  .chat-info h4 {
    font-size: 17px;
  }

  .chat-info p {
    font-size: 14px;
  }

  .chat-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .chat-close svg {
    width: 20px;
    height: 20px;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .whatsapp-chat {
    width: 380px;
  }
}
