@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --success: #10b981;
    --connector-length: 300px; /* Novo: Comprimento fixo para os conectores */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 70%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(99, 102, 241, 0.5);
    border-radius: 50%;
    animation: float 20s infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; top: 80%; animation-delay: 2s; }
.particle:nth-child(3) { left: 60%; top: 10%; animation-delay: 4s; }
.particle:nth-child(4) { left: 80%; top: 60%; animation-delay: 6s; }
.particle:nth-child(5) { left: 30%; top: 40%; animation-delay: 8s; }
.particle:nth-child(6) { left: 70%; top: 30%; animation-delay: 10s; }
.particle:nth-child(7) { left: 50%; top: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 90%; top: 40%; animation-delay: 14s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
}

.logo-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -2px;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    font-weight: 400;
    animation: fadeInDown 0.8s ease-out 0.4s both;
}

/* Hub Wrapper */
.hub-wrapper {
    perspective: 1500px;
    margin-bottom: 80px;
}

.hub-grid {
    position: relative;
    width: 100%;
    height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hub Central */
.hub-center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto; /* Centra o Hub perfeitamente */
    width: 240px;
    height: 240px;
    z-index: 10;
    animation: fadeInScale 1s ease-out 0.6s both;
}

.hub-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

.hub-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-light) 0%, #0f1729 100%);
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 60px rgba(99, 102, 241, 0.3),
        inset 0 0 40px rgba(99, 102, 241, 0.1);
    z-index: 2;
}

.hub-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 12px;
    animation: rotate3d 20s linear infinite;
}

.hub-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
}

.hub-label {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.hub-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--gray);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--success);
}

.hub-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    animation: rotate 30s linear infinite;
}

.hub-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
}

.hub-ring-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    border: 1px dashed rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    animation: rotate 40s linear infinite reverse;
}

/* Conectores (Novos) */
.connector {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--connector-length);
    height: 2px;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.5) 0%, transparent 100%);
    transform-origin: 0 50%; /* Rotação a partir do centro do Hub */
    z-index: 5;
    animation: drawLine 1s ease-out both;
}

/* Posicionamento e Rotação dos Conectores (7 pontos) */
/* Ângulo entre pontos: 360 / 7 = 51.43 graus */
/* Começando em 180 graus (esquerda) e girando no sentido anti-horário (positivo) */

