/**
 * Smart AI Widget - Marketing Page Enhancements
 * Enterprise-grade styling for the landing page
 * Version: 1.0.0
 */

/* ==========================================================================
   ENHANCED NAVIGATION
   ========================================================================== */

.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.logo h1 {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
}

/* ==========================================================================
   ENHANCED HERO SECTION
   ========================================================================== */

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6366f1 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, white 0%, transparent 100%);
  pointer-events: none;
}

.hero-title {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero .btn-primary {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hero .btn-primary:hover {
  background: #f9fafb;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.8);
  color: white;
}

.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  color: white;
}

/* Enhanced Browser Mockup */
.browser-mockup {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-header {
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* ==========================================================================
   ENHANCED STATS SECTION
   ========================================================================== */

.stats {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.stat-item {
  padding: 24px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.stat-number {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   ENHANCED FEATURE CARDS
   ========================================================================== */

.feature-card {
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   ENHANCED STEP CARDS
   ========================================================================== */

.step-card {
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.step-number {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.step-arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 50%;
  font-size: 24px;
}

/* ==========================================================================
   ENHANCED PRICING CARDS
   ========================================================================== */

.pricing-card {
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.pricing-card.featured {
  background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
  border-color: var(--primary-color);
}

.pricing-card.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, #764ba2 100%);
}

.popular-badge {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-features li::before {
  content: none;
}

/* ==========================================================================
   ENHANCED USE CASE CARDS
   ========================================================================== */

.use-case-card {
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.use-case-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, #764ba2 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.use-case-card:hover::after {
  transform: scaleX(1);
}

/* ==========================================================================
   ENHANCED CONTACT FORM
   ========================================================================== */

.contact-form-wrapper {
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
  border: 1px solid var(--border-color);
}

.contact-form h3 {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ==========================================================================
   ENHANCED FOOTER
   ========================================================================== */

.footer {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}

.footer-col h4 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-col ul li a {
  position: relative;
  display: inline-block;
}

.footer-col ul li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: white;
  transition: width 0.3s ease;
}

.footer-col ul li a:hover::after {
  width: 100%;
}

/* ==========================================================================
   SMOOTH SCROLL BEHAVIOR
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Skip to main content */
.skip-to-main {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-to-main:focus {
  top: 16px;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   RESPONSIVE ENHANCEMENTS
   ========================================================================== */

@media (max-width: 968px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    display: flex !important; /* Override styles.css display:none */
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 80px 24px 24px;
    gap: 16px;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    list-style: none;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    margin-left: 0 !important;
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-links .btn-outline,
  .nav-links .btn-secondary {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    margin-top: 8px;
    border-bottom: none;
  }

  .mobile-menu-overlay {
    display: block;
  }
}

/* Additional mobile fix for smaller screens */
@media (max-width: 640px) {
  .nav-links {
    display: flex !important; /* Ensure menu is available on mobile */
    width: 280px;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 12px 0;
  }

  .hero {
    padding: 60px 0 80px;
  }

  .hero::after {
    height: 80px;
  }

  .section-header h2 {
    font-size: 28px;
    line-height: 1.3;
  }

  .stats {
    padding: 40px 0;
  }

  .stat-number {
    font-size: 36px;
  }

  .features,
  .how-it-works,
  .pricing,
  .demo,
  .use-cases,
  .contact {
    padding: 60px 0;
  }

  .feature-card,
  .step-card,
  .pricing-card,
  .use-case-card {
    padding: 24px;
  }

  .contact-form-wrapper {
    padding: 24px;
  }

  .footer {
    padding: 40px 0 20px;
  }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Fade in on scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.page-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.page-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   TRUST INDICATORS
   ========================================================================== */

.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px 0;
  opacity: 0.7;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-medium);
}

.trust-badge svg {
  width: 20px;
  height: 20px;
  color: var(--secondary-color);
}

/* ==========================================================================
   TESTIMONIAL PLACEHOLDER
   ========================================================================== */

.testimonials {
  padding: 100px 0;
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
}

.testimonial-card {
  background: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

.testimonial-content {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 24px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.testimonial-info h4 {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.testimonial-info p {
  font-size: 14px;
  color: var(--text-medium);
}

/* ==========================================================================
   HOVER STATES ENHANCEMENT
   ========================================================================== */

.btn-primary,
.btn-secondary,
.btn-outline,
.btn-outline-full,
.btn-primary-full {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-secondary::after,
.btn-primary-full::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::after,
.btn-secondary:hover::after,
.btn-primary-full:hover::after {
  width: 300px;
  height: 300px;
}
