/* ============================================================
   SERVIÇOS | css/servicos.css
   Sistema solar orbital com UX aprimorado
   ============================================================ */

#servicos {
    background: radial-gradient(ellipse at center, #14142B 0%, var(--bg-main) 70%);
    position: relative;
    overflow: hidden;
    padding: 120px 0 160px;
}

.servicos-header {
    position: relative;
    z-index: 20;
    margin-bottom: 80px;
}

/* ─── Wrapper principal ─── */
.solar-system-wrapper {
    position: relative;
    height: 720px;
    width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ─── Anéis orbitais (visuais) ─── */
.orbit-circles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Órbita interna (próxima ao centro) */
.orbit-circle-inner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 1px dashed rgba(99, 102, 241, 0.35);
    border-radius: 50%;
}

/* Órbita intermediária (onde orbitam os cards) */
.orbit-circle-1 {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 430px;
    height: 430px;
    border: 1px dashed rgba(123, 97, 255, 0.20);
    border-radius: 50%;
}

/* Órbita externa (borda decorativa) */
.orbit-circle-2 {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 720px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

/* ─── Núcleo central ─── */
.solar-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.center-core {
    width: 120px;
    height: 120px;
    background: rgba(8, 8, 18, 0.96);
    border: 1.5px solid var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 2;
    position: relative;
    box-shadow:
        0 0 0 8px rgba(99, 102, 241, 0.06),
        0 0 40px var(--primary-glow-strong);
    backdrop-filter: blur(8px);
}

/* SVG hexagonal do centro */
.center-svg {
    width: 52px;
    height: 52px;
    animation: rotateCenter 18s linear infinite;
    filter: drop-shadow(0 0 6px var(--primary));
}

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

.center-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fff;
    white-space: nowrap;
}

.center-glow {
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow-strong) 0%, transparent 70%);
    animation: pulseCenter 4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulseCenter {
    0%, 100% { transform: scale(0.85); opacity: 0.35; }
    50%       { transform: scale(1.15); opacity: 0.75; }
}

/* ─── Órbita interna: mini-esferas ─── */
.inner-orbit-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    animation: rotateInner 12s linear infinite;
    z-index: 8;
    pointer-events: none;
}

/* Counter-rotate para as esferas ficarem upright */
.inner-orb {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow-strong), 0 0 20px var(--primary-glow);
    animation: counterInner 12s linear infinite;
    top: 50%; left: 50%;
}

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

/* Posições das 3 mini-esferas na órbita interna (r=95px) */
.inner-orb--1 { margin-top: -100px; margin-left: -5px; }
.inner-orb--2 {
    margin-top:  28px;
    margin-left: 78px;
    width: 8px; height: 8px;
    background: var(--accent-purple);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.6);
}
.inner-orb--3 {
    margin-top:  28px;
    margin-left: -88px;
    width: 6px; height: 6px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.5);
    animation: counterInner 12s linear infinite;
}

/* ─── Órbita dos cards (rotação lenta para legibilidade) ─── */
.solar-items {
    position: absolute;
    inset: 0;
    animation: rotateOrbit 80s linear infinite; /* ← mais lento */
    z-index: 5;
}

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

/* Pausa ao hover no centro */
.solar-center:hover ~ .solar-items,
.solar-center:hover ~ .solar-items .solar-card {
    animation-play-state: paused;
}

/* ─── Feixes de energia ─── */
.solar-beam {
    position: absolute;
    top: 50%; left: 50%;
    height: 1.5px;
    width: 215px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transform-origin: 0 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.beam-1 { transform: rotate(-90deg); }
.beam-2 { transform: rotate(-18deg); }
.beam-3 { transform: rotate(54deg); }
.beam-4 { transform: rotate(126deg); }
.beam-5 { transform: rotate(198deg); }

.solar-card:hover ~ .solar-beam,
.solar-center:hover ~ .solar-items .solar-beam {
    opacity: 0.6;
}

/* ─── Cards orbitais (esferas menores para legibilidade) ─── */
.solar-card {
    position: absolute;
    width: 150px;
    height: 150px;
    padding: 16px;
    background: rgba(12, 12, 22, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    animation: counterRotate 80s linear infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

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

.solar-card:hover {
    border-color: var(--primary);
    background: rgba(16, 16, 32, 0.98);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.12),
        0 0 40px var(--primary-glow-strong);
    z-index: 50;
}

/* ─── Posições na órbita (raio ~215px, centrado em 360x360) ─── */
/* pos: topo/esquerda relativo ao topo-esquerda do wrapper (720x720)  */
/* centro do wrapper = 360,360. raio = 215                            */
/* angle: 270°(-90°), 342°(-18°), 54°, 126°, 198°                   */
.pos-1 { top: 50%; left: 50%; margin-top: -290px; margin-left: -75px; }  /* top    */
.pos-2 { top: 50%; left: 50%; margin-top: -130px; margin-left: 140px; }  /* top-right */
.pos-3 { top: 50%; left: 50%; margin-top:  110px; margin-left:  75px; }  /* bottom-right */
.pos-4 { top: 50%; left: 50%; margin-top:  110px; margin-left: -225px; } /* bottom-left */
.pos-5 { top: 50%; left: 50%; margin-top: -130px; margin-left: -290px; } /* top-left */

/* ─── Conteúdo dos cards ─── */
.solar-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Icon box: apenas o SVG sem bordas extras */
.solar-card .icon-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: transform 0.3s ease, filter 0.3s ease;
    flex-shrink: 0;
}

.solar-card .icon-box svg {
    width: 100%;
    height: 100%;
}

.solar-card:hover .icon-box {
    transform: scale(1.12);
    filter: drop-shadow(0 0 8px var(--primary));
}

.solar-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0;
}

/* ─── Tooltips de Benefícios ─── */
.solar-benefit {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 240px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--primary);
    border-radius: 12px;
    font-size: 1.3rem;
    color: var(--text-main);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px var(--primary-glow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
    pointer-events: none;
}

.solar-benefit::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
}

.solar-card.active .solar-benefit {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ─── Responsividade ─── */
@media (max-width: 1024px) {
    #servicos {
        padding-bottom: 80px;
    }

    .solar-system-wrapper {
        height: auto;
        width: 100%;
        display: block;
        margin-top: 0;
    }

    .orbit-circles,
    .solar-center,
    .inner-orbit-ring,
    .solar-beam {
        display: none !important;
    }

    .solar-items {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        animation: none;
        width: 100%;
        height: auto;
    }

    .solar-card {
        position: relative;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        width: 100%;
        height: auto;
        min-height: 140px;
        animation: none;
        transform: none !important;
        border-radius: 2rem !important;
        padding: 32px 24px;
        background: var(--bg-secondary) !important;
    }

    .solar-card:hover {
        transform: translateY(-4px) !important;
    }

    .solar-card h3 {
        font-size: 1.6rem;
    }

    .solar-card .icon-box {
        width: 48px;
        height: 48px;
        margin-bottom: 4px;
    }

    .solar-benefit {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin-top: 12px;
        padding: 12px;
        border-color: rgba(99, 102, 241, 0.3);
        box-shadow: none;
        display: none;
    }
    
    .solar-benefit::after {
        display: none;
    }
    
    .solar-card.active .solar-benefit {
        display: block;
        transform: none;
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 600px) {
    .solar-items {
        grid-template-columns: 1fr;
    }
}
