/* Custom CSS Styles & Utilities for MSquare Studio */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  --primary: #0a0a0c;
  --electric-blue: #4F46E5;
  --electric-blue-glow: rgba(79, 70, 229, 0.35);
  --electric-blue-light: #EEF2FF;
  --accent-cyan: #06B6D4;
  --accent-purple: #8B5CF6;
  --surface-pure: #FFFFFF;
  --surface-warm: #FAFAF7;
  --border-light: #E8E8E3;
  --text-muted: #64748B;
}

html {
  scroll-behavior: smooth;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Background Grids & Ambient Effects */
.bg-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(79, 70, 229, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 70, 229, 0.035) 1px, transparent 1px);
}

.soft-shadow {
  box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.08);
}

.card-shadow {
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.85);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-shadow:hover {
  box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.14), 0 0 0 1px rgba(79, 70, 229, 0.35);
  transform: translateY(-3px);
}

.card-featured-glow {
  box-shadow: 0 12px 35px -8px rgba(79, 70, 229, 0.18), 0 0 0 1.5px rgba(79, 70, 229, 0.4);
}

/* Typography Gradient Helpers */
.gradient-text {
  background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blue-gradient-text {
  background: linear-gradient(135deg, #4F46E5 0%, #818CF8 50%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism & Floating Elements */
.glass-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 232, 227, 0.8);
}

.pill-badge {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(226, 232, 240, 0.85);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill-badge:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(79, 70, 229, 0.2), 0 0 0 1px rgba(79, 70, 229, 0.4);
}

/* 3D Canvas Seamless Container */
#threejs-canvas-wrapper {
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: visible;
  background: transparent !important;
}

#threejs-canvas-wrapper canvas {
  outline: none;
  background: transparent !important;
}

#threejs-canvas-wrapper:active {
  cursor: grabbing;
}

/* Micro-animations */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(8px) rotate(-1deg);
  }
}

.animate-float-1 {
  animation: floatSlow 5s ease-in-out infinite;
}

.animate-float-2 {
  animation: floatReverse 6s ease-in-out infinite 0.5s;
}

.animate-float-3 {
  animation: floatSlow 7s ease-in-out infinite 1s;
}

.animate-float-4 {
  animation: floatReverse 5.5s ease-in-out infinite 1.5s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F5F7FA;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Modal backdrop */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Tab active state */
.tab-active {
  background-color: #4F46E5 !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Step Flow Arrows & Connecting Pipeline */
.flow-step {
  position: relative;
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: #818CF8;
  font-weight: bold;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
}

@media (max-width: 768px) {
  .flow-step:not(:last-child)::after {
    content: "↓";
    right: 50%;
    top: auto;
    bottom: -20px;
    transform: translateX(50%);
  }
}
