/* ============================================
   Enhanced Section Styling
   35% Inner & Outer Bevels + Animations
   ============================================ */

/* Base Section Overrides */
section {
    position: relative !important;
    margin: 4rem 0 !important;
    padding: 6rem 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* Remove old clip-paths for cleaner separation */
.insurance-types,
.how-it-works,
.comparison-preview,
.resources,
.testimonials,
.coverage-section,
.final-cta {
    clip-path: none !important;
    margin-top: 0 !important;
    padding-top: 6rem !important;
}

/* ============================================
   35% Bevel System - Inner & Outer
   ============================================ */

/* Outer Bevel - Top */
section::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 35% !important;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.15) 30%,
            transparent 100%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transform: none !important;
    border: none !important;
}

/* Outer Bevel - Bottom */
section::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 35% !important;
    background: linear-gradient(0deg,
            rgba(0, 0, 0, 0.08) 0%,
            rgba(0, 0, 0, 0.03) 30%,
            transparent 100%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transform: none !important;
    border: none !important;
}

/* Inner Bevel Container */
section>.container {
    position: relative;
}

section>.container::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: -1rem;
    right: -1rem;
    height: 35%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.25) 0%,
            transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Section-Specific Bevel Colors
   ============================================ */

/* White sections - subtle blue tint */
.insurance-types::before,
.comparison-preview::before,
.testimonials::before {
    background: linear-gradient(180deg,
            rgba(37, 99, 235, 0.08) 0%,
            rgba(37, 99, 235, 0.02) 35%,
            transparent 100%) !important;
}

/* Gray sections - warm highlight */
.how-it-works::before,
.resources::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 35%,
            transparent 100%) !important;
}

/* Dark sections - glow effect */
section[style*="background: var(--dark)"]::before,
section[style*="background: #000"]::before {
    background: linear-gradient(180deg,
            rgba(59, 130, 246, 0.15) 0%,
            rgba(59, 130, 246, 0.05) 35%,
            transparent 100%) !important;
}

/* ============================================
   Section Divider Lines
   ============================================ */

.insurance-types,
.how-it-works,
.comparison-preview,
.resources,
.testimonials {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Accent line at section start - uses transform for compositing */
.section-header::before {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-1);
    margin: 0 auto 2rem;
    border-radius: 2px;
    /* Use transform instead of width animation */
    animation: expandScale 0.8s ease-out;
    transform-origin: center;
}

/* Composited animation using transform */
@keyframes expandScale {
    from {
        transform: scaleX(0);
        opacity: 0;
    }

    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* ============================================
   Section Reveal Animations
   ============================================ */

/* Staggered fade-in for section content */
.section-header {
    animation: sectionFadeIn 0.8s ease-out;
}

.section-header h2 {
    animation: slideInFromBottom 0.6s ease-out 0.2s both;
}

.section-header p {
    animation: slideInFromBottom 0.6s ease-out 0.4s both;
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid item staggered animations */
.types-grid .type-card,
.comparison-grid .comparison-card,
.resources-grid .resource-card,
.testimonials-grid .testimonial-card {
    opacity: 0;
    animation: cardReveal 0.6s ease-out forwards;
}

.types-grid .type-card:nth-child(1) {
    animation-delay: 0.1s;
}

.types-grid .type-card:nth-child(2) {
    animation-delay: 0.2s;
}

.types-grid .type-card:nth-child(3) {
    animation-delay: 0.3s;
}

.types-grid .type-card:nth-child(4) {
    animation-delay: 0.4s;
}

.types-grid .type-card:nth-child(5) {
    animation-delay: 0.5s;
}

.types-grid .type-card:nth-child(6) {
    animation-delay: 0.6s;
}

.comparison-grid .comparison-card:nth-child(1) {
    animation-delay: 0.15s;
}

.comparison-grid .comparison-card:nth-child(2) {
    animation-delay: 0.3s;
}

.comparison-grid .comparison-card:nth-child(3) {
    animation-delay: 0.45s;
}

.testimonials-grid .testimonial-card:nth-child(1) {
    animation-delay: 0.1s;
}

.testimonials-grid .testimonial-card:nth-child(2) {
    animation-delay: 0.25s;
}

.testimonials-grid .testimonial-card:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Steps Animation (How it Works)
   ============================================ */

.steps-grid .step-card {
    opacity: 0;
    animation: stepReveal 0.7s ease-out forwards;
}

.steps-grid .step-card:nth-child(1) {
    animation-delay: 0.2s;
}

.steps-grid .step-card:nth-child(3) {
    animation-delay: 0.4s;
}

.steps-grid .step-card:nth-child(5) {
    animation-delay: 0.6s;
}

.step-connector {
    opacity: 0;
    width: 60px;
    /* Fixed width */
    transform-origin: left center;
    animation: connectorScale 0.5s ease-out forwards;
}

.steps-grid .step-connector:nth-child(2) {
    animation-delay: 0.35s;
}

.steps-grid .step-connector:nth-child(4) {
    animation-delay: 0.55s;
}

@keyframes stepReveal {
    from {
        opacity: 0;
        transform: translateY(30px) rotate(-3deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

/* Composited animation using transform */
@keyframes connectorScale {
    from {
        opacity: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* ============================================
   Floating Animation for Section Icons
   ============================================ */

.type-icon,
.step-icon {
    animation: gentleFloat 4s ease-in-out infinite;
}

.type-card:nth-child(odd) .type-icon {
    animation-delay: 0.5s;
}

.type-card:nth-child(even) .type-icon {
    animation-delay: 1s;
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ============================================
   Section Background Patterns
   ============================================ */

/* Subtle grid pattern for white sections */
.insurance-types,
.comparison-preview,
.testimonials {
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Dot pattern for gray sections */
.how-it-works,
.resources {
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ============================================
   Enhanced Section Shadows
   ============================================ */

.insurance-types {
    box-shadow:
        0 -20px 60px -20px rgba(37, 99, 235, 0.1),
        0 20px 60px -20px rgba(37, 99, 235, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.8),
        inset 0 -2px 0 rgba(0, 0, 0, 0.05) !important;
}

.how-it-works {
    box-shadow:
        inset 0 20px 40px -20px rgba(0, 0, 0, 0.08),
        inset 0 -20px 40px -20px rgba(0, 0, 0, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

.comparison-preview {
    box-shadow:
        0 30px 80px -30px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
}

.resources {
    box-shadow:
        inset 0 15px 30px -15px rgba(0, 0, 0, 0.06),
        inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

.testimonials {
    box-shadow:
        0 40px 100px -40px rgba(0, 0, 0, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 0.95) !important;
}

/* ============================================
   Scroll-Triggered Animations (JS Integration)
   ============================================ */

[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animation variants */
[data-animate="fade-up"].animated {
    animation: fadeUp 0.8s ease-out;
}

[data-animate="fade-left"].animated {
    animation: fadeLeft 0.8s ease-out;
}

[data-animate="fade-right"].animated {
    animation: fadeRight 0.8s ease-out;
}

[data-animate="scale-up"].animated {
    animation: scaleUp 0.6s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    section {
        margin: 2rem 0 !important;
        padding: 4rem 0 !important;
    }

    section::before,
    section::after {
        height: 25% !important;
    }

    .types-grid .type-card,
    .comparison-grid .comparison-card,
    .testimonials-grid .testimonial-card {
        animation-delay: 0s !important;
    }
}