/* TMVGate Version C - Custom Styles & Design System */

/* Root Variables - Data in Motion Theme */
:root {
  --quantum-purple: #7C3AED;
  --data-blue: #2563EB;
  --midnight: #1E293B;
  --mist: #F1F5F9;
  --success-emerald: #059669;
  --alert-amber: #D97706;
  --trust-slate: #475569;
  --glass-white: rgba(255, 255, 255, 0.95);
  --glass-dark: rgba(30, 41, 59, 0.95);
}

/* Global Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.font-mono {
  font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}

/* Custom Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dataFlow {
  0% { 
    stroke-dashoffset: 0;
  }
  100% { 
    stroke-dashoffset: -100;
  }
}

/* Gradient Text Effect */
.text-gradient {
  background: linear-gradient(135deg, var(--quantum-purple), var(--data-blue), var(--quantum-purple));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Glass Morphism Effects */
.glass {
  background: var(--glass-white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Data Grid Pattern */
.data-grid-pattern {
  background-image: 
    linear-gradient(rgba(124, 58, 237, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Data Flow Background */
.data-flow-bg {
  background-image: 
    radial-gradient(circle at 20% 50%, var(--quantum-purple) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, var(--data-blue) 0%, transparent 50%);
  opacity: 0.05;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--mist);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--quantum-purple), var(--data-blue));
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--quantum-purple);
}

/* Header Scroll Effect */
header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Hero Section Enhancements */
.hero-headline {
  animation: slideUp 0.8s ease-out;
}

/* Responsive adjustments to prevent 3-line wrap */
@media (min-width: 1024px) and (max-width: 1280px) {
  .hero-headline {
    font-size: 3.5rem !important; /* Between lg and xl */
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .hero-headline {
    font-size: 2.75rem !important; /* Optimize for tablets */
  }
}

.hero-subheadline {
  animation: slideUp 0.8s ease-out 0.2s backwards;
}

.hero-description {
  animation: fadeIn 1s ease-out 0.4s backwards;
}

.social-proof-bar {
  animation: fadeIn 1s ease-out 0.6s backwards;
}

.hero-cta {
  animation: slideUp 0.8s ease-out 0.8s backwards;
}

.trust-logos {
  animation: fadeIn 1s ease-out 1s backwards;
}

/* Keep the gradient animation for visual interest */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Section Animations (Will be enhanced with GSAP) */
.section-headline {
  opacity: 0;
  transform: translateY(30px);
}

.problem-card, .step-card, .benefit-card, .faq-item {
  opacity: 0;
  transform: translateY(30px);
}

/* Hover Effects */
.hover-lift {
  transition: all 0.3s ease;
}

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

/* Button Magnetic Effect (Will be enhanced with GSAP) */
.magnetic-button {
  position: relative;
  transition: all 0.3s ease;
}

/* Loading Animation */
.loading-spinner {
  border: 3px solid var(--mist);
  border-top: 3px solid var(--quantum-purple);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Video Container Aspect Ratio */
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Fallback for older browsers */
@supports not (aspect-ratio: 16 / 9) {
  .aspect-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
  }
  
  .aspect-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Mobile Menu Animation */
#mobile-menu {
  transition: all 0.3s ease;
  transform-origin: top;
}

#mobile-menu.hidden {
  transform: scaleY(0);
  opacity: 0;
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .hero-headline { font-size: 3rem; }
  .hero-subheadline { font-size: 2rem; }
}

/* Performance Optimizations */
.will-animate {
  will-change: transform, opacity;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Styles */
a:focus, button:focus {
  outline: 2px solid var(--quantum-purple);
  outline-offset: 2px;
}

/* Video Modal Styles */
#video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.video-modal-overlay {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.video-modal-content {
  padding: 1rem;
}

#close-video-modal {
  transition: all 0.2s ease;
}

#close-video-modal:hover {
  transform: rotate(90deg);
}

/* Video trigger button styles */
.video-modal-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  outline-offset: 2px;
}

.video-modal-trigger:focus {
  outline: 2px solid var(--quantum-purple);
  outline-offset: 2px;
}

/* Ensure modal is responsive */
@media (max-width: 768px) {
  .video-modal-content {
    padding: 0.5rem;
  }
  
  #video-modal-title {
    font-size: 1rem;
  }
}

/* Customer logo styles */
.logo-container {
  background-color: transparent;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

/* Optional: Add subtle background on hover */
.logo-container:hover {
  background-color: rgba(124, 58, 237, 0.05);
}

/* Ensure images stay within bounds */
.trust-logos img,
.logo-cloud img {
  max-width: 100%;
  height: auto;
}

/* Responsive logo sizing */
@media (max-width: 640px) {
  .logo-cloud .logo-container {
    height: 4rem;
  }
  
  .logo-cloud img {
    max-width: 100px;
  }
}

/* Print Styles */
@media print {
  header, footer, .hero-cta, .demo-video-btn, #video-modal {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* Dark Mode Support (Progressive Enhancement) */
@media (prefers-color-scheme: dark) {
  :root {
    --midnight: #F1F5F9;
    --mist: #1E293B;
    --trust-slate: #CBD5E1;
  }
  
  body {
    background-color: #0F172A;
    color: #E2E8F0;
  }
  
  .bg-white {
    background-color: #1E293B;
  }
  
  .text-midnight {
    color: #F1F5F9;
  }
}

/* Lazy Video Loading Styles */
.lazy-video {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.lazy-video img {
  transition: transform 0.3s ease;
}

.lazy-video:hover img {
  transform: scale(1.05);
}

/* Play button animation */
.lazy-video .bg-black {
  cursor: pointer;
}

.lazy-video:hover .w-20,
.lazy-video:hover .w-16 {
  transform: scale(1.1);
}

/* Loading spinner */
.video-loading {
  z-index: 20;
}

/* Smooth iframe appearance */
.lazy-video iframe {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lazy-video[data-loaded="true"] iframe {
  opacity: 1;
}

/* Fallback for broken thumbnails */
.lazy-video img[src*="hqdefault"] {
  filter: blur(1px);
  transform: scale(1.1);
}