/* ============================================
   VR CONNECT AI - PRICING PRECISION REPAIR
   FINAL ALIGNMENT & SPACING FIX
   NO REDESIGN - PURE PRECISION ENHANCEMENT
============================================ */

/* ============================================
   ROOT CAUSE FIX: CLEAR ALL CONFLICTING RULES
   Remove overlapping transforms and positions
============================================ */

/* ============================================
   1. PRICING SECTION CONTAINER
============================================ */
.pricing {
  padding: 100px 0 !important;
  position: relative;
  overflow: visible !important; /* Allow badges to show */
}

@media (max-width: 768px) {
  .pricing {
    padding: 70px 0 !important;
  }
}

/* ============================================
   2. PRICING HEADER - VERTICAL RHYTHM FIX
============================================ */
.pricing-header {
  text-align: center;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  position: relative;
}

/* ============================================
   3. PRICING BADGE - PROPER SPACING
============================================ */
.pricing-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 8px !important;
  padding: 8px 20px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  border-radius: 100px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  color: #2563EB !important;
  text-transform: uppercase;
  box-shadow: 
    0 2px 8px rgba(37, 99, 235, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04) !important;
  
  /* CRITICAL: Proper spacing below badge */
  margin-bottom: 24px !important;
  
  /* Remove any absolute positioning */
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

