/**
 * Enhanced Features Section
 * Creates a visually captivating experience for the "Why Choose Our Nutrition System" section
 */

/* Main section styling with enhanced background */
.features-section {
    padding: var(--space-3xl) 0;
    background-color: var(--color-navy);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(62, 219, 174, 0.1);
    border-bottom: 1px solid rgba(62, 219, 174, 0.1);
}

/* Enhanced background elements */
.features-section::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(62, 219, 174, 0.05) 0%, rgba(62, 219, 174, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 10s ease-in-out infinite alternate;
}

.features-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 60%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(107, 92, 165, 0.05) 0%, rgba(107, 92, 165, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 12s ease-in-out infinite alternate-reverse;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Section title with animated underline */
.features-section .section-title {
    position: relative;
    text-align: center;
    margin-bottom: 15px;
}

.features-section .section-subtitle {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 25px; /* Increased margin-top to avoid overlap with title underline */
    margin-bottom: 40px;
    color: var(--color-light-gray);
}

.features-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -15px; /* Increased distance from title text */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-teal), transparent);
    animation: expand-line 1.5s ease-out forwards;
}

@keyframes expand-line {
    0% {
        width: 0;
    }
    100% {
        width: 100px;
    }
}

/* Enhanced features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Enhanced feature card */
.feature-card {
    background-color: rgba(18, 31, 47, 0.7);
    border-radius: 16px;
    padding: 40px 30px;
    border: 1px solid rgba(62, 219, 174, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card hover effect */
.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(62, 219, 174, 0.3);
}

/* Card background gradient */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(62, 219, 174, 0.08) 0%, transparent 100%);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

/* Card highlight effect */
.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(62, 219, 174, 0.1) 0%, transparent 30%);
    opacity: 0;
    z-index: -1;
    transform: scale(0.5);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.feature-card:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Enhanced feature icon */
.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(62, 219, 174, 0.1) 0%, rgba(62, 219, 174, 0.2) 100%);
    border-radius: 50%;
    margin-bottom: 25px;
    position: relative;
    border: 2px solid rgba(62, 219, 174, 0.2);
    box-shadow: 0 0 20px rgba(62, 219, 174, 0.1);
    transition: all 0.4s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(62, 219, 174, 0.2);
}

/* Pulsing animation for feature icons */
.feature-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid rgba(62, 219, 174, 0.2);
    opacity: 0;
    animation: pulse-ring 3s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Feature icon SVG */
.feature-icon svg {
    width: 32px;
    height: 32px;
    transition: all 0.4s ease;
}

.feature-card:hover .feature-icon svg {
    transform: scale(1.1);
}

.feature-icon svg path,
.feature-icon svg circle,
.feature-icon svg line,
.feature-icon svg polyline {
    stroke-width: 2;
    transition: all 0.4s ease;
}

.feature-card:hover .feature-icon svg path,
.feature-card:hover .feature-icon svg circle,
.feature-card:hover .feature-icon svg line,
.feature-card:hover .feature-icon svg polyline {
    stroke: #ffffff;
}

/* Feature content */
.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    position: relative;
    display: inline-block;
}

.feature-card h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: rgba(62, 219, 174, 0.5);
    transition: width 0.4s ease;
}

.feature-card:hover h3::after {
    width: 100%;
}

.feature-card p {
    color: var(--color-light-gray);
    line-height: 1.7;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

/* Feature details */
.feature-details {
    margin-top: 20px;
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.5s ease, opacity 0.5s ease;
}

.feature-card:hover .feature-details {
    height: auto;
    opacity: 1;
}

.feature-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.feature-details li {
    color: var(--color-light-gray);
    margin-bottom: 10px;
    position: relative;
    padding-left: 28px;
}

.feature-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-color: rgba(62, 219, 174, 0.1);
    border-radius: 50%;
}

.feature-details li::after {
    content: '✓';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-teal);
    font-size: 10px;
}

/* Floating elements */
.features-floating-element {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(62, 219, 174, 0.03);
    filter: blur(30px);
    z-index: 0;
}

.features-floating-element-1 {
    top: 15%;
    right: 10%;
    width: 300px;
    height: 300px;
    animation: float-slow 20s ease-in-out infinite alternate;
}

.features-floating-element-2 {
    bottom: 20%;
    left: 5%;
    width: 250px;
    height: 250px;
    animation: float-slow 15s ease-in-out infinite alternate-reverse;
}

.features-floating-element-3 {
    top: 50%;
    left: 20%;
    width: 150px;
    height: 150px;
    animation: float-slow 12s ease-in-out infinite alternate;
}

@keyframes float-slow {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(30px, -30px) rotate(15deg);
    }
}

/* Responsive styles */
@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .feature-card {
        padding: 30px 25px;
    }

    .feature-icon {
        width: 70px;
        height: 70px;
    }

    .feature-card h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .features-section {
        padding: 80px 0;
    }

    .feature-card {
        padding: 25px 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
    }

    .feature-icon svg {
        width: 28px;
        height: 28px;
    }

    .feature-card h3 {
        font-size: 1.2rem;
    }

    .feature-card p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .features-section {
        padding: 60px 0;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
    }

    .feature-icon svg {
        width: 24px;
        height: 24px;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }
}