.connector-1 { /* iFood - 180 graus */
    transform: rotate(180deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 0.8s;
}

.connector-2 { /* Rappi - 128.57 graus */
    transform: rotate(128.57deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 1s;
}

.connector-3 { /* Uber Eats - 77.14 graus */
    transform: rotate(77.14deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 1.2s;
}

.connector-4 { /* 99Food - 25.71 graus */
    transform: rotate(25.71deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 1.4s;
}

.connector-5 { /* AnotaAI - -25.71 graus */
    transform: rotate(-25.71deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 1.6s;
}

.connector-6 { /* Goomer - -77.14 graus */
    transform: rotate(-77.14deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 1.8s;
}

.connector-7 { /* Zé Delivery - -128.57 graus */
    transform: rotate(-128.57deg) translateX(calc(var(--connector-length) / 2));
    animation-delay: 2s;
}


/* Service Nodes */
.service-node {
    position: absolute;
    animation: fadeInScale 0.8s ease-out both;
    z-index: 6; /* Acima dos conectores */
}

/* Posicionamento dos Nodes (7 pontos) */
/* Raio = 300px, Offset do card = 80px (metade do 160px) */
/* Coordenadas calculadas para o centro do card */

.node-1 { /* iFood - 180 graus */
    top: calc(50% - 80px);
    left: calc(50% - 80px - var(--connector-length));
    animation-delay: 0.8s;
}

.node-2 { /* Rappi - 128.57 graus */
    top: calc(50% - 80px - 235px); /* 300 * sin(51.43) = 235 */
    left: calc(50% - 80px - 187px); /* 300 * cos(51.43) = 187 */
    animation-delay: 1s;
}

.node-3 { /* Uber Eats - 77.14 graus */
    top: calc(50% - 80px - 293px); /* 300 * sin(77.14) = 293 */
    left: calc(50% - 80px + 67px); /* 300 * cos(77.14) = 67 */
    animation-delay: 1.2s;
}

.node-4 { /* 99Food - 25.71 graus */
    top: calc(50% - 80px - 130px); /* 300 * sin(25.71) = 130 */
    left: calc(50% - 80px + 270px); /* 300 * cos(25.71) = 270 */
    animation-delay: 1.4s;
}

.node-5 { /* AnotaAI - -25.71 graus */
    top: calc(50% - 80px + 130px); /* 300 * sin(-25.71) = -130 */
    left: calc(50% - 80px + 270px); /* 300 * cos(-25.71) = 270 */
    animation-delay: 1.6s;
}

.node-6 { /* Goomer - -77.14 graus */
    top: calc(50% - 80px + 293px); /* 300 * sin(-77.14) = -293 */
    left: calc(50% - 80px + 67px); /* 300 * cos(-77.14) = 67 */
    animation-delay: 1.8s;
}

.node-7 { /* Zé Delivery - -128.57 graus */
    top: calc(50% - 80px + 235px); /* 300 * sin(-128.57) = -235 */
    left: calc(50% - 80px - 187px); /* 300 * cos(-128.57) = -187 */
    animation-delay: 2s;
}

/* Estilos dos Cards (Mantidos) */
.service-card {
    position: relative;
    width: 160px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.service-card:hover .card-glow {
    opacity: 1;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.service-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.icon-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
}

.service-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--light);
}

.service-status {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

/* Footer */
.footer {
    animation: fadeInUp 1s ease-out 2.4s both;
}

.footer-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    padding: 32px;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(99, 102, 241, 0.2);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes drawLine {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: var(--connector-length);
        opacity: 1;
    }
}

/* Responsividade */
@media (max-width: 1200px) {
    :root {
        --connector-length: 250px;
    }
    .hub-grid { height: 600px; }
    /* Coordenadas para 7 pontos com Raio=250px, Offset=80px */
    .node-1 { top: calc(50% - 80px); left: calc(50% - 80px - var(--connector-length)); } /* iFood - 180 graus */
    .node-2 { top: calc(50% - 80px - 196px); left: calc(50% - 80px - 156px); } /* Rappi - 128.57 graus */
    .node-3 { top: calc(50% - 80px - 244px); left: calc(50% - 80px + 56px); } /* Uber Eats - 77.14 graus */
    .node-4 { top: calc(50% - 80px - 108px); left: calc(50% - 80px + 225px); } /* 99Food - 25.71 graus */
    .node-5 { top: calc(50% - 80px + 108px); left: calc(50% - 80px + 225px); } /* AnotaAI - -25.71 graus */
    .node-6 { top: calc(50% - 80px + 244px); left: calc(50% - 80px + 56px); } /* Goomer - -77.14 graus */
    .node-7 { top: calc(50% - 80px + 196px); left: calc(50% - 80px - 156px); } /* Zé Delivery - -128.57 graus */
}

@media (max-width: 992px) {
    :root {
        --connector-length: 200px;
    }
    .title { font-size: 4rem; }
    .hub-grid { height: 550px; }
    .hub-center { width: 200px; height: 200px; }
    .hub-icon { width: 48px; height: 48px; }
    .service-card { width: 140px; padding: 20px; }
    .service-icon { width: 60px; height: 60px; }
    /* Coordenadas para 7 pontos com Raio=200px, Offset=70px */
    .node-1 { top: calc(50% - 70px); left: calc(50% - 70px - var(--connector-length)); } /* iFood - 180 graus */
    .node-2 { top: calc(50% - 70px - 157px); left: calc(50% - 70px - 125px); } /* Rappi - 128.57 graus */
    .node-3 { top: calc(50% - 70px - 195px); left: calc(50% - 70px + 45px); } /* Uber Eats - 77.14 graus */
    .node-4 { top: calc(50% - 70px - 86px); left: calc(50% - 70px + 180px); } /* 99Food - 25.71 graus */
    .node-5 { top: calc(50% - 70px + 86px); left: calc(50% - 70px + 180px); } /* AnotaAI - -25.71 graus */
    .node-6 { top: calc(50% - 70px + 195px); left: calc(50% - 70px + 45px); } /* Goomer - -77.14 graus */
    .node-7 { top: calc(50% - 70px + 157px); left: calc(50% - 70px - 125px); } /* Zé Delivery - -128.57 graus */
}

@media (max-width: 768px) {
    :root {
        --connector-length: 150px;
    }
    .title { font-size: 3rem; }
    .subtitle { font-size: 1rem; }
    .hub-grid { height: 500px; }
    .hub-center { width: 160px; height: 160px; }
    .hub-icon { width: 40px; height: 40px; }
    .hub-label { font-size: 1.2rem; }
    .service-card { width: 120px; padding: 16px; }
    .service-icon { width: 50px; height: 50px; }
    .icon-text { font-size: 1.4rem; }
    .service-name { font-size: 0.95rem; }
    /* Coordenadas para 7 pontos com Raio=150px, Offset=60px */
    .node-1 { top: calc(50% - 60px); left: calc(50% - 60px - var(--connector-length)); } /* iFood - 180 graus */
    .node-2 { top: calc(50% - 60px - 118px); left: calc(50% - 60px - 94px); } /* Rappi - 128.57 graus */
    .node-3 { top: calc(50% - 60px - 146px); left: calc(50% - 60px + 34px); } /* Uber Eats - 77.14 graus */
    .node-4 { top: calc(50% - 60px - 65px); left: calc(50% - 60px + 135px); } /* 99Food - 25.71 graus */
    .node-5 { top: calc(50% - 60px + 65px); left: calc(50% - 60px + 135px); } /* AnotaAI - -25.71 graus */
    .node-6 { top: calc(50% - 60px + 146px); left: calc(50% - 60px + 34px); } /* Goomer - -77.14 graus */
    .node-7 { top: calc(50% - 60px + 118px); left: calc(50% - 60px - 94px); } /* Zé Delivery - -128.57 graus */
    .footer-stats { gap: 24px; padding: 24px; }
    .stat-value { font-size: 1.5rem; }
}

@media (max-width: 576px) {
    :root {
        --connector-length: 100px;
    }
    .title { font-size: 2.5rem; }
    .hub-grid { height: 450px; }
    .hub-center { width: 140px; height: 140px; }
    .service-card { width: 100px; padding: 12px; }
    .service-icon { width: 44px; height: 44px; }
    .icon-text { font-size: 1.2rem; }
    .service-name { font-size: 0.85rem; }
    /* Coordenadas para 7 pontos com Raio=100px, Offset=50px */
    .node-1 { top: calc(50% - 50px); left: calc(50% - 50px - var(--connector-length)); } /* iFood - 180 graus */
    .node-2 { top: calc(50% - 50px - 79px); left: calc(50% - 50px - 63px); } /* Rappi - 128.57 graus */
    .node-3 { top: calc(50% - 50px - 97px); left: calc(50% - 50px + 23px); } /* Uber Eats - 77.14 graus */
    .node-4 { top: calc(50% - 50px - 43px); left: calc(50% - 50px + 90px); } /* 99Food - 25.71 graus */
    .node-5 { top: calc(50% - 50px + 43px); left: calc(50% - 50px + 90px); } /* AnotaAI - -25.71 graus */
    .node-6 { top: calc(50% - 50px + 97px); left: calc(50% - 50px + 23px); } /* Goomer - -77.14 graus */
    .node-7 { top: calc(50% - 50px + 79px); left: calc(50% - 50px - 63px); } /* Zé Delivery - -128.57 graus */
    .footer-stats { flex-direction: column; gap: 16px; }
    .stat-divider { width: 100%; height: 1px; }
}
