<div class="pricing-container">
  <div class="pricing-header">
    <h2>Choose Your Plan</h2>
    <p>Select the perfect plan for your needs. Upgrade or downgrade at any time.</p>
  </div>
  
  <div class="pricing-toggle">
    <span class="toggle-label">Monthly</span>
    <label class="toggle-switch">
      <input type="checkbox" id="billingToggle">
      <span class="slider"></span>
    </label>
    <span class="toggle-label">Yearly <span class="discount-badge">Save 20%</span></span>
  </div>
  
  <div class="pricing-grid">
    <!-- Basic Plan -->
    <div class="pricing-card">
      <div class="card-header">
        <h3>Basic</h3>
        <p>Perfect for individuals</p>
      </div>
      <div class="card-price">
        <span class="currency">$</span>
        <span class="amount monthly-price">9</span>
        <span class="amount yearly-price" style="display: none;">7</span>
        <span class="period">/month</span>
      </div>
      <ul class="features-list">
        <li><span class="check">β</span> Up to 5 projects</li>
        <li><span class="check">β</span> 10GB storage</li>
        <li><span class="check">β</span> Email support</li>
        <li><span class="check">β</span> Basic analytics</li>
        <li class="unavailable"><span class="cross">β</span> Priority support</li>
        <li class="unavailable"><span class="cross">β</span> Advanced features</li>
      </ul>
      <button class="plan-btn">Get Started</button>
    </div>
    
    <!-- Pro Plan (Popular) -->
    <div class="pricing-card popular">
      <div class="popular-badge">Most Popular</div>
      <div class="card-header">
        <h3>Pro</h3>
        <p>Best for growing teams</p>
      </div>
      <div class="card-price">
        <span class="currency">$</span>
        <span class="amount monthly-price">29</span>
        <span class="amount yearly-price" style="display: none;">23</span>
        <span class="period">/month</span>
      </div>
      <ul class="features-list">
        <li><span class="check">β</span> Unlimited projects</li>
        <li><span class="check">β</span> 100GB storage</li>
        <li><span class="check">β</span> Priority support</li>
        <li><span class="check">β</span> Advanced analytics</li>
        <li><span class="check">β</span> Team collaboration</li>
        <li><span class="check">β</span> API access</li>
      </ul>
      <button class="plan-btn primary">Start Free Trial</button>
    </div>
    
    <!-- Enterprise Plan -->
    <div class="pricing-card">
      <div class="card-header">
        <h3>Enterprise</h3>
        <p>For large organizations</p>
      </div>
      <div class="card-price">
        <span class="currency">$</span>
        <span class="amount monthly-price">99</span>
        <span class="amount yearly-price" style="display: none;">79</span>
        <span class="period">/month</span>
      </div>
      <ul class="features-list">
        <li><span class="check">β</span> Everything in Pro</li>
        <li><span class="check">β</span> Unlimited storage</li>
        <li><span class="check">β</span> 24/7 phone support</li>
        <li><span class="check">β</span> Custom integrations</li>
        <li><span class="check">β</span> Advanced security</li>
        <li><span class="check">β</span> Dedicated manager</li>
      </ul>
      <button class="plan-btn">Contact Sales</button>
    </div>
  </div>
  
  <div class="pricing-footer">
    <p>All plans include a 30-day money-back guarantee</p>
  </div>
</div>
     .pricing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 20px;
}
.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}
.pricing-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 15px 0;
}
.pricing-header p {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
}
.toggle-label {
  font-weight: 600;
  color: #333;
}
.discount-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 30px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
input:checked + .slider:before {
  transform: translateX(30px);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}
