/* ==========================================
   APPLE-STYLE INTEGRATION SECTION
   Premium, Minimalist, Elegant Design
   Brand Colors: #f8931e (Orange), #393c98 (Blue)
   ========================================== */

:root {
    --apple-orange: #f8931e;
    --apple-blue: #393c98;
    --apple-gray: #1d1d1f;
    --apple-light: #f5f5f7;
    --apple-border: rgba(0, 0, 0, 0.06);
    --apple-shadow: rgba(0, 0, 0, 0.08);
}

.ai-integration-section {
    padding: 80px 0 90px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Subtle Background Pattern - Apple Style */
.ai-integration-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(248, 147, 30, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(57, 60, 152, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* ==========================================
   HEADER - APPLE MINIMALISM
   ========================================== */

.ai-header {
    max-width: 800px;
    margin: 0 auto 70px;
    text-align: center;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(248, 147, 30, 0.08);
    border: 1px solid rgba(248, 147, 30, 0.15);
    color: var(--apple-orange);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(248, 147, 30, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 147, 30, 0.12);
}

.ai-badge svg {
    width: 13px;
    height: 13px;
}

.ai-title {
    font-size: 48px;
    font-weight: 600;
    color: var(--apple-gray);
    margin: 20px 0 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, #f8931e 0%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ==========================================
   NETWORK VISUALIZATION - PREMIUM GLASS
   ========================================== */

.network-visual {
    position: relative;
    max-width: 1400px;
    height: 350px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 40px;
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 40px;
}

.ai-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   NETWORK COLUMNS - CLEAN LAYOUT
   ========================================== */

.network-col {
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.col-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: rgba(57, 60, 152, 0.05);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--apple-blue);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 16px;
}

.col-label svg {
    color: var(--apple-blue);
    width: 14px;
    height: 14px;
}

/* ==========================================
   NODES - APPLE CARD DESIGN WITH CAROUSEL
   ========================================== */

.nodes-list-wrapper {
    position: relative;
    overflow: hidden;
    height: 280px;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
}

.nodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.carriers-carousel,
.platforms-carousel {
    animation: carouselScroll 25s linear infinite;
}

.carriers-carousel:hover,
.platforms-carousel:hover {
    animation-play-state: paused;
}

@keyframes carouselScroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(-1 * (var(--item-height, 54px) * var(--items-count, 6) + 12px * var(--items-count, 6))));
    }
}

.node-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02);
}

.carriers-col .node-item {
    flex-direction: row;
}

.platforms-col .node-item {
    flex-direction: row-reverse;
}

.node-item:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(248, 147, 30, 0.2);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(248, 147, 30, 0.1),
        0 0 0 1px rgba(248, 147, 30, 0.1);
}

.carriers-col .node-item:hover {
    transform: translateY(-3px) translateX(-4px) scale(1.02);
}

.platforms-col .node-item:hover {
    transform: translateY(-3px) translateX(4px) scale(1.02);
}

.node-logo {
    width: 52px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 4px;
}

.node-logo svg,
.node-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-item:hover .node-logo img {
    transform: scale(1.05);
}

.node-item span {
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-gray);
    letter-spacing: -0.01em;
}

