:root {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --card: #151926;
  --text: #e7ebf3;
  --muted: #a7b0c0;
  --primary: #6aa2ff;
  --primary-2: #3a7bff;
  --border: #233047;
  --success: #19c37d;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, var(--bg) 0%, #0e1117 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-2); text-decoration: underline; }

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,18,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header .wrap {
  max-width: 1200px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
}
header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
nav a { 
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600; 
  color: var(--muted);
  transition: all 0.2s ease;
}
nav a.active, nav a:hover { 
  color: var(--text); 
  background: rgba(106, 162, 255, 0.1);
  text-decoration: none;
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

.container div a{
  padding: 8px 12px;
  text-decoration: none;
}

.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h2 {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 24px;
  font-weight: 400;
}
.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 24px 0 12px; }
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.875rem; color: #d7def0; font-weight: 600; }
h3 { font-size: 1.25rem; color: var(--text); font-weight: 600; }
h4 { font-size: 1.1rem; color: var(--muted); font-weight: 600; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.24);
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(12, 1fr);
}
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.ad-slot, .ad-container {
  margin: 32px 0;
  border: 2px dashed var(--border);
  border-radius: 16px;
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  background: rgba(15, 19, 32, 0.5);
  font-weight: 500;
  transition: border-color 0.2s ease;
  display: none;
}
.ad-container:hover {
  border-color: var(--primary);
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--bg-soft);
  margin-left: auto;
  width: 100%;
}

/* Code blocks */
pre { 
  background: #0c1220; 
  border: 1px solid #1a2740; 
  border-radius: 12px; 
  padding: 20px; 
  overflow: auto;
  margin: 20px 0;
  position: relative;
}
pre:hover {
  border-color: var(--primary);
}
code { 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
}
pre code {
  color: #e1e7ef;
  line-height: 1.5;
}

/* Lists */
ul, ol {
  padding-left: 20px;
}
li {
  margin: 8px 0;
}

/* Buttons */
.btn {
  appearance: none; 
  border: 1px solid var(--border);
  padding: 12px 20px; 
  border-radius: 12px; 
  cursor: pointer; 
  font-weight: 600;
  color: var(--text); 
  background: #0f1422;
  font-size: 0.95em;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:hover {
  background: #1a2332;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-decoration: none;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--primary);
  color: white;
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-2), #2563eb);
  box-shadow: 0 8px 20px rgba(106, 162, 255, 0.3);
}
.btn.ghost {
  background: transparent;
  border-color: var(--muted);
  color: var(--muted);
}
.btn.ghost:hover {
  background: rgba(167, 176, 192, 0.1);
  color: var(--text);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: linear-gradient(135deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  max-width: 600px;
  width: calc(100% - 40px);
  /* display: none; */
}
.cookie-banner p {
  margin: 0 0 16px;
  color: var(--text);
  text-align: center;
  font-size: 0.9em;
  line-height: 1.5;
}
.cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.cookie-actions .btn {
  padding: 10px 16px;
  font-size: 0.9em;
  min-width: 120px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
}
tr:last-child td {
  border-bottom: none;
}
tr:hover {
  background: rgba(106, 162, 255, 0.05);
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(106, 162, 255, 0.1);
}
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
  border-left: 4px solid;
}
.alert.success {
  background: rgba(25, 195, 125, 0.1);
  border-color: var(--success);
  color: #22c55e;
}
.alert.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: #ef4444;
}
.alert.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: #f59e0b;
}

