/* ====================================
   Monika - Factorio CSS
   Paleta: Verde (#00ff41, #0f0), Preto (#0a0a0a, #1a1a1a), Laranja Enferrujado (#c84e1f, #a84010)
   ==================================== */

:root {
    --cor-verde-primario: #00ff41;
    --cor-verde-secundario: #0f0;
    --cor-verde-escuro: #00cc33;
    --cor-preto: #0a0a0a;
    --cor-preto-secundario: #1a1a1a;
    --cor-laranja-ferrugem: #c84e1f;
    --cor-laranja-escuro: #a84010;
    --cor-texto: #e0ffe0;
}

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

body {
    font-family: 'Courier New', monospace, system-ui, -apple-system;
    background: linear-gradient(135deg, var(--cor-preto) 0%, var(--cor-preto-secundario) 100%);
    color: var(--cor-texto);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Efeito de scanlines (linhas de varredura CRT) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Glitch overlay - bugs na tela */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: 9998;
    animation: glitch-overlay 5s infinite;
    mix-blend-mode: difference;
}

@keyframes glitch-overlay {
    0%, 90%, 100% {
        opacity: 0;
    }
    92% {
        opacity: 0.8;
        background: repeating-linear-gradient(
            90deg,
            var(--cor-verde-primario) 0px,
            transparent 2px,
            transparent 4px,
            var(--cor-laranja-ferrugem) 4px,
            transparent 6px
        );
    }
    94% {
        opacity: 0;
    }
}

/* ====================================
   SIDEBAR NAVIGATION
   ==================================== */
.Sitebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, var(--cor-preto-secundario) 0%, var(--cor-preto) 100%);
    border-right: 3px solid var(--cor-verde-primario);
    padding: 2rem 1rem;
    z-index: 1000;
    box-shadow: 5px 0 20px rgba(0, 255, 65, 0.3);
    animation: sidebar-flicker 10s infinite;
}

@keyframes sidebar-flicker {
    0%, 98%, 100% {
        opacity: 1;
    }
    99% {
        opacity: 0.8;
        box-shadow: 5px 0 20px rgba(200, 78, 31, 0.5);
    }
}

.Sitebar a {
    display: block;
    color: var(--cor-verde-primario);
    text-decoration: none;
    padding: 1rem 1.5rem;
    margin: 0.5rem 0;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.Sitebar a::before {
    content: ">";
    position: absolute;
    left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.Sitebar a:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--cor-laranja-ferrugem);
    color: var(--cor-laranja-ferrugem);
    transform: translateX(5px);
    animation: link-glitch 0.3s;
}

.Sitebar a:hover::before {
    opacity: 1;
}

@keyframes link-glitch {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) skew(2deg); }
    75% { transform: translateX(2px) skew(-2deg); }
}

/* ====================================
   MAIN CONTAINER
   ==================================== */
.Container {
    margin-left: 270px;
    padding: 3rem 2rem;
    max-width: 1400px;
    position: relative;
}

/* ====================================
   HIDDEN REVEAL (Easter Egg)
   ==================================== */
.hidden-reveal {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--cor-verde-primario);
    border-radius: 4px;
    z-index: 1001;
    animation: hidden-pulse 3s infinite;
}

@keyframes hidden-pulse {
    0%, 100% {
        border-color: var(--cor-verde-primario);
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    }
    50% {
        border-color: var(--cor-laranja-ferrugem);
        box-shadow: 0 0 15px rgba(200, 78, 31, 0.5);
    }
}

/* ====================================
   TYPOGRAPHY
   ==================================== */
h1 {
    font-size: 3rem;
    color: var(--cor-verde-primario);
    text-shadow: 0 0 20px var(--cor-verde-primario), 2px 2px 4px var(--cor-preto);
    margin-bottom: 1.5rem;
    animation: title-glitch 8s infinite;
    position: relative;
}

@keyframes title-glitch {
    0%, 96%, 100% {
        text-shadow: 0 0 20px var(--cor-verde-primario), 2px 2px 4px var(--cor-preto);
    }
    97% {
        text-shadow: -2px 0 var(--cor-laranja-ferrugem), 2px 0 var(--cor-verde-secundario);
        transform: translate(-2px, 0);
    }
    98% {
        text-shadow: 2px 0 var(--cor-laranja-ferrugem), -2px 0 var(--cor-verde-secundario);
        transform: translate(2px, 0);
    }
}

h2 {
    font-size: 2rem;
    color: var(--cor-laranja-ferrugem);
    border-bottom: 2px solid var(--cor-verde-primario);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1rem;
    text-shadow: 1px 1px 3px var(--cor-preto);
}

h3 {
    font-size: 1.5rem;
    color: var(--cor-verde-secundario);
    margin: 1.5rem 0 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

p {
    margin: 1rem 0;
    color: var(--cor-texto);
    text-shadow: 1px 1px 2px var(--cor-preto);
}

/* ====================================
   LOGO E IMAGENS
   ==================================== */
.logo {
    width: 300px;
    height: auto;
    display: block;
    margin: 2rem auto;
    border: 3px solid var(--cor-verde-primario);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.4);
    transition: all 0.3s;
    animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(200, 78, 31, 0.6);
    border-color: var(--cor-laranja-ferrugem);
    animation: logo-glitch 0.5s;
}

