/* ============================================
   MJ Cloud Tecnologia - Blog
   Matrix-Themed Dark Design
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --matrix-green: #7eb8ff;
  --matrix-green-dim: #5a9fd4;
  --matrix-green-dark: #0d2847;
  --matrix-bg: #0a0a0a;
  --matrix-bg-card: #0d1117;
  --matrix-bg-card-hover: #161b22;
  --matrix-border: #1a2a3a;
  --matrix-text: #c9d1d9;
  --matrix-text-muted: #8b949e;
  --matrix-white: #f0f6fc;
  --matrix-accent: #7eb8ff;
  --matrix-blue: #58a6ff;
  --matrix-red: #ff4444;
  --font-main: 'Share Tech Mono', 'Courier New', monospace;
  --font-heading: 'Orbitron', 'Share Tech Mono', monospace;
  --max-width: 1200px;
  --header-height: 70px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--matrix-bg);
  color: var(--matrix-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--matrix-green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--matrix-white);
  text-shadow: 0 0 8px rgba(126, 184, 255, 0.4);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Canvas Background --- */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.08;
  pointer-events: none;
}

/* --- Layout --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

main {
  flex: 1;
  padding-top: calc(var(--header-height) + 30px);
  padding-bottom: 60px;
}

/* --- Header / Navbar --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--matrix-border);
  z-index: 1000;
  transition: background var(--transition);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--matrix-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(126, 184, 255, 0.5);
}

.logo img {
  width: 40px;
  height: 40px;
}

.logo-text-mj {
  color: var(--matrix-green);
}

.logo-text-cloud {
  color: #b0b8c4;
}

.logo-text-tech {
  color: var(--matrix-green);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-menu a {
  display: inline-block;
  padding: 8px 16px;
  color: var(--matrix-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--matrix-green);
  border-color: var(--matrix-green);
  text-shadow: 0 0 6px rgba(126, 184, 255, 0.4);
  background: rgba(126, 184, 255, 0.05);
}

/* Nav Search */
.nav-search {
  margin-left: 4px;
}

.nav-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-box input {
  width: 180px;
  padding: 6px 12px 6px 32px;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--matrix-border);
  border-radius: 4px;
  color: var(--matrix-text);
  font-family: var(--font-main);
  font-size: 0.8rem;
  outline: none;
  transition: all var(--transition);
}

.nav-search-box input::placeholder {
  color: var(--matrix-text-muted);
}

.nav-search-box input:focus {
  border-color: var(--matrix-green);
  box-shadow: 0 0 8px rgba(126, 184, 255, 0.15);
  width: 220px;
}

.nav-search-icon {
  position: absolute;
  left: 8px;
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after {
  content: ' ▾';
  font-size: 0.7rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid var(--matrix-border);
  border-radius: 6px;
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.82rem;
  color: var(--matrix-text);
  border: none;
  border-radius: 0;
  text-transform: none;
  letter-spacing: 0.5px;
}

.dropdown-menu a:hover {
  background: rgba(126, 184, 255, 0.08);
  color: var(--matrix-green);
}

/* ── Hamburger ──────────────────────────────────────── */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  flex-shrink: 0;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.hamburger:focus-visible {
  outline: 2px solid var(--matrix-green);
  outline-offset: 2px;
}

.hamburger:hover {
  border-color: var(--matrix-border);
}

/* As 3 barras usando pseudo-elementos + box-shadow */
.hamburger .hb-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: var(--matrix-green);
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.2s ease;
}

.hamburger .hb-icon::before,
.hamburger .hb-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--matrix-green);
  border-radius: 2px;
  transition: transform 0.35s ease, top 0.35s ease;
}

.hamburger .hb-icon::before { top: -7px; }
.hamburger .hb-icon::after  { top:  7px; }

/* Estado ativo → X */
.hamburger.active .hb-icon {
  background: transparent;
}

.hamburger.active .hb-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger.active .hb-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  color: var(--matrix-green);
  text-shadow: 0 0 20px rgba(126, 184, 255, 0.35);
  margin-bottom: 16px;
  letter-spacing: 3px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--matrix-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.hero .tagline {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 24px;
  border: 1px solid var(--matrix-green);
  border-radius: 4px;
  color: var(--matrix-green);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 5px rgba(126, 184, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(126, 184, 255, 0.4);
  }
}

/* --- Search Bar --- */
.search-bar {
  max-width: 500px;
  margin: 0 auto 40px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 20px 12px 44px;
  background: var(--matrix-bg-card);
  border: 1px solid var(--matrix-border);
  border-radius: 8px;
  color: var(--matrix-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input::placeholder {
  color: var(--matrix-text-muted);
}

.search-bar input:focus {
  border-color: var(--matrix-green);
  box-shadow: 0 0 12px rgba(126, 184, 255, 0.15);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--matrix-text-muted);
  font-size: 1rem;
}

/* --- Section Titles --- */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--matrix-green);
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--matrix-border);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* --- Article Cards Grid --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.article-card {
  background: var(--matrix-bg-card);
  border: 1px solid var(--matrix-border);
  border-radius: 10px;
  padding: 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--matrix-green);
  opacity: 0;
  transition: opacity var(--transition);
}

.article-card:hover {
  border-color: var(--matrix-green-dim);
  background: var(--matrix-bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(126, 184, 255, 0.08);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-card h3 a {
  color: var(--matrix-white);
}

.article-card h3 a:hover {
  color: var(--matrix-green);
}

.article-card p {
  color: var(--matrix-text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.article-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.article-card .date {
  font-size: 0.78rem;
  color: var(--matrix-text-muted);
}

.article-card .date::before {
  content: '📅 ';
}

/* --- Tags --- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--matrix-green);
  border: 1px solid var(--matrix-green-dark);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}

.tag:hover {
  background: rgba(126, 184, 255, 0.1);
  border-color: var(--matrix-green);
  text-shadow: 0 0 4px rgba(126, 184, 255, 0.3);
}

.tag-azure {
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.3);
}

.tag-azure:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: #58a6ff;
}

.tag-ai {
  color: #da70d6;
  border-color: rgba(218, 112, 214, 0.3);
}

.tag-ai:hover {
  background: rgba(218, 112, 214, 0.1);
  border-color: #da70d6;
}

.tag-security {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

.tag-security:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
}

/* --- Page Content --- */
.page-content {
  max-width: 800px;
  margin: 0 auto;
}

.page-content h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--matrix-green);
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(126, 184, 255, 0.3);
}

.page-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--matrix-green-dim);
  margin: 32px 0 16px;
}

.page-content p {
  margin-bottom: 16px;
  color: var(--matrix-text);
}

.page-content ul, .page-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.page-content li {
  margin-bottom: 8px;
}

/* --- Category Page Header --- */
.category-header {
  text-align: center;
  padding: 40px 0;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--matrix-border);
}

.category-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--matrix-green);
  text-shadow: 0 0 20px rgba(126, 184, 255, 0.3);
  margin-bottom: 10px;
}

.category-header p {
  color: var(--matrix-text-muted);
  font-size: 0.95rem;
}

.category-header .category-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

/* Category-specific title colors */
.category-header h1.cat-azure {
  color: #58a6ff;
  text-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

.category-header h1.cat-ai {
  color: #da70d6;
  text-shadow: 0 0 20px rgba(218, 112, 214, 0.3);
}

.category-header h1.cat-security {
  color: #ff6b6b;
  text-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

/* --- About / Sobre --- */
.about-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 40px 0;
}

.about-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--matrix-green);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(126, 184, 255, 0.15);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-info {
  max-width: 680px;
  text-align: center;
}

.about-info h2 {
  font-family: var(--font-heading);
  color: var(--matrix-green);
  margin-bottom: 16px;
}

.about-info p {
  margin-bottom: 12px;
  color: var(--matrix-text);
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.stat-card {
  text-align: center;
  padding: 30px;
  background: var(--matrix-bg-card);
  border: 1px solid var(--matrix-border);
  border-radius: 10px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--matrix-green);
  box-shadow: 0 0 15px rgba(126, 184, 255, 0.1);
}

