/* Custom CSS for BXB Landing Page */

/* Smooth scrolling and base styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar - Simplified */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #6366f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

/* Intersection Observer Animation Classes */
.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.fade-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.fade-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease-out;
}

.scale-in.animate {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animation delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Interactive Elements */
.interactive-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.interactive-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 82, 204, 0.15);
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.feature-card:hover::before {
  left: 100%;
}

/* Glassmorphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text - Simplified */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Glowing Effects - Simplified */
.glow-primary {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  animation: glow-pulse-primary 3s ease-in-out infinite alternate;
}

.glow-accent {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  animation: glow-pulse-accent 3s ease-in-out infinite alternate;
}

@keyframes glow-pulse-primary {
  0% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  100% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes glow-pulse-accent {
  0% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  100% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.6); }
}

/* Particle Animation Background */
.particle-bg {
  position: relative;
  overflow: hidden;
}

.particle-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.2), transparent),
                    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.1), transparent),
                    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.3), transparent),
                    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.2), transparent);
  background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
  animation: particle-float 20s linear infinite;
  pointer-events: none;
}

@keyframes particle-float {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* Advanced Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Morphing Button Effect - Simplified */
.morph-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(45deg, #6366f1, #4f46e5);
  transition: all 0.3s ease;
}

.morph-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.morph-button:hover::before {
  left: 100%;
}

.morph-button:hover {
  background: linear-gradient(45deg, #4f46e5, #00d4ff);
  transform: scale(1.05);
}

/* Text Reveal Animation */
.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  transform: translateX(-100%);
  animation: text-reveal 2s ease-in-out;
}

@keyframes text-reveal {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* Custom Button Styles - Simplified */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: transparent;
  color: #6366f1;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid #6366f1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

/* Code Block Styling */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  position: relative;
}

.code-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #323233;
  border-radius: 12px 12px 0 0;
}

.code-block::after {
  content: '● ● ●';
  position: absolute;
  top: 8px;
  left: 12px;
  color: #ff5f56;
  font-size: 12px;
  letter-spacing: 4px;
}

/* Architecture Diagram Enhancements */
.arch-container {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.arch-layer {
  transition: all 0.3s ease;
  border-radius: 12px;
  margin-bottom: 16px;
}

.arch-layer:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.arch-component {
  transition: all 0.2s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.arch-component:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* Function Cards Styles */
.function-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.function-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.function-details {
  animation: slideDown 0.3s ease-out;
}

.function-detail-content {
  animation: fadeIn 0.3s ease-out;
}

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

/* Enhanced hover effects for function cards */
.function-card .fa-chevron-down {
  transition: transform 0.3s ease;
}

.function-card:hover .fa-chevron-down {
  transform: translateY(2px);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  .section-subtitle {
    font-size: 1.125rem;
  }
  
  /* Mobile-specific adjustments */
  .feature-card {
    padding: 1.5rem;
  }
  
  .interactive-card {
    padding: 1rem;
  }
  
  .arch-component {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  
  .code-block {
    font-size: 0.75rem;
    padding: 1rem;
  }
  
  /* Stack architecture layers on mobile */
  .arch-layer .grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  /* Simplify complex grids on mobile */
  .lg\:grid-cols-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .lg\:grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Function cards mobile adjustments */
  .function-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .function-card h3 {
    font-size: 1.125rem;
  }
  
  .function-detail-content {
    padding: 1rem;
  }
  
  .function-detail-content .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Print Styles */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .no-print {
    display: none !important;
  }
  
  section {
    page-break-inside: avoid;
    margin-bottom: 20pt;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .hero-section {
    height: auto !important;
    min-height: auto !important;
    padding: 40pt 0;
  }
  
  .interactive-card {
    transform: none !important;
    box-shadow: 0 2pt 4pt rgba(0, 0, 0, 0.1) !important;
  }
  
  .glass, .glass-dark {
    background: white !important;
    backdrop-filter: none !important;
    border: 1pt solid #e5e7eb !important;
  }
}

/* Loading Animation */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility - Simplified */
*:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

button:focus,
a:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .glass,
  .glass-dark {
    background: white;
    border: 2px solid black;
  }
  
  .gradient-text {
    -webkit-text-fill-color: initial;
    color: black;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
