.magnetic-faq-container {
max-width: 800px;
margin: 2rem auto;
padding: 2rem;
font-family: 'Inter', sans-serif;
background: #0f172a;
position: relative;
overflow: hidden;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.faq-header {
text-align: center;
margin-bottom: 3rem;
position: relative;
z-index: 2;
}
.faq-title {
font-size: 2.5rem;
margin-bottom: 0.5rem;
color: #e2e8f0;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.faq-subtitle {
color: #94a3b8;
font-size: 1.1rem;
}
.pricing-toggle {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
margin-bottom: 3rem;
position: relative;
z-index: 2;
}
.toggle-label {
font-size: 1rem;
color: #cbd5e1;
font-weight: 500;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 30px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #1e293b;
transition: .4s;
border-radius: 34px;
border: 1px solid #334155;
}
.slider:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 4px;
bottom: 3px;
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
transition: .4s;
border-radius: 50%;
box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
input:checked + .slider {
background: #1e293b;
}
input:checked + .slider:before {
transform: translateX(30px);
box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}
.discount-badge {
background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
color: white;
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 600;
margin-left: 0.5rem;
box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}
.faq-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
position: relative;
z-index: 2;
}
.faq-item {
background: rgba(30, 41, 59, 0.7);
border: 1px solid rgba(148, 163, 184, 0.2);
border-radius: 16px;
overflow: hidden;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
position: relative;
transform: translateZ(0);
will-change: transform;
}
.faq-item::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), transparent);
transform: translateX(-100%);
}
.faq-item:hover {
background: rgba(30, 41, 59, 0.9);
border-color: rgba(148, 163, 184, 0.4);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
transform: translateY(-5px);
}
.faq-item.magnetic-active {
border-color: #6366f1;
box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}
.faq-question {
display: flex;
align-items: center;
padding: 1.5rem;
cursor: pointer;
position: relative;
}
.magnetic-dot {
width: 12px;
height: 12px;
border-radius: 50%;
background: #6366f1;
margin-right: 1rem;
position: relative;
transition: all 0.3s ease;
box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
}
.faq-item.magnetic-active .magnetic-dot {
background: #8b5cf6;
transform: scale(1.3);
box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}
.faq-question h3 {
margin: 0;
font-size: 1.2rem;
color: #e2e8f0;
flex: 1;
transition: color 0.3s ease;
}
.faq-item.magnetic-active .faq-question h3 {
color: #6366f1;
}
.question-icon {
font-size: 1.5rem;
color: #94a3b8;
transition: all 0.3s ease;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.faq-item.magnetic-active .question-icon {
color: #6366f1;
transform: scale(1.2);
}
.faq-item.active .question-icon {
transform: rotate(45deg);
}
.faq-item.magnetic-active.active .question-icon {
transform: rotate(45deg) scale(1.2);
}
.faq-answer {
padding: 0 1.5rem;
max-height: 0;
overflow: hidden;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
background: rgba(15, 23, 42, 0.5);
border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.faq-item.active .faq-answer {
padding: 0 1.5rem 1.5rem;
max-height: 200px;
}
.faq-answer p {
margin: 1rem 0 0 0;
color: #cbd5e1;
line-height: 1.6;
}
@media (max-width: 768px) {
.magnetic-faq-container {
padding: 1rem;
}
.faq-title {
font-size: 2rem;
}
.faq-question {
padding: 1rem;
}
.faq-question h3 {
font-size: 1rem;
}
}
document.addEventListener('DOMContentLoaded', function() {
const toggle = document.getElementById('billing-toggle');
const amounts = document.querySelectorAll('.amount');
toggle.addEventListener('change', function() {
amounts.forEach(amount => {
if (this.checked) {
amount.textContent = amount.getAttribute('data-yearly');
} else {
amount.textContent = amount.getAttribute('data-monthly');
}
});
});
// Magnetic effect functionality
const faqItems = document.querySelectorAll('.faq-item[data-magnetic]');
faqItems.forEach(item => {
const question = item.querySelector('.faq-question');
// FAQ accordion functionality
question.addEventListener('click', () => {
const isActive = item.classList.contains('active');
// Close all other items
faqItems.forEach(otherItem => {
if (otherItem !== item) {
otherItem.classList.remove('active');
}
});
// Toggle current item
if (isActive) {
item.classList.remove('active');
} else {
item.classList.add('active');
}
});
// Magnetic attraction effect
const handleMouseMove = (e) => {
const rect = item.getBoundingClientRect();
const centerX = rect.left + rect.width / 2;
const centerY = rect.top + rect.height / 2;
const distanceX = e.clientX - centerX;
const distanceY = e.clientY - centerY;
const distance = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
const maxDistance = 200;
if (distance < maxDistance) {
const strength = 1 - (distance / maxDistance);
const moveX = (distanceX / maxDistance) * strength * 10;
const moveY = (distanceY / maxDistance) * strength * 10;
item.style.transform = `translate(${moveX}px, ${moveY}px)`;
item.classList.add('magnetic-active');
} else {
item.style.transform = 'translate(0, 0)';
item.classList.remove('magnetic-active');
}
};
const handleMouseLeave = () => {
item.style.transform = 'translate(0, 0)';
item.classList.remove('magnetic-active');
};
document.addEventListener('mousemove', handleMouseMove);
item.addEventListener('mouseleave', handleMouseLeave);
});
});