/**
 * MAXTEM COSMOS — playground espacial (site dentro do site)
 * Editável via página com template "Cosmos Playground"
 */

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

:root {
    --cosmos-bg: #030014;
    --cosmos-bg2: #0a0620;
    --cosmos-neon: #7b5cff;
    --cosmos-cyan: #00e5ff;
    --cosmos-pink: #ff2bd6;
    --cosmos-lime: #b8ff3c;
    --cosmos-orange: #ff8a3d;
    --cosmos-text: #e8e6ff;
    --cosmos-muted: #9b97c2;
    --cosmos-card: rgba(255, 255, 255, 0.06);
    --cosmos-border: rgba(123, 92, 255, 0.35);
    --cosmos-font: 'Rajdhani', system-ui, sans-serif;
    --cosmos-display: 'Orbitron', system-ui, sans-serif;
}

/* Reset local no template cosmos */
body.maxtem-cosmos {
    margin: 0;
    background: var(--cosmos-bg);
    color: var(--cosmos-text);
    font-family: var(--cosmos-font);
    overflow-x: hidden;
}

body.maxtem-cosmos .maxtem-topbar,
body.maxtem-cosmos .maxtem-header,
body.maxtem-cosmos .maxtem-nav,
body.maxtem-cosmos .maxtem-footer,
body.maxtem-cosmos .maxtem-float-wa {
    display: none !important;
}

.cosmos-wrap {
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(123, 92, 255, 0.25), transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(0, 229, 255, 0.12), transparent 45%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(255, 43, 214, 0.1), transparent 40%),
        linear-gradient(180deg, #030014 0%, #0a0620 40%, #05021a 100%);
}

/* Estrelas */
.cosmos-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, #fff, transparent),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 70% 30%, #fff, transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 50% 50%, #fff, transparent),
        radial-gradient(1px 1px at 15% 85%, rgba(200,200,255,0.9), transparent),
        radial-gradient(1.5px 1.5px at 85% 15%, #fff, transparent),
        radial-gradient(1px 1px at 45% 10%, rgba(255,255,255,0.6), transparent);
    background-size: 100% 100%;
    animation: cosmos-twinkle 8s ease-in-out infinite alternate;
    opacity: 0.85;
}

@keyframes cosmos-twinkle {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.cosmos-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* Top bar cosmos */
.cosmos-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 12px 0;
}

.cosmos-logo {
    font-family: var(--cosmos-display);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 20px rgba(123, 92, 255, 0.8);
}

.cosmos-logo span {
    color: var(--cosmos-cyan);
}

.cosmos-portal-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--cosmos-border);
    background: linear-gradient(135deg, rgba(123, 92, 255, 0.25), rgba(0, 229, 255, 0.1));
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 24px rgba(123, 92, 255, 0.25);
}

.cosmos-portal-back:hover {
    transform: scale(1.04);
    box-shadow: 0 0 32px rgba(0, 229, 255, 0.35);
    color: #fff;
}

.cosmos-portal-back .portal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cosmos-cyan);
    box-shadow: 0 0 12px var(--cosmos-cyan);
    animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Hero cosmos */
.cosmos-hero {
    text-align: center;
    padding: 40px 10px 50px;
}

.cosmos-hero h1 {
    font-family: var(--cosmos-display);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    background: linear-gradient(90deg, #fff, var(--cosmos-cyan), var(--cosmos-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cosmos-hero p {
    max-width: 560px;
    margin: 0 auto 28px;
    color: var(--cosmos-muted);
    font-size: 18px;
    line-height: 1.5;
}

/* Galaxy / planets grid */
.cosmos-galaxy {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin: 20px 0 60px;
}

@media (max-width: 900px) {
    .cosmos-galaxy { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .cosmos-galaxy { grid-template-columns: 1fr; }
}

.cosmos-planet {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px 24px;
    border-radius: 24px;
    background: var(--cosmos-card);
    border: 1px solid var(--cosmos-border);
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
    overflow: hidden;
}

.cosmos-planet::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 50%);
    pointer-events: none;
}

.cosmos-planet:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--cosmos-cyan);
    box-shadow: 0 12px 40px rgba(0, 229, 255, 0.15);
}

.planet-orb {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin-bottom: 16px;
    position: relative;
    box-shadow: inset -12px -8px 24px rgba(0,0,0,0.4), 0 0 28px rgba(123, 92, 255, 0.4);
    animation: planet-float 5s ease-in-out infinite;
}

.cosmos-planet:nth-child(2) .planet-orb { animation-delay: 0.4s; }
.cosmos-planet:nth-child(3) .planet-orb { animation-delay: 0.8s; }
.cosmos-planet:nth-child(4) .planet-orb { animation-delay: 1.2s; }
.cosmos-planet:nth-child(5) .planet-orb { animation-delay: 1.6s; }
.cosmos-planet:nth-child(6) .planet-orb { animation-delay: 2s; }