.node-tag {
    position: absolute;
    top: -6px;
    right: 10px;
    padding: 3px 9px;
    background: linear-gradient(135deg, var(--apple-orange) 0%, #ff8533 100%);
    color: white;
    font-size: 8px;
    font-weight: 700;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    box-shadow: 
        0 2px 8px rgba(248, 147, 30, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.platforms-col .node-tag {
    right: auto;
    left: 10px;
}

/* ==========================================
   AI HUB - PREMIUM CENTER PIECE
   ========================================== */

.ai-hub {
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.hub-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.core-visual {
    position: relative;
    width: 110px;
    height: 110px;
}

.ai-rings {
    position: absolute;
    inset: 0;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid;
    animation: rotate 30s linear infinite;
    opacity: 0.6;
}

.r1 {
    inset: 0;
    border-color: var(--apple-orange);
    border-style: solid;
    opacity: 0.15;
}

.r2 {
    inset: -18px;
    border-color: var(--apple-blue);
    animation-duration: 45s;
    border-style: solid;
    opacity: 0.12;
}

.r3 {
    inset: -36px;
    border-color: var(--apple-orange);
    animation-duration: 60s;
    border-style: dashed;
    opacity: 0.08;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-center {
    position: absolute;
    inset: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px rgba(248, 147, 30, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.ai-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-pulse {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 147, 30, 0.15) 0%, transparent 70%);
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.hub-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-gray);
    text-align: center;
    letter-spacing: -0.02em;
}

/* ==========================================
   AI PROCESS - CLEAN BADGES
   ========================================== */

.ai-process {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 14px;
}

.process-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(248, 147, 30, 0.08);
    border: 1px solid rgba(248, 147, 30, 0.15);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #d17a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.process-item:hover {
    background: rgba(248, 147, 30, 0.12);
    transform: translateY(-1px);
    border-color: rgba(248, 147, 30, 0.25);
}

.process-item svg {
    color: var(--apple-orange);
    width: 15px;
    height: 15px;
}

/* ==========================================
   CODE PREVIEW - APPLE TERMINAL STYLE
   ========================================== */

.code-preview {
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a1c 0%, #1d1d1f 100%);
    border-radius: 12px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.8;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.5);
}

.code-line {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.code-result {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.p { color: #f8931e; font-weight: 700; text-shadow: 0 0 8px rgba(248, 147, 30, 0.3); }
.c { color: #64d2ff; font-weight: 500; }
.o { color: #b8b8b8; }
.s { color: #5dd39e; font-weight: 600; }
.h { color: #f8931e; font-weight: 700; text-shadow: 0 0 8px rgba(248, 147, 30, 0.3); }

.carrier-name-dynamic {
    color: #ffd60a;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 214, 10, 0.4);
}

.price-dynamic {
    color: #5dd39e;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(93, 211, 158, 0.3);
}

.time-dynamic {
    color: #9e9ea3;
    font-size: 10px;
}

/* ==========================================
   NODE PULSE ANIMATION
   ========================================== */

.node-item.pulse-active {
    animation: nodePulse 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.04),
            0 1px 2px rgba(0, 0, 0, 0.02);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 
            0 8px 20px rgba(248, 147, 30, 0.15),
            0 4px 8px rgba(0, 0, 0, 0.08),
            0 0 0 2px rgba(248, 147, 30, 0.1);
    }
}

/* ==========================================
   DATA FLOW - ELEGANT PARTICLES
   ========================================== */

.data-flow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.packet {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, var(--apple-orange), #ff8533);
    border-radius: 50%;
    box-shadow: 
        0 0 8px rgba(248, 147, 30, 0.6),
        0 0 16px rgba(248, 147, 30, 0.3);
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

/* ==========================================
   METRICS ROW - APPLE CARDS
   ========================================== */

.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 60px auto 0;
}

.metric {
    text-align: center;
    padding: 28px 20px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02);
}

.metric:hover {
    transform: translateY(-6px);
    border-color: rgba(248, 147, 30, 0.15);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(248, 147, 30, 0.08),
        0 0 0 1px rgba(248, 147, 30, 0.08);
}

.m-val {
    font-size: 36px;
    font-weight: 600;
    color: var(--apple-gray);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--apple-gray) 0%, #333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.m-val span {
    font-size: 22px;
}

.m-lbl {
    font-size: 11px;
    color: #86868b;
    font-weight: 500;
    text-transform: none;
    letter-spacing: -0.01em;
}

/* ==========================================
   RESPONSIVE DESIGN - APPLE ADAPTIVE
   ========================================== */

@media (max-width: 1200px) {
    .network-visual {
        grid-template-columns: 220px 1fr 220px;
        gap: 30px;
    }
    
    .node-logo {
        width: 48px;
        height: 30px;
        padding: 3px;
    }
}

@media (max-width: 992px) {
    .ai-integration-section {
        padding: 60px 0;
    }
    
    .ai-title {
        font-size: 38px;
    }
    
    .network-visual {
        grid-template-columns: 1fr;
        height: auto;
        gap: 30px;
        padding: 30px 25px;
    }
    
    .ai-hub {
        order: 2;
    }
    
    .carriers-col {
        order: 1;
    }
    
    .platforms-col {
        order: 3;
    }
    
    .nodes-list-wrapper {
        mask-image: none;
        -webkit-mask-image: none;
    }
    
    .carriers-carousel,
    .platforms-carousel {
        animation: none;
    }
    
    .nodes-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .node-item {
        flex: 0 0 calc(33.333% - 7px);
    }
    
    .ai-canvas {
        display: none;
    }
    
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .ai-integration-section {
        padding: 50px 0;
    }
    
    .ai-header {
        margin-bottom: 50px;
    }
    
    .ai-title {
        font-size: 32px;
    }
    
    .network-visual {
        padding: 25px 20px;
    }
    
    .node-item {
        flex: 0 0 calc(50% - 5px);
        padding: 8px 12px;
    }
    
    .node-logo {
        width: 44px;
        height: 28px;
        padding: 3px;
    }
    
    .node-item span {
        font-size: 11px;
    }
    
    .core-visual {
        width: 90px;
        height: 90px;
    }
    
    .ai-center {
        inset: 15px;
    }
    
    .code-preview {
        padding: 12px 14px;
        font-size: 10px;
    }
    
    .nodes-list-wrapper {
        height: 240px;
    }
    
    .m-val {
        font-size: 32px;
    }
    
    .metric {
        padding: 24px 16px;
    }
}

@media (max-width: 576px) {
    .ai-integration-section {
        padding: 40px 0;
    }
    
    .ai-title {
        font-size: 28px;
    }
    
    .network-visual {
        padding: 20px 15px;
        border-radius: 20px;
    }
    
    .node-item {
        flex: 0 0 100%;
    }
    
    .nodes-list-wrapper {
        height: auto;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .metric {
        padding: 20px 15px;
    }
    
    .m-val {
        font-size: 28px;
    }
}

/* ==========================================
   APPLE-STYLE TRANSITIONS
   Smooth, Natural, Delightful
   ========================================== */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ai-integration-section * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
