/* Importando fontes estilo Terminal/Code */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;600&family=VT323&display=swap');

/* Variáveis CSS - Paleta Matrix/Hacker */
:root {
  --matrix-green: #00ff41;       /* Verde Neon Principal */
  --dim-green: #008f11;          /* Verde Escuro para detalhes */
  --text-color: #e0ffe0;         /* Verde quase branco para leitura (menos cansativo) */
  --background-color: #000000;   /* Preto absoluto */
  --panel-bg: #0a0a0a;           /* Fundo levemente cinza para cards */
  --border-color: #003b00;       /* Bordas sutis */
  
  --header-font: "VT323", monospace;
  --body-font: "Fira Code", monospace;
}

/* Reset e base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Scrollbar customizada estilo Terminal */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--background-color);
}
::-webkit-scrollbar-thumb {
  background: var(--dim-green);
  border: 1px solid var(--matrix-green);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--matrix-green);
}

body {
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column; /* Mobile first: header no topo */
  font-family: var(--body-font);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  /* Efeito de Scanline mantido */
  background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
}

a {
  color: var(--matrix-green);
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 1px dashed transparent;
}

a:hover {
  text-shadow: 0 0 8px var(--matrix-green);
  border-bottom: 1px dashed var(--matrix-green);
  opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  color: var(--matrix-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  font-size: 2em; 
  word-break: break-word;
  text-shadow: 0 0 5px var(--dim-green); /* Efeito Glow */
}

h4 {
  font-size: 1.2em;
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

p {
  color: var(--text-color);
  font-size: 1em;
}

.post li {
  margin-left: 40px;
  padding: 2px;
}

.post ul {
  padding: 10px;
}

/* Cabeçalho do Site */
.site-header {
  background-color: #050505;
  color: var(--matrix-green);
  border-bottom: 2px solid var(--matrix-green);
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centraliza no mobile */
  z-index: 1000;
}

.site-header h1 {
  margin: 0 0 15px 0;
  font-size: 1.8em;
}

/* Navegação Estilo Diretório */
.site-nav ul {
  list-style: none;
  padding: 0px; /* Garante a remoção em navegadores modernos */
  margin: 10px 0 0 0;
  display: flex;
  flex-direction: row; /* Linha única no celular */
  gap: 10px;
  justify-content: center;
  padding-inline-start: 0px;
}

.site-nav ul li {
  display: inline-block;
  margin: 8px 0;
  position: relative;
  padding-left: 5px;
}

.site-nav ul li a {
  font-family: var(--header-font);
  font-size: 1.2em;
  color: var(--matrix-green);
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}


.site-nav ul li a:hover {
  background: var(--matrix-green);
  color: #000;
  text-shadow: none;
}

.sidebar-status {
  display: none;
}

/* Ajuste do Wrapper de Conteúdo */
.content-wrapper {
  flex: 1;
  width: 100%;
  padding: 60px 40px; /* Aumenta distância da borda lateral */
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* Post Individual */
.post {
  width: 100%;
  max-width: 900px; /* Aumentado para não ficar achatado */
  padding: 25px;
  margin-bottom: 40px;
  border: 1px solid var(--dim-green);
  background-color: rgba(0, 20, 0, 0.3);
}

.post-header {
  text-align: left; /* Alinhado à esquerda para parecer log de sistema */
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 2.5em; /* Título bem maior */
  margin: 0;
  line-height: 1.1;
}

.post-subtitle {
  font-size: 1.1em; /* Menor que o título */
  color: var(--dim-green);
  margin: 10px 0;
  font-weight: normal;
  text-transform: uppercase;
}

.post-meta {
  flex-direction: row; /* Horizontal */
  gap: 15px;
  justify-content: flex-start;
  font-size: 0.75em; /* Reduzido */
  margin-bottom: 10px;
  color: #666; /* Cor mais discreta */
}

/* Atalho para o autor/data não brigarem com o conteúdo */
.post-meta span::before {
  content: "[";
}
.post-meta span::after {
  content: "]";
}

.post-content h1, .post-content h2, .post-content h3 {
  color: var(--matrix-green);
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  border-left: 3px solid var(--matrix-green);
  padding-left: 10px;
}

.post-content h2 {
  font-family: var(--header-font);
  font-size: 1.8em;
}

.post-content p {
  line-height: 1.7em;
  margin-bottom: 0.5em;
  font-size: 0.95em;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px auto;
  border: 1px solid var(--dim-green);
  filter: grayscale(80%) contrast(120%); /* Filtro para imagens parecerem tech/antigas */
  transition: filter 0.3s;
}

.post-content img:hover {
  filter: grayscale(0%) contrast(100%);
}

/* Blocos de Código */
.post-content pre, .post-content code {
  color: var(--matrix-green);
  background: #050505;
  margin: 5px 0;
  font-family: "Fira Code", monospace;
  font-size: 0.9em;
  border: 1px solid var(--dim-green);
  border-radius: 0;
  padding: 2px;
  overflow-x: auto;
  box-shadow: inset 0 0 10px #000;
}

.post-content pre {
  white-space: pre-wrap;
}

/* Rodapé do Site */
.site-footer {
  margin-top: auto; /* Empurra para o fim do container flex */
  width: 100%;
  padding: 30px;
  border-top: 1px solid var(--dim-green);
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
}

.site-footer a {
  color: var(--text-color);
}

/* Contêiner de Últimas Notícias */
.container_latest {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  padding: 10px;
  justify-content: center;
}

.container_latest div a,
.container_posts div a {
  color: var(--matrix-green);
}

.container_latest div h3,
.container_posts div h3 {
  color: var(--text-color);
  font-family: var(--header-font);
  font-size: 1.2em;
}

/* Cards de Posts */
.posts_latest, .posts, .posts_order {
  padding: 12px;
  border: 1px solid var(--dim-green);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: unset;
  text-align: center;
  background: rgba(0, 20, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.posts_latest:hover, .posts:hover {
  box-shadow: 0 0 15px var(--dim-green);
  border-color: var(--matrix-green);
  transform: translateY(-2px);
}

.posts_latest p, .posts p, .posts_order p {
  font-size: 0.8em;
  color: #aaa;
  text-align: center;
  margin: 5px 0 15px 0;
}

.posts_latest a, .posts a, .posts_order a {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--matrix-green);
  font-family: var(--header-font);
  letter-spacing: 1px;
}

.posts_latest h3 {
  color: var(--text-color);
}

.date {
  font-size: 0.75em;
}

.tags-container {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Estilização individual da tag */
.tag {
  font-size: 0.58em;
  color: #00FF41; /* O verde clássico da imagem */
  
  padding: 4px 12px;
  border: 1px solid #00FF41;
  border-radius: 20px; /* Cria o efeito circular/pílula */
  
  background-color: rgba(0, 255, 65, 0.1); /* Fundo sutil para destaque */
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Contêiner de Posts (Geral) */
.container_posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 10px;
  align-content: center;
}

blockquote {
  margin: 20px;
  background-color: rgba(0, 50, 0, 0.2);
  border-left: 4px solid var(--matrix-green);
  border-radius: 0;
  font-size: 1em;
  padding: 10px;
  color: #fff;
  font-style: italic;
}

/* Estilos de cálculo/tabelas scroll */
.calculo-scroll {
  overflow-x: auto;
  white-space: nowrap;
  border: 1px solid var(--dim-green);
  padding: 5px;
}

.post-tags {
  font-size: 0.8em;
  margin-top: 10px;
  text-align: center;
}

.post-tags a {
  color: #777;
  text-decoration: none;
  opacity: 0.9;
}

.terminal-interface {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  border: 1px solid var(--dim-green);
  padding: 10px;
  margin-top: 20px;
  background: rgba(0, 10, 0, 0.6);
}

/* Menu Lateral */
.terminal-menu {
  flex: 1;
  border-right: 1px dashed var(--dim-green);
  padding-right: 15px;
}

.menu-header {
  border-bottom: 2px solid var(--matrix-green);
  margin-bottom: 15px;
  padding-bottom: 5px;
  font-family: var(--header-font);
  font-size: 1.2em;
}

.category-list {
  list-style: none;
  padding: 0;
}

.terminal-option {
  cursor: pointer;
  padding: 8px 10px;
  font-family: var(--body-font);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.cmd-arrow {
  margin-right: 10px;
  opacity: 0; /* Invisível até hover/select */
  transition: opacity 0.2s;
}

.count {
  margin-left: auto;
  font-size: 0.8em;
  opacity: 0.7;
}

/* Efeito Hover e Selecionado (Inverte Cores) */
.terminal-option:hover, .terminal-option.selected {
  background-color: var(--matrix-green);
  color: #000;
  font-weight: bold;
}

.terminal-option:hover .cmd-arrow, .terminal-option.selected .cmd-arrow {
  opacity: 1;
}

.system-status {
  margin-top: 20px;
  font-size: 0.8em;
  color: var(--dim-green);
  font-family: var(--header-font);
  animation: blink 2s infinite;
}

/* Área de Display (Conteúdo) */
.terminal-display {
  flex: 2;
  min-height: 300px;
}

.category-content h2 {
  font-size: 1.5em;
  border-bottom: 1px dotted var(--dim-green);
  margin-top: 0;
}

/* Lista de Arquivos (Posts) */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: baseline;
  padding: 5px;
  font-family: var(--body-font);
  font-size: 0.9em;
}

.file-item:hover {
  background: rgba(0, 255, 65, 0.1);
}

.file-perm {
  color: var(--dim-green);
  margin-right: 15px;
  font-size: 0.8em;
  display: none; /* Esconde em mobile */
  white-space: nowrap;
}

.file-date {
  color: var(--matrix-green);
  margin-right: 15px;
  font-size: 0.85em;
  min-width: 90px;
}

.file-name {
  color: var(--text-color);
  text-decoration: none;
}

.file-name:hover {
  text-decoration: underline;
  text-shadow: none;
  border: none;
}

.function-plot .grid line { stroke: #555 !important; stroke-opacity: 0.7; }
.function-plot .axis text { fill: white !important; font-family: 'Times New Roman', serif; }
.function-plot .axis path, .function-plot .axis line { stroke: white !important; }
.function-plot .top-level { fill: white; }

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Media Queries para Telas Maiores --- */
@media (min-width: 1024px) {
  body {
    flex-direction: row;
    font-size: 18px;
  }

  h2 {
    font-size: 3em;
  }

  .main-container {
    width: calc(100% - 260px);
    flex: 1;
    margin-left: 260px; /* Largura da Sidebar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    box-shadow: inset 50px 0 80px -50px rgba(0, 255, 65, 0.2);
  }

  .main-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 255, 65, 0.08), transparent);
    pointer-events: none;
    z-index: 1;
  }
  
  .site-header {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    border-bottom: none;
    border-right: 2px solid var(--matrix-green);
    align-items: flex-start; /* Alinha à esquerda no desktop */
    padding: 40px 25px;
    flex-direction: column;
  }

  .site-header h1 {
    font-size: 2.5em;
    margin-bottom: 40px;
  }

  .site-nav ul {
    flex-direction: column; /* Vertical no desktop */
    align-items: flex-start;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    list-style: none;
  }

  .site-nav ul li a {
    font-size: 1.5em;
    display: block;
    width: 100%;
  }

  /* Preenchendo o Vazio: Terminal Status */
  .sidebar-status {
    display: block;
    margin-top: auto; /* Empurra para o final da sidebar */
    width: 100%;
    font-family: var(--body-font);
    font-size: 0.8em;
    color: var(--dim-green);
    border-top: 1px solid var(--dim-green);
    padding-top: 20px;
    opacity: 0.8;
  }

  .status-line {
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
  }

  .status-line::before {
    content: "> ";
  }

  .content-wrapper {
    width: 100%; 
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
  }

  .post {
    max-width: 950px;
    padding: 30px;
    box-sizing: border-box;
    margin-bottom: 30px;
    font-size: 1.05em;
  }

  .post-title {
    font-size: 3em;
  }

  .container_latest {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    width: 100%;
    gap: 20px;
    padding: 20px;
  }

  .posts_latest, .posts, .posts_order {
    background: rgba(0, 20, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 30px;
    min-height: 220px; /* Garante que não fiquem achatadas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
  }

  /* Efeito de brilho de luz no hover (Holograma ativado) */
  .posts:hover, .posts_latest:hover, .posts_order:hover {
    transform: scale(1.02) translateX(10px);
    box-shadow: -5px 0 20px rgba(0, 255, 65, 0.2), inset 0 0 15px rgba(0, 255, 65, 0.1);
    border-color: var(--matrix-green);
    background: rgba(0, 40, 0, 0.3);
  }

  /* Títulos e Subtítulos ajustados */
  .posts h3, .posts_latest h3, .posts_order h3 {
    font-size: 1.4em;
    margin-bottom: 5px;
  }

  .posts p, .posts_latest p, .posts_order p {
    font-size: 0.85em;
    color: var(--matrix-green);
    opacity: 0.9;
    letter-spacing: 1px;
  }

  .posts_latest, .posts, .posts_order {
    min-width: 250px;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }

  .posts_latest p, .posts p, .posts_order p {
    text-align: left;
  }

  .container_posts {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 20px;
  }

  .terminal-interface {
    flex-direction: row;
    min-height: 500px;
  }
  
  .file-perm {
    display: inline-block;
  }
}

