/**
 * Enhanced How It Works Section
 * Creates a visually captivating experience for the How Our System Works section
 */

/* Main section styling with enhanced background */
.how-it-works-section {
    padding: var(--space-3xl) 0;
    background-color: var(--color-navy);
    position: relative;
    overflow: hidden;
}

/* Enhanced background elements */
.how-it-works-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(107, 92, 165, 0.1) 0%, rgba(107, 92, 165, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 8s ease-in-out infinite alternate;
}

.how-it-works-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(62, 219, 174, 0.08) 0%, rgba(62, 219, 174, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 10s 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 */
.how-it-works-section .section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.how-it-works-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    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;
}

/* Section subtitle styling */
.how-it-works-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);
}

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

/* Enhanced steps container with connected steps */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    position: relative;
    z-index: 1;
}

/* Add connecting lines between steps */
.steps-container::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 15%;
    width: 70%;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(62, 219, 174, 0.3),
        rgba(62, 219, 174, 0.7),
        rgba(62, 219, 174, 0.3));
    z-index: 0;
}

/* Enhanced step styling */
.step {
    background-color: rgba(26, 35, 50, 0.7);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(62, 219, 174, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(62, 219, 174, 0.3);
}

/* Enhanced step number */
.step-number {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(62, 219, 174, 0.1) 0%, rgba(62, 219, 174, 0.3) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-teal);
    margin-bottom: 25px;
    position: relative;
    border: 2px solid rgba(62, 219, 174, 0.3);
    box-shadow: 0 0 20px rgba(62, 219, 174, 0.2);
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(62, 219, 174, 0.4);
}

/* Pulsing animation for step numbers */
.step-number::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid rgba(62, 219, 174, 0.3);
    opacity: 0;
    animation: pulse-ring 2s 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;
    }
}

/* Enhanced step content */
.step h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: white;
    position: relative;
    display: inline-block;
}

.step h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: rgba(62, 219, 174, 0.5);
    transition: width 0.3s ease;
}

.step:hover h3::after {
    width: 60px;
}

.step p {
    color: var(--color-light-gray);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* Step icons */
.step-icon {
    margin-bottom: 20px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.step:hover .step-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Interactive elements */
.step-details {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.5s ease, opacity 0.5s ease;
    margin-top: 15px;
}

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

.step-details ul {
    text-align: left;
    padding-left: 20px;
    margin-bottom: 20px;
}

.step-details li {
    color: var(--color-light-gray);
    margin-bottom: 8px;
    position: relative;
}

.step-details li::before {
    content: '✓';
    color: var(--color-teal);
    position: absolute;
    left: -20px;
}

/* Enhanced CTA button */
.how-it-works-cta {
    text-align: center;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.how-it-works-cta .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.how-it-works-cta .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.how-it-works-cta .btn:hover::before {
    left: 100%;
}

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

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

.floating-element-2 {
    bottom: 15%;
    left: 8%;
    width: 150px;
    height: 150px;
    animation: float-slow 12s ease-in-out infinite alternate-reverse;
}

.floating-element-3 {
    top: 40%;
    left: 15%;
    width: 100px;
    height: 100px;
    animation: float-slow 10s ease-in-out infinite alternate;
}

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

/* Responsive styles */
@media (max-width: 992px) {
    .steps-container::before {
        display: none;
    }

    .step {
        margin-bottom: 30px;
    }

    .step:hover {
        transform: translateY(-5px);
    }
}

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

    .step {
        padding: 30px 20px;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

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

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .step h3 {
        font-size: 1.1rem;
    }
}