.stat-card .number {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--matrix-green);
  display: block;
  text-shadow: 0 0 10px rgba(126, 184, 255, 0.3);
}

.stat-card .label {
  font-size: 0.82rem;
  color: var(--matrix-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* --- GitHub Section --- */
.github-repos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.repo-card {
  background: var(--matrix-bg-card);
  border: 1px solid var(--matrix-border);
  border-radius: 10px;
  padding: 24px;
  transition: all var(--transition);
}

.repo-card:hover {
  border-color: var(--matrix-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(126, 184, 255, 0.08);
}

.repo-card h3 {
  color: var(--matrix-blue);
  font-size: 1rem;
  margin-bottom: 8px;
}

.repo-card h3 a {
  color: var(--matrix-blue);
}

.repo-card p {
  color: var(--matrix-text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.repo-card .repo-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--matrix-text-muted);
}

.repo-card .repo-meta span::before {
  margin-right: 4px;
}

.repo-card .lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* --- Footer --- */
.site-footer {
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid var(--matrix-border);
  padding: 40px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand h3 {
  font-family: var(--font-heading);
  color: var(--matrix-green);
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(126, 184, 255, 0.3);
}

.footer-brand p {
  color: var(--matrix-text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-links h4 {
  color: var(--matrix-text);
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--matrix-text-muted);
  font-size: 0.83rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--matrix-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--matrix-border);
  font-size: 0.8rem;
  color: var(--matrix-text-muted);
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--matrix-border);
  border-radius: 50%;
  color: var(--matrix-text-muted);
  transition: all var(--transition);
}

.footer-social a:hover {
  color: var(--matrix-green);
  border-color: var(--matrix-green);
  box-shadow: 0 0 10px rgba(126, 184, 255, 0.2);
}

/* --- Terminal-style code blocks --- */
.code-block {
  background: #000;
  border: 1px solid var(--matrix-border);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  overflow-x: auto;
}

.code-block::before {
  content: '> ';
  color: var(--matrix-green);
}

.code-block code {
  color: var(--matrix-green);
  font-family: var(--font-main);
  font-size: 0.85rem;
}

/* --- Glitch text effect --- */
.glitch {
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% { opacity: 1; }
  91% { opacity: 0.8; transform: translateX(2px); }
  92% { opacity: 1; transform: translateX(-2px); }
  93% { opacity: 0.8; transform: translateX(0); }
}

/* --- Scanline overlay --- */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03) 0px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--matrix-border);
  border-radius: 6px;
  color: var(--matrix-text-muted);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.pagination a:hover,
.pagination .active {
  color: var(--matrix-green);
  border-color: var(--matrix-green);
  background: rgba(126, 184, 255, 0.05);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100dvh - var(--header-height));
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 24px 0 32px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Esconde a barra de rolagem visualmente */
  .nav-menu::-webkit-scrollbar { width: 0; }
  .nav-menu { scrollbar-width: none; }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-menu > li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(126, 184, 255, 0.08);
  }

  .nav-menu > li > a {
    display: block;
    width: 100%;
    padding: 18px 16px;
    font-size: 0.9rem;
    letter-spacing: 2px;
    border: none;
    border-radius: 0;
  }

  .nav-menu > li > a:hover,
  .nav-menu > li > a.active {
    background: rgba(126, 184, 255, 0.08);
    border: none;
  }
    position: static;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    max-height: 200px;
  }

  .nav-search {
    display: none;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    gap: 16px;
  }

  .footer-links h4 {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .footer-links a {
    font-size: 0.75rem;
  }

  .footer-social a {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── GitHub page ── */
  .profile-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .github-repos {
    grid-template-columns: 1fr !important;
  }

  .repo-card .repo-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Utility --- */
.text-green { color: var(--matrix-green); }
.text-blue { color: var(--matrix-blue); }
.text-muted { color: var(--matrix-text-muted); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }

/* --- Loading animation --- */
.loading-text::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}