/* Syntax Highlighting */
.language-xml .token.tag { color: #7dd3fc; }
.language-xml .token.attr-name { color: #fbbf24; }
.language-xml .token.attr-value { color: #86efac; }
.language-python .token.keyword { color: #c084fc; }
.language-python .token.string { color: #86efac; }
.language-java .token.keyword { color: #c084fc; }
.language-java .token.class-name { color: #fbbf24; }
.language-csharp .token.keyword { color: #c084fc; }
.language-javascript .token.keyword { color: #c084fc; }
.language-php .token.keyword { color: #c084fc; }

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}
.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(106, 162, 255, 0.2), transparent);
  animation: loading 1.5s infinite;
}
@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Tooltips */
.tooltip {
  position: relative;
  cursor: help;
}
.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-soft);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid var(--border);
  z-index: 10;
}
.tooltip:hover::before {
  opacity: 1;
}

/* JSON Highlighting */
.json-key {
  color: #7dd3fc; /* Azul para chaves JSON */
  font-weight: 500;
}

.json-string {
  color: #86efac; /* Verde para strings JSON */
}

.json-number {
  color: #f472b6; /* Rosa para números JSON */
}

.json-boolean {
  color: #a78bfa; /* Roxo para booleanos JSON */
  font-weight: 600;
}

.json-bracket {
  color: #fbbf24; /* Amarelo para brackets JSON */
  font-weight: 600;
}

/* General Code Highlighting */
.class{
  color: #4EC9B0; /* Verde-azulado para classes */
  font-weight: bold;
}

.type {
  color: #4EC9B0; /* Mesma cor para tipos do .NET */
}

.attribute {
  color: #92C5F7; /* Azul claro para atributos */
}

.namespace {
  color: #D4D4D4; /* Cinza claro para namespaces */
}

.property {
  color: #9CDCFE; /* Azul claro para propriedades */
}

.variable {
  color: #9CDCFE; /* Azul claro para variáveis */
}

.number {
  color: #B5CEA8; /* Verde claro para números */
}

.keyword {
  color: #a78bfa; /* Roxo para palavras-chave */
  font-weight: 600;
}

.comment {
  color: #6b7280; /* Cinza para comentários */
  font-style: italic;
}

.function {
  color: #60a5fa; /* Azul para funções */
  font-weight: 500;
}

.variable {
  color: #fbbf24; /* Amarelo para variáveis */
}

/* PHP Specific */
.php-tag {
  color: #a78bfa; /* Roxo para tags PHP */
  font-weight: 600;
}

/* Bash Specific */
.bash-command {
  color: #60a5fa; /* Azul para comandos bash */
  font-weight: 500;
}

/* Code Block Enhancements */
.code-block-container {
  position: relative;
  margin: 20px 0;
}

.copy-code-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
  font-weight: 500;
}

.code-block-container:hover .copy-code-btn {
  opacity: 1;
}

.copy-code-btn:hover {
  background: var(--primary-2);
  transform: translateY(-1px);
}

.copy-code-btn.copied {
  background: #10b981; /* Verde para sucesso */
}

.code-language-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #a7b0c0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 9;
}

.code-block-container:hover .code-language-label {
  opacity: 1;
}

/* Melhorias nos blocos de código */
pre {
  background: #0c1220;
  border: 1px solid #1a2740;
  border-radius: 12px;
  padding: 20px;
  overflow: auto;
  margin: 20px 0;
  position: relative;
  line-height: 1.6;
}

pre:hover {
  border-color: var(--primary);
}

pre code {
  color: #e1e7ef;
  line-height: 1.6;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Scrollbar para blocos de código */
pre::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

pre::-webkit-scrollbar-track {
  background: #1a2740;
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: var(--primary-2);
}

/* Responsividade para blocos de código */
@media (max-width: 768px) {
  pre {
    padding: 15px;
    font-size: 0.8em;
  }
  
  .copy-code-btn {
    padding: 4px 8px;
    font-size: 0.7em;
  }
  
  .code-language-label {
    font-size: 0.6em;
    padding: 2px 6px;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .col-8 { grid-column: span 12; }
  .col-6 { grid-column: span 12; }
  .col-4 { grid-column: span 6; }
  .col-3 { grid-column: span 6; }
  
  .hero h1 { font-size: 2.5rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  header .wrap {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  nav {
    justify-content: center;
  }

  .container { padding: 16px; }
  .card { padding: 20px; }

  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 2rem; }
  .hero h2 { font-size: 1.1rem; }

  .col-6, .col-4, .col-3 { grid-column: span 12; }

  .cookie-banner {
    bottom: 10px;
    padding: 16px;
    max-width: none;
    width: calc(100% - 20px);
  }

  .cookie-banner p {
    font-size: 0.85em;
  }

  .cookie-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cookie-actions .btn {
    width: 100%;
    min-width: auto;
  }

  pre {
    padding: 16px;
    font-size: 0.85em;
  }

  table {
    font-size: 0.9em;
  }
  th, td {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  nav a {
    padding: 6px 10px;
    font-size: 0.9em;
  }
  
  .hero h1 { font-size: 1.75rem; }
  .hero h2 { font-size: 1rem; }
  .hero p { font-size: 1rem; }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9em;
  }
  
  .cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-actions .btn {
    width: 100%;
  }
  
  pre {
    margin: 16px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Print Styles */
@media print {
  header, footer, .cookie-banner, .ad-container {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  pre {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #ffffff;
    --text: #ffffff;
    --bg: #000000;
    --card: #111111;
  }
}

/* Dark mode is default, but support for light mode preference */
@media (prefers-color-scheme: light) {
  /* Users who prefer light mode can override with custom CSS */
}

.none {
  display: none;
}

/* ===== SYNTAX HIGHLIGHTING CLASSES ===== */

/* Base colors */
.keyword {
  color: #a78bfa; /* Purple for keywords */
  font-weight: 600;
}

.comment {
  color: #6b7280; /* Gray for comments */
  font-style: italic;
}

.string {
  color: #86efac; /* Light green for strings */
}

.string.template-literal {
  color: #fbbf24; /* Yellow for template literals */
}

.function {
  color: #60a5fa; /* Blue for functions */
  font-weight: 500;
}

.variable {
  color: #fbbf24; /* Yellow for variables */
}

.number {
  color: #fb7185; /* Pink for numbers */
  font-weight: 500;
}

/* Classes and types */
.class-name {
  color: #4ade80; /* Green for custom classes */
  font-weight: 600;
}

.type {
  color: #34d399; /* Teal for built-in types */
  font-weight: 500;
}

.interface {
  color: #22d3ee; /* Cyan for interfaces */
  font-weight: 500;
}

/* Language-specific elements */

/* Python */
.decorator {
  color: #f472b6; /* Pink for decorators */
  font-weight: 500;
}

.module {
  color: #a3a3a3; /* Light gray for modules */
}

/* Java */
.annotation {
  color: #f472b6; /* Pink for annotations */
  font-weight: 500;
}

.package {
  color: #9ca3af; /* Gray for packages */
}

/* C# */
.attribute {
  color: #f472b6; /* Pink for attributes */
  font-weight: 500;
}

.namespace {
  color: #9ca3af; /* Gray for namespaces */
}

.property {
  color: #60a5fa; /* Blue for properties */
  font-weight: 500;
}

/* PHP */
.php-tag {
  color: #a78bfa; /* Purple for PHP tags */
  font-weight: 600;
}

.constant {
  color: #fb923c; /* Orange for constants */
  font-weight: 600;
}

/* Visual enhancements */
.class-name:hover,
.type:hover,
.function:hover {
  text-shadow: 0 0 8px currentColor;
  transition: text-shadow 0.2s ease;
}

.keyword.important {
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
}

code .class-name,
code .type,
code .function {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

/* Responsive */
@media (max-width: 768px) {
  .class-name,
  .type,
  .function {
    font-size: 0.9em;
  }
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .keyword { color: #c4b5fd; }
  .string { color: #bbf7d0; }
  .comment { color: #9ca3af; }
  .class-name { color: #6ee7b7; }
  .type { color: #5eead4; }
  .function { color: #93c5fd; }
  .number { color: #fda4af; }
}

/* Prism.js integration (if used) */
.token.class-name { color: #4ade80 !important; }
.token.type { color: #34d399 !important; }
.token.function { color: #60a5fa !important; }
.token.decorator { color: #f472b6 !important; }
.token.annotation { color: #f472b6 !important; }
.token.attribute { color: #f472b6 !important; }
.token.namespace { color: #9ca3af !important; }
.token.package { color: #9ca3af !important; }
.token.module { color: #a3a3a3 !important; }
.token.constant { color: #fb923c !important; }
.token.php-tag { color: #a78bfa !important; }