@keyframes logo-glitch {
    0%, 100% { filter: none; }
    25% { filter: hue-rotate(90deg); }
    50% { filter: invert(0.2); }
    75% { filter: hue-rotate(-90deg); }
}

.in-game-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 2rem auto;
    border: 2px solid var(--cor-laranja-ferrugem);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

/* ====================================
   AVISO (WARNING BOX)
   ==================================== */
.aviso {
    background: linear-gradient(135deg, rgba(200, 78, 31, 0.2) 0%, rgba(168, 64, 16, 0.3) 100%);
    border-left: 5px solid var(--cor-laranja-ferrugem);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(200, 78, 31, 0.3);
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(200, 78, 31, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(200, 78, 31, 0.6);
    }
}

.aviso strong {
    color: var(--cor-laranja-ferrugem);
    text-transform: uppercase;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ====================================
   LISTAS E ESTRUTURAS
   ==================================== */
ol, ul {
    margin: 1.5rem 0 1.5rem 2rem;
    color: var(--cor-texto);
}

ol li, ul li {
    margin: 0.75rem 0;
    position: relative;
    padding-left: 0.5rem;
}

ol li::marker {
    color: var(--cor-verde-primario);
    font-weight: bold;
}

ul li::before {
    content: "▶";
    color: var(--cor-verde-primario);
    position: absolute;
    left: -1.5rem;
    animation: marker-blink 2s infinite;
}

@keyframes marker-blink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.3; }
}

/* ====================================
   LINKS
   ==================================== */
a {
    color: var(--cor-verde-primario);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
    position: relative;
}

a:hover {
    color: var(--cor-laranja-ferrugem);
    border-bottom-color: var(--cor-laranja-ferrugem);
    text-shadow: 0 0 8px var(--cor-laranja-ferrugem);
}

/* ====================================
   DOWNLOADS LIST
   ==================================== */
.Downloads {
    background: rgba(26, 26, 26, 0.6);
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid var(--cor-verde-primario);
    margin-top: 3rem;
    box-shadow: 0 5px 25px rgba(0, 255, 65, 0.2);
}

.downloads-list {
    list-style: none;
    margin: 1rem 0;
}

.downloads-list li {
    background: rgba(0, 255, 65, 0.05);
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--cor-verde-primario);
    transition: all 0.3s;
}

.downloads-list li:hover {
    background: rgba(200, 78, 31, 0.1);
    border-left-color: var(--cor-laranja-ferrugem);
    transform: translateX(10px);
}

/* ====================================
   SECTIONS COM INSTALAÇÃO
   ==================================== */
.instalacao_1, .instalacao_2, .instalacao_3, .instalcao_4 {
    background: rgba(10, 10, 10, 0.7);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    border: 1px solid var(--cor-verde-escuro);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.estrutura_pasta {
    margin: 1.5rem 0;
}

/* ====================================
   ANIMAÇÕES DE BUGS/GLITCHES
   ==================================== */

/* Bug visual 1: Pixel corruption */
@keyframes pixel-corruption {
    0%, 95%, 100% {
        opacity: 0;
    }
    96% {
        opacity: 1;
        background: repeating-linear-gradient(
            45deg,
            var(--cor-verde-primario) 0px,
            var(--cor-preto) 2px,
            var(--cor-laranja-ferrugem) 4px,
            var(--cor-preto) 6px
        );
    }
}

/* Bug visual 2: RGB split */
.Container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 270px;
    width: calc(100% - 270px);
    height: 100%;
    pointer-events: none;
    z-index: 100;
    animation: rgb-split 15s infinite;
    opacity: 0;
}

@keyframes rgb-split {
    0%, 98%, 100% {
        opacity: 0;
    }
    99% {
        opacity: 0.7;
        background: linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.3) 0%,
            transparent 33%,
            rgba(0, 255, 0, 0.3) 66%,
            transparent 100%
        );
        transform: translateX(5px);
    }
}

/* Bug visual 3: Noise static */
@keyframes noise {
    0%, 100% {
        background-position: 0 0;
    }
    10% {
        background-position: -5% -10%;
    }
    20% {
        background-position: -15% 5%;
    }
    30% {
        background-position: 7% -25%;
    }
    40% {
        background-position: 20% 25%;
    }
    50% {
        background-position: -25% 10%;
    }
    60% {
        background-position: 15% 5%;
    }
    70% {
        background-position: 0 15%;
    }
    80% {
        background-position: 25% 35%;
    }
    90% {
        background-position: -10% 10%;
    }
}

