.features {
    padding: 80px 20px;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 50%);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -1px;
    animation: fadeInDown 0.8s ease;
    line-height: 1.2;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease;
    padding: 0 10px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 35px 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    animation: fadeInScale 0.8s ease backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.8s ease;
    transform: scale(0);
}

.feature-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.feature-icon {
    font-size: clamp(2.5rem, 8vw, 4rem);
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-2deg); }
    75% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

.icon-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(80px, 20vw, 120px);
    height: clamp(80px, 20vw, 120px);
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.2));
    border-radius: 50%;
    z-index: 1;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.2;
    }
}

.feature-card h3 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    margin-bottom: 20px;
}

.feature-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease;
}

.stat {
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.stat strong {
    display: block;
    color: #667eea;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 800;
    margin-top: 5px;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.feature-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
}

.cta-section {
    text-align: center;
    margin-top: 50px;
    animation: fadeInUp 1s ease;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    transition: all 0.4s ease;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        0 0 60px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    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, height 0.6s;
}

.cta-button span {
    position: relative;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(var(--tx), var(--ty)); }
}

/* Desktop hover effects */
@media (hover: hover) and (pointer: fine) {
    .feature-card:hover {
        transform: translateY(-12px) scale(1.02);
        border-color: rgba(102, 126, 234, 0.5);
        box-shadow: 
            0 20px 60px rgba(102, 126, 234, 0.3),
            0 0 80px rgba(102, 126, 234, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .feature-card:hover::before {
        opacity: 1;
    }

    .feature-card:hover::after {
        opacity: 1;
        transform: scale(1);
    }

    .feature-card:hover .feature-icon {
        animation: floatBounce 0.6s ease;
    }

    .feature-card:hover .feature-stats {
        opacity: 1;
        transform: translateY(0);
    }

    .feature-card:hover .feature-badge {
        opacity: 1;
        transform: scale(1);
    }

    .cta-button:hover::before {
        width: 300px;
        height: 300px;
    }

    .cta-button:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 
            0 15px 40px rgba(102, 126, 234, 0.6),
            0 0 80px rgba(102, 126, 234, 0.3);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .features {
        padding: 60px 15px;
    }

    .section-title {
        letter-spacing: -0.5px;
    }

    .section-subtitle {
        margin-bottom: 40px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    /* Show stats and badges on mobile by default */
    .feature-stats {
        opacity: 1;
        transform: translateY(0);
    }

    .feature-badge {
        opacity: 1;
        transform: scale(1);
    }

    /* Tap feedback for mobile */
    .feature-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .cta-button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

@media (max-width: 480px) {
    .features {
        padding: 50px 10px;
    }

    .container {
        padding: 0 10px;
    }

    .feature-card {
        padding: 25px 18px;
    }

    .cta-button {
        padding: 14px 35px;
        width: 100%;
        max-width: 300px;
    }
}