:root {
    --primary-color: #00e5ff; /* Azul Ciano para o tema galáctico */
    --secondary-color: #e666ff; /* Roxo para o tema galáctico */
    --main-bg-color: #0d1117;
    --terminal-bg-color: rgba(18, 26, 38, 0.9);
    --main-text-color: #00ff41;
    --glow-color: rgba(0, 255, 65, 0.5);
    --header-bg-color: rgba(0, 0, 0, 0.3);
    --header-border-color: #00ff41;
    --title-color: #00ff41;
    --heading-color: #4dff8a;
    --heading-glow-color: rgba(77, 255, 138, 0.8);
    --link-color: #ff99e5;
    --link-glow-color: rgba(255, 153, 229, 0.8);
}

/* --- Temas de Cores (Mantidos para o terminal) --- */
body.theme-green {
    --main-text-color: #00ff41;
    --glow-color: rgba(0, 255, 65, 0.5);
    --header-border-color: #00ff41;
    --title-color: #00ff41;
    --heading-color: #4dff8a;
    --heading-glow-color: rgba(77, 255, 138, 0.8);
    --link-color: #ff99e5;
    --link-glow-color: rgba(153, 255, 204, 0.8);
}

body.theme-blue {
    --main-text-color: #00c0ff;
    --glow-color: rgba(0, 192, 255, 0.5);
    --header-border-color: #00c0ff;
    --title-color: #00c0ff;
    --heading-color: #00e5ff;
    --heading-glow-color: rgba(0, 229, 255, 0.8);
    --link-color: #cc99ff;
    --link-glow-color: rgba(204, 153, 255, 0.8);
}

body.theme-red {
    --main-text-color: #ff3366;
    --glow-color: rgba(255, 51, 102, 0.5);
    --header-border-color: #ff3366;
    --title-color: #ff3366;
    --heading-color: #ff6699;
    --heading-glow-color: rgba(255, 102, 153, 0.8);
    --link-color: #ffcc00;
    --link-glow-color: rgba(255, 204, 0, 0.8);
}

body.theme-purple {
    --main-text-color: #cc00ff;
    --glow-color: rgba(204, 0, 255, 0.5);
    --header-border-color: #cc00ff;
    --title-color: #cc00ff;
    --heading-color: #e666ff;
    --heading-glow-color: rgba(230, 102, 255, 0.8);
    --link-color: #99ffcc;
    --link-glow-color: rgba(153, 255, 204, 0.8);
}

/* --- Estilos Gerais: Comportamento padrão para mobile (layout vertical) --- */
body {
    background-color: #0a0e14;
    background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1), transparent), 
                      url('https://www.transparenttextures.com/patterns/stardust.png');
    color: var(--main-text-color);
    font-family: 'Roboto Mono', monospace;
    display: flex;
    flex-direction: column; /* Organiza os elementos verticalmente */
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh; /* Garante que o corpo tenha pelo menos 100% da altura da tela */
    margin: 0;
    padding: 5vh 0; /* Espaçamento vertical para o topo e base */
    overflow-y: auto; /* Permite a rolagem */
    position: relative;
    transition: all 0.5s ease;
}

.terminal-container {
    width: 90vw; /* Tamanho flexível para mobile */
    height: 50vh;
    background-color: var(--terminal-bg-color);
    border: 2px solid var(--header-border-color);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--glow-color), inset 0 0 10px rgba(0, 255, 65, 0.2);
    display: flex;
    flex-direction: column;
    padding: 10px;
    transition: all 0.5s ease;
    z-index: 100;
}