/* Bug visual 4: Screen tear */
@keyframes screen-tear {
    0%, 94%, 100% {
        transform: translateX(0);
        opacity: 0;
    }
    95% {
        transform: translateX(-20px);
        opacity: 0.8;
    }
    96% {
        transform: translateX(15px);
        opacity: 0.6;
    }
    97% {
        transform: translateX(-10px);
        opacity: 0.4;
    }
}

/* Aplicar efeito de tear em elementos aleatórios */
h1:nth-of-type(2), h2:nth-of-type(3) {
    animation: screen-tear 20s infinite;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    .Sitebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 3px solid var(--cor-verde-primario);
    }
    
    .Container {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        width: 200px;
    }
}

/* ====================================
   CUSTOM SCROLLBAR
   ==================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--cor-preto);
    border-left: 1px solid var(--cor-verde-escuro);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cor-verde-primario) 0%, var(--cor-laranja-ferrugem) 100%);
    border-radius: 6px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--cor-laranja-ferrugem) 0%, var(--cor-verde-primario) 100%);
}

/* ====================================
   SELECTION
   ==================================== */
::selection {
    background: var(--cor-verde-primario);
    color: var(--cor-preto);
}

::-moz-selection {
    background: var(--cor-verde-primario);
    color: var(--cor-preto);
}

/* ====================================
   TOGGLE EFFECTS (when user disables visual effects)
   ==================================== */
/* class is added on the <body>, so selectors must target body.effects-disabled */
body.effects-disabled::before,
body.effects-disabled::after,
body.effects-disabled .Container::before {
    display: none !important;
    animation: none !important;
}

body.effects-disabled * {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Make sure selection and layout still work when effects are disabled */
body.effects-disabled ::selection { background: transparent !important; }

/* Toggle button styling inside sidebar */
#toggle-effects {
    display: inline-block;
    margin-top: 1rem;
    width: calc(100% - 1rem);
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, var(--cor-laranja-ferrugem), var(--cor-verde-primario));
    color: var(--cor-preto);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

#toggle-effects[aria-pressed="true"] {
    background: rgba(255,255,255,0.06);
    color: var(--cor-texto);
    border: 1px solid var(--cor-verde-primario);
}

/* Extra safety: force-disable some specific animated elements */
body.effects-disabled {
    background: var(--cor-preto) !important;
}

body.effects-disabled .Sitebar,
body.effects-disabled .logo,
body.effects-disabled h1,
body.effects-disabled h2,
body.effects-disabled .aviso {
    animation: none !important;
}

        .hidden-reveal {
            color: transparent;
            -webkit-text-fill-color: transparent; /* Safari/Chrome */
            user-select: text;
            -webkit-user-select: text;
            cursor: text;
            display: inline-block;
            line-height: 1.4;
        }

        /* Mostrar texto quando selecionado */
        .hidden-reveal::selection,
        .hidden-reveal *::selection {
            color: #222; /* cor do texto revelado */
            background: rgba(255, 255, 0, 0.25); /* opção de destaque */
        }

        /* Firefox */
        .hidden-reveal::-moz-selection,
        .hidden-reveal *::-moz-selection {
            color: #222;
            background: rgba(255, 255, 0, 0.25);
        }
        /* Terminal-style for code blocks */
        pre {
            background: linear-gradient(180deg,#071012 0%, #0f1316 100%);
            color: #b7f1b3;
            padding: 1rem 1.25rem;
            border-radius: 8px;
            font-family: "Fira Code", "Source Code Pro", Menlo, Monaco, monospace;
            font-size: 0.95rem;
            line-height: 1.5;
            overflow: auto;
            position: relative;
            box-shadow: 0 6px 18px rgba(2,6,23,0.6), inset 0 -30px 40px rgba(0,0,0,0.4);
            margin: 1rem 0;
        }

        /* Window control dots (red, yellow, green) */
        pre::before {
            content: "";
            position: absolute;
            top: 10px;
            left: 12px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ff5f56;
            box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #27c93f;
        }

        /* Optional small title label (e.g., "bash") */
        pre::after {
            content: "bash";
            position: absolute;
            top: 8px;
            left: 60px;
            font-size: 12px;
            color: rgba(255,255,255,0.45);
            font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        }

        /* Code inside pre */
        pre code {
            background: transparent;
            color: inherit;
            display: block;
            white-space: pre;
            word-break: normal;
        }

        /* Inline <code> styling */
        code {
            background: rgba(255,255,255,0.02);
            color: #dfffe0;
            padding: 0.15rem 0.4rem;
            border-radius: 4px;
            font-family: inherit;
            font-size: 0.92em;
        }

        /* Blinking cursor at end of code block */
        pre code::after {
            content: "";
            display: inline-block;
            width: 8px;
            height: 1em;
            background: #b7f1b3;
            margin-left: 6px;
            vertical-align: bottom;
            animation: blink 1s steps(2, start) infinite;
            border-radius: 2px;
            opacity: 0.9;
        }

        /* Selection styling for terminal feel */
        pre ::selection,
        code ::selection {
            background: rgba(255,255,255,0.12);
            color: #111;
        }

        /* Cursor blink animation */
        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }

