
/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Optimize animations for better performance */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hardware acceleration for smooth animations */
.will-change-transform {
    will-change: transform;
    transform: translateZ(0);
}

.will-change-scroll {
    will-change: scroll-position;
}

/* Optimize chat message animations */
.message {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.message.entering {
    animation: messageSlideIn 0.3s ease-out;
}

.message.leaving {
    animation: messageSlideOut 0.2s ease-in;
}

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

@keyframes messageSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) translateZ(0);
    }
}

/* Optimize typing indicator */
.typing-indicator {
    transform: translateZ(0);
}

.typing-dot {
    animation: typingPulse 1.4s infinite ease-in-out;
    transform: translateZ(0);
}

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

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

/* Optimize rendering */
.will-change-transform {
    will-change: transform;
}

.will-change-scroll {
    will-change: scroll-position;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Optimize fonts */
@font-face {
    font-display: swap;
}
/* Mobile Performance and Responsive Design Improvements */

/* Mobile-first hero section optimizations */
@media (max-width: 768px) {
  .bnb-hero {
    padding: var(--bnb-space-lg) 0;
    min-height: auto;
    border-bottom: var(--bnb-border-thin);
    margin-bottom: var(--bnb-space-lg);
  }

  .bnb-hero-content {
    max-width: 100%;
    padding: 0 var(--bnb-space-sm);
  }

  .bnb-hero-logo {
    margin-bottom: var(--bnb-space-md);
  }

  .bnb-hero-logo img {
    width: 80px;
    height: 80px;
    padding: 6px;
  }

  .bnb-hero-title {
    font-size: clamp(2rem, 6vw, 2.8rem);
    margin-bottom: var(--bnb-space-md);
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    text-overflow: unset;
  }

  .bnb-hero-title span {
    padding: 0 8px;
    white-space: normal;
    display: inline-block;
  }

  .bnb-hero-title span::before {
    height: 16px;
    transform: skewX(-10deg);
  }

  .bnb-hero-subtitle {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    margin-bottom: var(--bnb-space-lg);
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-overflow: unset;
  }

  .bnb-hero-cta {
    flex-direction: column;
    align-items: center;
    gap: var(--bnb-space-md);
    margin-top: var(--bnb-space-lg);
  }

  .bnb-hero-cta .bnb-btn {
    width: 100%;
    max-width: 320px;
    padding: var(--bnb-space-md) var(--bnb-space-lg);
    font-size: 1rem;
    font-weight: 600;
  }

  /* Section improvements for mobile */
  .bnb-section {
    padding: var(--bnb-space-lg) 0;
    margin-bottom: var(--bnb-space-lg);
  }

  .bnb-section-header {
    margin-bottom: var(--bnb-space-lg);
    padding: 0 var(--bnb-space-sm);
  }

  .bnb-section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: var(--bnb-space-sm);
  }

  .bnb-section-subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    max-width: 100%;
  }

  /* Grid improvements for mobile */
  .bnb-grid {
    gap: var(--bnb-space-md);
    padding: 0 var(--bnb-space-sm);
  }

  /* Card improvements for mobile */
  .bnb-card {
    padding: var(--bnb-space-md);
  }

  /* Pricing card improvements for mobile */
  .bnb-pricing-card {
    padding: var(--bnb-space-lg);
  }

  /* CTA improvements for mobile */
  .bnb-cta {
    padding: var(--bnb-space-lg);
    margin: var(--bnb-space-lg) 0;
  }

  .bnb-cta-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: var(--bnb-space-md);
  }

  .bnb-cta-message {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: var(--bnb-space-lg);
  }

  .bnb-cta-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--bnb-space-md);
  }

  .bnb-cta-actions .bnb-btn {
    width: 100%;
    max-width: 320px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .bnb-hero {
    padding: var(--bnb-space-md) 0;
  }

  .bnb-hero-content {
    padding: 0 var(--bnb-space-xs);
  }

  .bnb-hero-logo img {
    width: 70px;
    height: 70px;
  }

  .bnb-hero-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    margin-bottom: var(--bnb-space-sm);
    line-height: 1.2;
  }

  .bnb-hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: var(--bnb-space-md);
  }

  .bnb-hero-cta {
    margin-top: var(--bnb-space-md);
  }

  .bnb-hero-cta .bnb-btn {
    padding: var(--bnb-space-sm) var(--bnb-space-md);
    font-size: 0.9rem;
  }

  /* Section improvements for very small screens */
  .bnb-section {
    padding: var(--bnb-space-md) 0;
    margin-bottom: var(--bnb-space-md);
  }

  .bnb-section-header {
    margin-bottom: var(--bnb-space-md);
    padding: 0 var(--bnb-space-xs);
  }

  .bnb-section-title {
    font-size: clamp(1.6rem, 4vw, 2rem);
  }

  .bnb-section-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  }

  /* Grid improvements for very small screens */
  .bnb-grid {
    gap: var(--bnb-space-sm);
    padding: 0 var(--bnb-space-xs);
  }

  /* Card improvements for very small screens */
  .bnb-card {
    padding: var(--bnb-space-sm);
  }

  /* Pricing card improvements for very small screens */
  .bnb-pricing-card {
    padding: var(--bnb-space-md);
  }

  /* CTA improvements for very small screens */
  .bnb-cta {
    padding: var(--bnb-space-md);
    margin: var(--bnb-space-md) 0;
  }

  .bnb-cta-title {
    font-size: clamp(1.6rem, 4vw, 2rem);
  }

  .bnb-cta-message {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  }
}

/* Ultra small mobile devices */
@media (max-width: 360px) {
  .bnb-hero {
    padding: var(--bnb-space-sm) 0;
  }

  .bnb-hero-logo img {
    width: 60px;
    height: 60px;
  }

  .bnb-hero-title {
    font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  }

  .bnb-hero-subtitle {
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  }

  .bnb-hero-cta .bnb-btn {
    padding: var(--bnb-space-sm);
    font-size: 0.85rem;
  }

  /* Section improvements for ultra small screens */
  .bnb-section {
    padding: var(--bnb-space-sm) 0;
  }

  .bnb-section-title {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  }

  .bnb-section-subtitle {
    font-size: clamp(0.85rem, 2.2vw, 1rem);
  }

  /* Card improvements for ultra small screens */
  .bnb-card {
    padding: var(--bnb-space-xs);
  }

  /* Pricing card improvements for ultra small screens */
  .bnb-pricing-card {
    padding: var(--bnb-space-sm);
  }

  /* CTA improvements for ultra small screens */
  .bnb-cta {
    padding: var(--bnb-space-sm);
  }

  .bnb-cta-title {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  }

  .bnb-cta-message {
    font-size: clamp(0.85rem, 2.2vw, 1rem);
  }
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
  .bnb-btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  .bnb-card,
  .bnb-pricing-card {
    touch-action: manipulation;
  }
}

/* Optimize spacing for mobile reading */
@media (max-width: 768px) {
  .bnb-body {
    line-height: 1.6;
  }

  .bnb-heading {
    line-height: 1.3;
  }
}

/* Ensure proper button sizing on mobile */
@media (max-width: 480px) {
  .bnb-btn {
    min-height: 40px;
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .bnb-btn {
    min-height: 36px;
    font-size: 0.85rem;
  }
}