.pricing-badge-dot {
  width: 6px !important;
  height: 6px !important;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  border-radius: 50%;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* ============================================
   4. PRICING TITLE - BASELINE ALIGNMENT
============================================ */
.pricing-title {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: clamp(36px, 4vw, 48px) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #0F172A !important;
  
  /* CRITICAL: Proper spacing */
  margin-top: 0 !important;
  margin-bottom: 16px !important;
  
  /* Ensure proper baseline */
  display: block !important;
}

/* Gradient Text - Same Baseline */
.pricing-title .highlight-text {
  background: linear-gradient(110deg, #2563EB 0%, #3B82F6 40%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
  /* CRITICAL: No display changes that affect baseline */
  display: inline !important;
  vertical-align: baseline !important;
  line-height: inherit !important;
}

/* ============================================
   5. PRICING SUBTITLE - CLEAR SPACING
============================================ */
.pricing-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 17px !important;
  line-height: 1.6 !important;
  color: #64748B !important;
  max-width: 600px;
  margin: 0 auto !important;
  
  /* CRITICAL: Space before toggle */
  margin-bottom: 40px !important;
}

@media (max-width: 768px) {
  .pricing-subtitle {
    font-size: 15px !important;
    margin-bottom: 32px !important;
  }
}

/* ============================================
   6. BILLING TOGGLE - SINGLE COMPONENT FIX
   ROOT CAUSE: Multiple background layers causing visual issues
============================================ */
.billing-toggle {
  /* Container */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  
  /* Sizing */
  width: auto !important;
  max-width: fit-content !important;
  padding: 4px !important;
  
  /* Appearance */
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1.5px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 100px !important;
  box-shadow: 
    0 2px 12px rgba(15, 23, 42, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  
  /* Position */
  position: relative !important;
  
  /* CRITICAL: Space to cards */
  margin-bottom: 56px !important;
  
  /* Remove any transforms */
  transform: none !important;
}

/* CRITICAL: Active indicator background */
.billing-toggle::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  pointer-events: none;
}

/* Monthly Active State - Cover left button */
.billing-toggle[data-cycle="monthly"]::before {
  width: 48%; /* Approx half, adjust based on content */
  transform: translateX(0);
}

/* Yearly Active State - Cover right button + badge */
.billing-toggle[data-cycle="yearly"]::before {
  width: 52%; /* Slightly wider to include badge */
  transform: translateX(92%); /* Move to right side */
}

/* ============================================
   7. BILLING LABELS - CONSISTENT SIZING
============================================ */
.billing-label {
  /* Position */
  position: relative;
  z-index: 2;
  
  /* Sizing */
  padding: 10px 28px !important;
  
  /* Typography */
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  
  /* Appearance */
  color: #64748B !important;
  background: transparent !important;
  border: none !important;
  border-radius: 100px !important;
  
  /* Interaction */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Remove any transforms */
  transform: none !important;
}

.billing-label:hover {
  color: #475569 !important;
}

.billing-label.active {
  color: #FFFFFF !important;
}

/* ============================================
   8. TOGGLE SWITCH - VISUALLY HIDDEN BUT ACCESSIBLE
   Keep it in DOM for JavaScript but visually integrate with segmented control
============================================ */
.toggle-switch {
  /* Visually hidden but functionally present */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.toggle-slider {
  display: none !important;
}

/* If you want to show the switch visually in the middle, use this instead:
.toggle-switch {
  display: none !important;
}
*/

/* ============================================
   9. SAVE BADGE - COMPACT & CLEAR
============================================ */
.save-badge {
  display: inline-flex !important;
  align-items: center;
  padding: 4px 10px !important;
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%) !important;
  color: #FFFFFF !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  border-radius: 100px !important;
  margin-left: 8px !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

/* ============================================
   10. PRICING GRID - PERFECT ALIGNMENT
============================================ */
.pricing-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 28px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  align-items: start !important; /* Prevent stretching */
}

@media (max-width: 1024px) {
  .pricing-grid {
    gap: 24px !important;
    max-width: 900px !important;
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    max-width: 500px !important;
  }
}

/* ============================================
   11. PRICING CARDS - CONSISTENT HEIGHT
============================================ */
.pricing-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  
  /* Sizing */
  height: 100% !important;
  min-height: 580px !important;
  
  /* Spacing */
  padding: 40px 32px !important;
  
  /* Appearance */
  background: #FFFFFF !important;
  border: 1.5px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 24px !important;
  box-shadow: 
    0 4px 12px rgba(15, 23, 42, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  
  /* Interaction */
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  
  /* Allow badge to overflow */
  overflow: visible !important;
}

.pricing-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 
    0 12px 32px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

@media (max-width: 768px) {
  .pricing-card {
    min-height: auto !important;
    padding: 32px 24px !important;
  }
}

/* ============================================
   12. PROFESSIONAL CARD - SUBTLE EMPHASIS
============================================ */
.pricing-card.popular,
.pricing-card[data-plan="professional"] {
  border-color: rgba(37, 99, 235, 0.25) !important;
  box-shadow: 
    0 8px 24px rgba(37, 99, 235, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(37, 99, 235, 0.06) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

.pricing-card.popular:hover,
.pricing-card[data-plan="professional"]:hover {
  box-shadow: 
    0 16px 48px rgba(37, 99, 235, 0.16),
    0 6px 20px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(37, 99, 235, 0.1) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* ============================================
   13. MOST POPULAR BADGE - PROPER POSITIONING
   ROOT CAUSE: Badge was cut off by parent overflow
============================================ */
.popular-badge-wrapper {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 0 !important; /* No height to avoid affecting layout */
  z-index: 10 !important;
  pointer-events: none;
}

.popular-badge {
  position: absolute !important;
  top: -14px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  
  /* Sizing */
  padding: 7px 20px !important;
  
  /* Appearance */
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
  color: #FFFFFF !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px !important;
  box-shadow: 
    0 4px 16px rgba(37, 99, 235, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.12) !important;
  white-space: nowrap;
  
  /* Restore pointer events for badge */
  pointer-events: auto;
}

.popular-badge i {
  margin-right: 6px;
  font-size: 10px;
}

/* ============================================
   14. CARD INTERNAL SPACING - VERTICAL RHYTHM
============================================ */
.pricing-card-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 0 !important; /* Remove if it adds extra padding */
}

.plan-header {
  text-align: center;
  margin-bottom: 24px !important;
  padding-bottom: 24px !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.plan-icon {
  width: 64px !important;
  height: 64px !important;
  margin: 0 auto 18px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 26px !important;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pricing-card:hover .plan-icon {
  transform: translateY(-2px) scale(1.04) rotate(2deg);
}

.plan-name {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  margin-bottom: 8px !important;
  line-height: 1.3 !important;
}

.plan-desc {
  font-size: 14px !important;
  color: #64748B !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

/* ============================================
   15. PLAN PRICE - CLEAN ALIGNMENT
============================================ */
.plan-price {
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 4px !important;
  margin-bottom: 28px !important;
}

.price-currency {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #64748B !important;
}

.price-amount {
  font-size: 44px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  line-height: 1 !important;
  transition: opacity 0.15s ease;
}

/* Price switching animation */
.price-amount.switching,
.price-period.switching {
  opacity: 0.3;
}

.price-period {
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #64748B !important;
  transition: opacity 0.15s ease;
}

/* ============================================
   16. PLAN FEATURES - CONSISTENT SPACING
============================================ */
.plan-features {
  flex: 1 !important; /* Push button to bottom */
  margin-bottom: 28px !important;
}

.feature-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  transition: transform 0.2s ease;
}

.feature-item:last-child {
  margin-bottom: 0 !important;
}

.feature-item:hover {
  transform: translateX(3px);
}

.feature-item i {
  font-size: 16px !important;
  margin-top: 2px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feature-item:hover i {
  transform: scale(1.15);
}

.feature-item.included {
  color: #0F172A !important;
}

.feature-item.included i {
  color: #10B981 !important;
}

.feature-item.excluded {
  color: #94A3B8 !important;
}

.feature-item.excluded i {
  color: #CBD5E1 !important;
}

/* ============================================
   17. PLAN BUTTON - CONSISTENT STYLING
============================================ */
.btn-plan {
  width: 100% !important;
  padding: 14px 28px !important;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 12px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: 
    0 4px 16px rgba(37, 99, 235, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: auto !important; /* Stick to bottom */
}

.btn-plan:hover {
  transform: translateY(-2px) !important;
  box-shadow: 
    0 8px 24px rgba(37, 99, 235, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.btn-plan:active {
  transform: translateY(0) !important;
}

.btn-plan i {
  font-size: 14px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-plan:hover i {
  transform: translateX(3px);
}

/* ============================================
   18. DIVIDER (IF EXISTS)
============================================ */
.pricing-divider {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 56px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(226, 232, 240, 0.6) 20%,
    rgba(226, 232, 240, 0.8) 50%,
    rgba(226, 232, 240, 0.6) 80%,
    transparent 100%
  );
}

/* ============================================
   19. MOBILE RESPONSIVE REFINEMENT
============================================ */
@media (max-width: 768px) {
  .pricing-badge {
    font-size: 10px !important;
    padding: 7px 16px !important;
    margin-bottom: 20px !important;
  }
  
  .pricing-title {
    font-size: clamp(28px, 6vw, 36px) !important;
    margin-bottom: 14px !important;
  }
  
  .pricing-subtitle {
    font-size: 15px !important;
    margin-bottom: 32px !important;
  }
  
  .billing-toggle {
    margin-bottom: 40px !important;
    max-width: 100%;
    padding: 3px !important;
  }
  
  .billing-label {
    padding: 9px 20px !important;
    font-size: 13px !important;
  }
  
  .save-badge {
    font-size: 9px !important;
    padding: 3px 8px !important;
    margin-left: 6px !important;
  }
  
  .popular-badge {
    font-size: 10px !important;
    padding: 6px 16px !important;
    top: -12px !important;
  }
  
  .plan-icon {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
  }
  
  .price-amount {
    font-size: 36px !important;
  }
  
  .feature-item {
    font-size: 13px !important;
  }
}

/* ============================================
   20. ANIMATION - SUBTLE & NON-DISRUPTIVE
============================================ */

/* Scroll Reveal - Already handled by visual-polish.js */
/* Ensure cards reveal smoothly without layout shift */

/* Card stagger delays */
.pricing-card:nth-child(1) {
  animation-delay: 0ms !important;
}

.pricing-card:nth-child(2) {
  animation-delay: 80ms !important;
}

.pricing-card:nth-child(3) {
  animation-delay: 160ms !important;
}

/* ============================================
   21. ACCESSIBILITY - REDUCED MOTION
============================================ */
@media (prefers-reduced-motion: reduce) {
  .billing-toggle::before,
  .billing-label,
  .pricing-card,
  .btn-plan,
  .feature-item {
    transition-duration: 0.01ms !important;
  }
  
  .badge-pulse {
    animation: none !important;
  }
  
  .pricing-card:hover,
  .btn-plan:hover {
    transform: none !important;
  }
}

/* ============================================
   22. PERFORMANCE - WILL-CHANGE
============================================ */
.billing-toggle::before {
  will-change: transform, width;
}

.pricing-card {
  will-change: transform;
}

.pricing-card:not(:hover) {
  will-change: auto;
}

/* ============================================
   END OF PRECISION REPAIR
   All fixes are surgical and targeted
   No redesign, only alignment and spacing correction
============================================ */