.terminal-header {
    display: flex;
    align-items: center;
    background-color: var(--header-bg-color);
    border-bottom: 2px solid var(--header-border-color);
    padding: 8px 15px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-shadow: 0 2px 5px var(--glow-color);
    transition: all 0.5s ease;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.dot:hover {
    opacity: 1;
}

.dot.red { background-color: #ff5f57; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.terminal-title {
    flex-grow: 1;
    text-align: center;
    color: var(--title-color);
    font-size: 12px;
    letter-spacing: 1px;
    opacity: 0.8;
    transition: all 0.5s ease;
}

.color-palette {
    display: flex;
    gap: 5px;
    margin-left: 15px;
}

.color-box {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-box:hover {
    transform: scale(1.1);
    border-color: var(--main-text-color);
}

.color-box.active {
    border-color: var(--main-text-color);
    box-shadow: 0 0 8px var(--main-text-color);
}

.color-box.color-green { background-color: #00ff41; }
.color-box.color-blue { background-color: #00c0ff; }
.color-box.color-red { background-color: #ff3366; }
.color-box.color-purple { background-color: #cc00ff; }

.terminal-content {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.3;
    color: var(--main-text-color);
    text-shadow: 0 0 8px var(--glow-color);
    transition: all 0.5s ease;
    font-size: 10px;
}

.typed-text::after {
    content: '|';
    animation: blink-caret 1s infinite;
}

@keyframes blink-caret {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Cenário Galáctico */
.galactic-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1; /* Mantenha no fundo */
}

/* --- Meteoros --- */
.meteors-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.meteor {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    opacity: 0;
    animation: meteor-fall var(--meteor-speed) infinite linear;
}

.meteor:nth-child(1) { --meteor-speed: 25s; animation-delay: 0s; top: -10%; left: 10%; }
.meteor:nth-child(2) { --meteor-speed: 30s; animation-delay: 3s; top: -15%; left: 30%; }
.meteor:nth-child(3) { --meteor-speed: 20s; animation-delay: 6s; top: -5%; left: 50%; }
.meteor:nth-child(4) { --meteor-speed: 35s; animation-delay: 9s; top: -20%; left: 70%; }
.meteor:nth-child(5) { --meteor-speed: 28s; animation-delay: 12s; top: -8%; left: 90%; }
.meteor:nth-child(6) { --meteor-speed: 22s; animation-delay: 15s; top: -12%; left: 25%; }
.meteor:nth-child(7) { --meteor-speed: 32s; animation-delay: 18s; top: -18%; left: 45%; }
.meteor:nth-child(8) { --meteor-speed: 27s; animation-delay: 21s; top: -7%; left: 65%; }
.meteor:nth-child(9) { --meteor-speed: 24s; animation-delay: 24s; top: -14%; left: 85%; }
.meteor:nth-child(10) { --meteor-speed: 31s; animation-delay: 27s; top: -11%; left: 15%; }


/* Animação do meteoro */
@keyframes meteor-fall {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg) scale(0.5);
    }
    5% {
        opacity: 1;
    }
    15% {
        opacity: 0.8;
    }
    20% {
        opacity: 0;
        transform: translate(100vw, 100vh) rotate(45deg) scale(0.5);
    }
    100% {
        opacity: 0;
    }
}

/* --- Foguete --- */
.rocket {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('https://i.imgur.com/83p9hD0.png');
    background-size: cover;
    z-index: 1000; /* Força o foguete a ficar na frente de tudo */
    opacity: 1; /* Garante que ele seja visível */
    transition: transform 10s ease-in-out;
    top: 50px;
    left: 50px;
}


/* Animação da órbita */
@keyframes orbit {
    from { transform: rotate(0deg) translateX(300px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(300px) rotate(-360deg); }
}

.project-orbit {
    width: 80vw; /* Tamanho flexível para mobile */
    height: 80vw;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeInOrbit 2s forwards, pulse 4s infinite ease-in-out;
    margin: 20px auto; /* Centraliza e adiciona espaçamento */
}


/* Efeito de pulsação na órbita */
@keyframes pulse {
    0% { box-shadow: 0 0 10px rgba(0, 0, 0, 0); }
    50% { box-shadow: 0 0 20px var(--glow-color); }
    100% { box-shadow: 0 0 10px rgba(0, 0, 0, 0); }
}

/* Animação para a órbita aparecer */
@keyframes fadeInOrbit {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* O Planeta Lua */
.moon {
    width: 60px;
    height: 60px;
    background-image: url('https://i.imgur.com/kP120lV.png');
    background-size: cover;
    border-radius: 50%;
    position: absolute;
    transform-origin: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
    animation: orbit 20s infinite linear;
}

.moon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px var(--primary-color);
}

/* Informação sobre o projeto */
.moon-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--main-text-color);
    font-size: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.moon:hover .moon-info {
    opacity: 1;
}

.moon-info span {
    color: var(--primary-color);
    font-weight: bold;
}

/*
--- MEDIA QUERY para Desktop (a partir de 769px) ---
*/
@media (min-width: 769px) {
    /* Retorna o layout original para telas grandes */
    body {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .terminal-container {
        position: fixed;
        width: 550px;
        height: 350px;
        top: 20px;
        left: 20px;
    }
    
    .terminal-content {
        font-size: 12px;
    }

    .terminal-title {
        font-size: 14px;
    }

    .color-box {
        width: 15px;
        height: 15px;
    }

    .project-orbit {
        position: fixed;
        width: 600px;
        height: 600px;
        right: 50px;
        bottom: 50px;
    }

    .moon {
        width: 80px;
        height: 80px;
    }

    .moon-info {
        font-size: 10px;
    }

    @keyframes orbit {
        from { transform: rotate(0deg) translateX(300px) rotate(0deg); }
        to { transform: rotate(360deg) translateX(300px) rotate(-360deg); }
    }
}