/* FlowChat Message - Modern Smart UI */
:root {
  --flowchat-edge: 20px;
  --flowchat-spacing: 16px;
  --flowchat-btn-size: 60px;
  --flowchat-radius: 16px;
  --flowchat-padding-x: 18px;
  --flowchat-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --flowchat-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.2);
  --flowchat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --flowchat-backdrop: blur(12px);
  --flowchat-border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Root container with smart positioning */
.flowchat-root {
  position: relative;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Stack and single button containers */
.flowchat-stack,
.flowchat-single {
  position: fixed;
  display: flex;
  backdrop-filter: var(--flowchat-backdrop);
  -webkit-backdrop-filter: var(--flowchat-backdrop);
}

.flowchat-stack { 
  flex-direction: column; 
  gap: var(--flowchat-spacing); 
}

.flowchat-single { 
  flex-direction: column; 
}

/* Smart positioning */
.flowchat-root.side-right .flowchat-stack,
.flowchat-root.side-right .flowchat-single { 
  right: var(--flowchat-edge); 
}

.flowchat-root.side-left .flowchat-stack,
.flowchat-root.side-left .flowchat-single { 
  left: var(--flowchat-edge); 
}

/* Modern button styling with glassmorphism */
.flowchat-btn {
  min-width: var(--flowchat-btn-size);
  height: var(--flowchat-btn-size);
  padding: 0 var(--flowchat-padding-x);
  border-radius: var(--flowchat-radius);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--flowchat-shadow);
  transition: var(--flowchat-transition);
  will-change: transform, box-shadow, opacity;
  position: relative;
  overflow: hidden;
  border: var(--flowchat-border);
  backdrop-filter: var(--flowchat-backdrop);
  -webkit-backdrop-filter: var(--flowchat-backdrop);
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Button content styling */
.flowchat-btn .flowchat-icon { 
  display: inline-flex; 
  margin-right: 12px; 
  transition: var(--flowchat-transition);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.flowchat-btn .flowchat-label { 
  font-weight: 600; 
  font-size: 14px; 
  white-space: nowrap;
  transition: var(--flowchat-transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Hover effects with smart animations */
.flowchat-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--flowchat-shadow-hover);
  opacity: 0.95;
}

.flowchat-btn:hover .flowchat-icon {
  transform: scale(1.1) rotate(5deg);
}

.flowchat-btn:hover .flowchat-label {
  transform: translateX(2px);
}

/* Active state */
.flowchat-btn:active { 
  transform: translateY(-2px) scale(0.98);
  transition: all 0.1s ease;
}

/* Focus state for accessibility */
.flowchat-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Smart entrance animations */
@keyframes flowchatSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes flowchatSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes flowchatBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply entrance animations */
.flowchat-root.side-right .flowchat-stack,
.flowchat-root.side-right .flowchat-single {
  animation: flowchatSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flowchat-root.side-left .flowchat-stack,
.flowchat-root.side-left .flowchat-single {
  animation: flowchatSlideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animation for stacked buttons */
.flowchat-stack .flowchat-btn:nth-child(1) {
  animation-delay: 0.1s;
}

.flowchat-stack .flowchat-btn:nth-child(2) {
  animation-delay: 0.2s;
}

/* Pulse animation for attention */
@keyframes flowchatPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.flowchat-btn.flowchat-attention {
  animation: flowchatPulse 2s infinite;
}

/* Smart responsive design */
@media (max-width: 768px) {
  :root { 
    --flowchat-edge: 16px; 
    --flowchat-btn-size: 56px; 
    --flowchat-padding-x: 16px;
    --flowchat-radius: 14px;
  }
  
  .flowchat-btn .flowchat-label { 
    display: none; 
  }
  
  .flowchat-btn .flowchat-icon {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  :root { 
    --flowchat-edge: 12px; 
    --flowchat-btn-size: 52px; 
    --flowchat-padding-x: 14px;
    --flowchat-radius: 12px;
  }
  
  .flowchat-btn {
    min-width: var(--flowchat-btn-size);
    width: var(--flowchat-btn-size);
    padding: 0;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --flowchat-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --flowchat-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.4);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .flowchat-btn {
    border: 2px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .flowchat-btn,
  .flowchat-btn .flowchat-icon,
  .flowchat-btn .flowchat-label {
    transition: none;
  }
  
  .flowchat-root.side-right .flowchat-stack,
  .flowchat-root.side-right .flowchat-single,
  .flowchat-root.side-left .flowchat-stack,
  .flowchat-root.side-left .flowchat-single {
    animation: none;
  }
  
  .flowchat-btn.flowchat-attention {
    animation: none;
  }
}

/* Print styles */
@media print {
  .flowchat-root {
    display: none !important;
  }
}