@keyframes planet-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.planet-orb.tech {
    background: radial-gradient(circle at 30% 30%, #a8fff0, #00b4d8 40%, #023e8a 100%);
}
.planet-orb.web {
    background: radial-gradient(circle at 30% 30%, #e0aaff, #7b2cbf 45%, #240046 100%);
}
.planet-orb.ideas {
    background: radial-gradient(circle at 30% 30%, #ffff99, #ff8a3d 40%, #9b2226 100%);
}
.planet-orb.science {
    background: radial-gradient(circle at 30% 30%, #b8ff3c, #2d6a4f 50%, #081c15 100%);
}
.planet-orb.youth {
    background: radial-gradient(circle at 30% 30%, #ff9eee, #ff2bd6 40%, #5a189a 100%);
}
.planet-orb.random {
    background: radial-gradient(circle at 30% 30%, #90e0ef, #48cae4 30%, #0077b6 70%, #03045e 100%);
}

.planet-ring {
    position: absolute;
    width: 120%;
    height: 28%;
    left: -10%;
    top: 42%;
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    transform: rotateX(70deg);
    pointer-events: none;
}

.cosmos-planet h3 {
    font-family: var(--cosmos-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 8px;
    color: #fff;
}

.cosmos-planet p {
    margin: 0;
    font-size: 14px;
    color: var(--cosmos-muted);
    line-height: 1.4;
}

/* Feed / cards de conteúdo */
.cosmos-section-title {
    font-family: var(--cosmos-display);
    font-size: 22px;
    letter-spacing: 1px;
    margin: 0 0 20px;
    color: #fff;
}

.cosmos-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

@media (max-width: 700px) {
    .cosmos-feed { grid-template-columns: 1fr; }
}

.cosmos-card {
    background: var(--cosmos-card);
    border: 1px solid var(--cosmos-border);
    border-radius: 16px;
    padding: 22px;
    transition: border-color 0.2s;
}

.cosmos-card:hover {
    border-color: rgba(0, 229, 255, 0.5);
}

.cosmos-card .tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cosmos-cyan);
    margin-bottom: 10px;
}

.cosmos-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.cosmos-card p {
    margin: 0;
    color: var(--cosmos-muted);
    font-size: 15px;
    line-height: 1.5;
}

.cosmos-card a.more {
    display: inline-block;
    margin-top: 14px;
    color: var(--cosmos-pink);
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.cosmos-card a.more:hover {
    color: var(--cosmos-cyan);
}

/* Portal CTA final */
.cosmos-exit {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
    border-radius: 24px;
    border: 1px dashed var(--cosmos-border);
    background: rgba(0, 0, 0, 0.25);
}

.cosmos-exit p {
    color: var(--cosmos-muted);
    margin: 0 0 16px;
}

/* ========== PORTAL NA HOME MAXTEM ========== */
.maxtem-portal-section {
    padding: 50px 0;
    background: linear-gradient(180deg, #061525 0%, #0a0620 50%, #061525 100%);
    position: relative;
    overflow: hidden;
}

.maxtem-portal-section .container {
    position: relative;
    z-index: 1;
}

.portal-gateway {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 24px;
}

.portal-ring-wrap {
    position: relative;
    width: min(220px, 50vw);
    height: min(220px, 50vw);
    margin-bottom: 28px;
}

.portal-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    background:
        linear-gradient(#061525, #061525) padding-box,
        linear-gradient(135deg, #7b5cff, #00e5ff, #ff2bd6, #7b5cff) border-box;
    animation: portal-spin 12s linear infinite;
    box-shadow:
        0 0 40px rgba(123, 92, 255, 0.45),
        inset 0 0 40px rgba(0, 229, 255, 0.15);
}

.portal-ring-inner {
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 40%, rgba(0, 229, 255, 0.35), transparent 55%),
        radial-gradient(circle at 60% 60%, rgba(123, 92, 255, 0.5), #030014 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: portal-pulse 3s ease-in-out infinite;
}

@keyframes portal-spin {
    to { transform: rotate(360deg); }
}

@keyframes portal-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
}

.portal-icon {
    font-size: 42px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.8));
}

.portal-gateway h2 {
    font-size: clamp(22px, 3vw, 32px);
    color: #fff;
    margin: 0 0 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.portal-gateway p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 24px;
    line-height: 1.5;
    font-size: 16px;
}

.btn-portal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7b5cff, #00e5ff);
    color: #030014 !important;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.8px;
    text-decoration: none !important;
    text-transform: uppercase;
    box-shadow: 0 8px 32px rgba(123, 92, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-portal:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 229, 255, 0.45);
    color: #030014 !important;
}

.portal-hint {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1px;
    text-transform: uppercase;
}
