/**
 * Trust Mechanism Section
 * Stripe-inspired grid-based flow visualization
 * Clean, minimal, with flowing line animations
 */

/* ============================================
   Section Base
   ============================================ */
.trust-section {
    position: relative;
    padding: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 50%, #ffffff 100%);
    overflow: hidden;
}

.trust-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Background Decoration */
.trust-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.trust-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 1;
}

.trust-orb-1 {
    top: 20%;
    left: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(1, 122, 202, 0.08) 0%, transparent 70%);
}

.trust-orb-2 {
    bottom: 20%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 150, 229, 0.06) 0%, transparent 70%);
}

/* ============================================
   Header
   ============================================ */
.trust-header {
    text-align: center;
    margin-bottom: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.trust-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trust-description {
    font-size: 1.125rem;
    color: #475569;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   Flow Diagram
   ============================================ */
.flow-diagram-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* SVG Grid */
.flow-grid {
    width: 100%;
    height: auto;
    display: block;
}

/* Grid Lines - Subtle background grid */
.grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
    opacity: 0.3;
}

/* Flow Paths - Animated lines */
.flow-path {
    fill: none;
    stroke: #017ACA;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
    filter: drop-shadow(0 0 4px rgba(1, 122, 202, 0.3));
}

/* ============================================
   Flow Elements (Nodes)
   ============================================ */
.flow-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.flow-element {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-element.visible {
    opacity: 1;
}

/* Element Icons */
.element-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
}

.element-icon i {
    font-size: 1.25rem;
    color: #64748b;
}

.element-icon--success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
}

.element-icon--success i {
    color: white;
}

.flow-element:hover .element-icon {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* Element Labels */
.element-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    text-align: center;
}

.element-sublabel {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    text-align: center;
}

/* ============================================
   Mirian Hub (Center)
   ============================================ */
.element-mirian {
    z-index: 10;
}

.mirian-hub {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hub-logo {
    width: 50px;
    height: auto;
    position: relative;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pulsing rings around hub */
.hub-pulse {
    position: absolute;
    inset: -8px;
    border: 2px solid #017ACA;
    border-radius: 24px;
    opacity: 0;
    animation: none;
    pointer-events: none;
}

.pulse-delay-1 {
    animation-delay: 0.2s;
}

.pulse-delay-2 {
    animation-delay: 0.4s;
}

@keyframes hubPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Stripe-Inspired Subtle Impact Animation */
.element-mirian.mirian-impact .mirian-hub {
    animation: mirianImpact 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.element-mirian.mirian-impact .hub-logo {
    animation: logoReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.element-mirian.mirian-impact .hub-pulse {
    animation: hubPulse 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mirianImpact {
    0% {
        transform: scale(0.92);
        opacity: 0;
        box-shadow: 
            0 0 0 8px rgba(1, 122, 202, 0.08),
            0 4px 16px rgba(15, 23, 42, 0);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 
            0 0 0 0 rgba(1, 122, 202, 0),
            0 4px 16px rgba(15, 23, 42, 0.1);
    }
}

@keyframes logoReveal {
    0% {
        transform: scale(0.92);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.element-mirian .element-label {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.element-mirian .element-sublabel {
    font-size: 0.875rem;
    color: #017ACA;
    font-weight: 600;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.element-mirian.mirian-impact .element-label,
.element-mirian.mirian-impact .element-sublabel {
    animation: labelFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes labelFadeIn {
    0% {
        transform: translateY(4px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   Principle Cards
   ============================================ */
.trust-principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 2rem;
    align-items: center;
}

.principle-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.principle-card:nth-child(1),
.principle-card:nth-child(3) {
    transform: scale(0.97);
    z-index: 1;
}

.principle-card:nth-child(2) {
    z-index: 10;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    border-color: #017ACA;
}

.principle-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.principle-icon i {
    font-size: 1.5rem;
    color: white;
}

.principle-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.principle-text {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Animation Classes
   ============================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .trust-section {
        padding: 1rem 0;
    }

    .trust-container {
        padding: 0 1.5rem;
    }

    .trust-header {
        margin-bottom: 1rem;
    }

    .trust-title {
        font-size: 1.75rem;
    }

    .trust-description {
        font-size: 1rem;
    }

    /* Hide animation on mobile */
    .flow-diagram-container {
        display: none;
    }

    .trust-principles {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }

    .principle-card {
        padding: 1.5rem;
    }

    .principle-card:nth-child(1),
    .principle-card:nth-child(3) {
        transform: scale(1);
    }

    .principle-card:nth-child(2) {
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }
}

@media (max-width: 480px) {
    /* Animation already hidden at 768px */
}