.pricing-card {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 40px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}
.pricing-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.pricing-card.popular {
  border-color: #667eea;
  transform: scale(1.05);
}
.pricing-card.popular:hover {
  transform: scale(1.05) translateY(-10px);
}
.popular-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.card-header {
  text-align: center;
  margin-bottom: 30px;
}
.card-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 10px 0;
}
.card-header p {
  color: #666;
  margin: 0;
}
.card-price {
  text-align: center;
  margin-bottom: 40px;
}
.currency {
  font-size: 1.5rem;
  font-weight: 600;
  color: #667eea;
  vertical-align: top;
}
.amount {
  font-size: 3rem;
  font-weight: 700;
  color: #333;
  transition: all 0.3s ease;
}
.period {
  font-size: 1rem;
  color: #666;
  margin-left: 5px;
}
.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 40px 0;
}
.features-list li {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.features-list li:last-child {
  border-bottom: none;
}
.check {
  color: #27ae60;
  font-weight: bold;
  margin-right: 12px;
  width: 20px;
}
.cross {
  color: #e74c3c;
  font-weight: bold;
  margin-right: 12px;
  width: 20px;
}
.unavailable {
  opacity: 0.5;
}
.plan-btn {
  width: 100%;
  padding: 15px;
  border: 2px solid #667eea;
  background: transparent;
  color: #667eea;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.plan-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}
.plan-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}
.plan-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}
.pricing-footer {
  text-align: center;
  color: #666;
  font-size: 14px;
}
/* Animation for price change */
.amount {
  position: relative;
  display: inline-block;
}
.amount.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}
.amount.fade-in {
  opacity: 1;
  transform: translateY(0);
}
/* Responsive */
@media (max-width: 768px) {
  .pricing-container {
    padding: 30px 15px;
  }
  
  .pricing-header h2 {
    font-size: 2rem;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .pricing-card.popular {
    transform: none;
  }
  
  .pricing-card.popular:hover {
    transform: translateY(-10px);
  }
  
  .pricing-card {
    padding: 30px 20px;
  }
}
/* Loading animation */
.pricing-card {
  animation: slideInUp 0.6s ease-out;
}
.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.2s; }
.pricing-card:nth-child(3) { animation-delay: 0.3s; }
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
     document.addEventListener('DOMContentLoaded', function() {
  const billingToggle = document.getElementById('billingToggle');
  const monthlyPrices = document.querySelectorAll('.monthly-price');
  const yearlyPrices = document.querySelectorAll('.yearly-price');
  const planButtons = document.querySelectorAll('.plan-btn');
  
  // Billing toggle functionality
  billingToggle.addEventListener('change', function() {
    const isYearly = this.checked;
    
    monthlyPrices.forEach((price, index) => {
      const yearlyPrice = yearlyPrices[index];
      
      if (isYearly) {
        // Fade out monthly, fade in yearly
        price.classList.add('fade-out');
        setTimeout(() => {
          price.style.display = 'none';
          yearlyPrice.style.display = 'inline';
          yearlyPrice.classList.add('fade-in');
        }, 150);
      } else {
        // Fade out yearly, fade in monthly
        yearlyPrice.classList.remove('fade-in');
        yearlyPrice.classList.add('fade-out');
        setTimeout(() => {
          yearlyPrice.style.display = 'none';
          price.style.display = 'inline';
          price.classList.remove('fade-out');
        }, 150);
      }
    });
  });
  
  // Plan button interactions
  planButtons.forEach(button => {
    button.addEventListener('click', function() {
      const card = this.closest('.pricing-card');
      const planName = card.querySelector('h3').textContent;
      const isYearly = billingToggle.checked;
      const billing = isYearly ? 'yearly' : 'monthly';
      
      // Add click animation
      this.style.transform = 'scale(0.95)';
      setTimeout(() => {
        this.style.transform = '';
      }, 150);
      
      // Handle different button types
      if (this.textContent.includes('Contact Sales')) {
        showContactModal(planName);
      } else if (this.textContent.includes('Free Trial')) {
        startFreeTrial(planName, billing);
      } else {
        selectPlan(planName, billing);
      }
    });
  });
  
  function selectPlan(planName, billing) {
    console.log(`Selected ${planName} plan with ${billing} billing`);
    
    // Show selection feedback
    showNotification(`${planName} plan selected! Redirecting to checkout...`);
    
    // Simulate redirect delay
    setTimeout(() => {
      // Here you would redirect to your checkout page
      console.log('Redirecting to checkout...');
    }, 2000);
  }
  
  function startFreeTrial(planName, billing) {
    console.log(`Starting free trial for ${planName} plan`);
    
    showNotification('Starting your free trial! No credit card required.');
    
    // Simulate trial setup
    setTimeout(() => {
      console.log('Trial setup complete');
    }, 2000);
  }
  
  function showContactModal(planName) {
    // Create modal
    const modal = document.createElement('div');
    modal.style.cssText = `
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      animation: fadeIn 0.3s ease;
    `;
    
    modal.innerHTML = `
      <div style="
        background: white;
        padding: 40px;
        border-radius: 20px;
        text-align: center;
        max-width: 400px;
        animation: scaleIn 0.3s ease;
      ">
        <h3 style="margin: 0 0 20px 0; color: #333;">Contact Sales</h3>
        <p style="margin: 0 0 30px 0; color: #666;">
          Interested in our ${planName} plan? Our sales team will contact you within 24 hours.
        </p>
        <div style="display: flex; gap: 15px; justify-content: center;">
          <button onclick="this.closest('div').parentElement.remove()" style="
            padding: 12px 24px;
            border: 2px solid #667eea;
            background: transparent;
            color: #667eea;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 600;
          ">Cancel</button>
          <button onclick="alert('Sales team contacted!'); this.closest('div').parentElement.remove();" style="
            padding: 12px 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 600;
          ">Contact Sales</button>
        </div>
      </div>
    `;
    
    document.body.appendChild(modal);
    
    // Close on backdrop click
    modal.addEventListener('click', function(e) {
      if (e.target === modal) {
        modal.remove();
      }
    });
  }
  
  function showNotification(message) {
    const notification = document.createElement('div');
    notification.style.cssText = `
      position: fixed;
      top: 20px;
      right: 20px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      padding: 15px 25px;
      border-radius: 10px;
      z-index: 1000;
      animation: slideInRight 0.3s ease;
    `;
    notification.textContent = message;
    
    document.body.appendChild(notification);
    
    setTimeout(() => {
      notification.style.animation = 'slideOutRight 0.3s ease';
      setTimeout(() => {
        notification.remove();
      }, 300);
    }, 3000);
  }
  
  // Add required animations
  const animations = `
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    
    @keyframes scaleIn {
      from { transform: scale(0.8); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    
    @keyframes slideInRight {
      from { transform: translateX(100%); }
      to { transform: translateX(0); }
    }
    
    @keyframes slideOutRight {
      from { transform: translateX(0); }
      to { transform: translateX(100%); }
    }
  `;
  
  const styleSheet = document.createElement('style');
  styleSheet.textContent = animations;
  document.head.appendChild(styleSheet);
});