/* public/style.css */

/*
  Define a cor da grelha como uma variável CSS.
  Isto permite que a cor mude dinamicamente com o tema.
*/
:root {
  /* Cor padrão (para o tema claro): linhas cinzentas muito subtis */
  --grid-line-color: rgba(0, 0, 0, 0.05); 
}

html.dark {
  /* Cor para o tema escuro: linhas brancas subtis */
  --grid-line-color: rgba(255, 255, 255, 0.05); 
}

.background-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Usa a variável CSS para definir a cor das linhas */
  background-image:
      linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
      linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
  background-size: 40px 40px; 
  z-index: 0; 
}

body {
  position: relative;
}

/* Glow utility ---------------------------------------------------------- */
:root {
  --glow-border-width: 1px;
}

.glow-surface,
.glow-card {
  position: relative;
  z-index: 0;
  border-style: solid;
  border-width: var(--glow-border-width, 1px);
  border-color: rgba(148, 163, 184, 0.25);
  overflow: visible;
  transition: transform 0.05s ease, box-shadow 0.05s ease,
    border-color 22 ease, background-color 22 ease;
}

.glow-surface::before,
.glow-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(
      circle at var(--glow-pos-x, 30%) var(--glow-pos-y, 25%),
      var(--glow-accent-primary, rgba(59, 130, 246, 0.65)),
      transparent 55%
    ),
    radial-gradient(
      circle at
        var(--glow-pos-secondary-x, 75%)
        var(--glow-pos-secondary-y, 75%),
      var(--glow-accent-secondary, rgba(14, 165, 233, 0.35)),
      transparent 60%
    );
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: -1;
  pointer-events: none;
}

.glow-surface::after,
.glow-card::after {
  content: "";
  position: absolute;
  inset: -24px;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--glow-pos-x, 50%) var(--glow-pos-y, 50%),
    var(--glow-accent-primary, rgba(59, 130, 246, 0.7)) 0%,
    transparent 70%
  );
  opacity: 0;
  filter: blur(38px);
  z-index: -2;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.glow-surface:hover,
.glow-card:hover,
.glow-surface:focus-visible,
.glow-card:focus-visible,
.glow-surface.glow-active,
.glow-card.glow-active {
  /* transform: translateY(-3px); */
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22),
    0 12px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.glow-surface:hover::before,
.glow-card:hover::before,
.glow-surface:focus-visible::before,
.glow-card:focus-visible::before,
.glow-surface.glow-active::before,
.glow-card.glow-active::before {
  opacity: 0.9;
  transform: scale(1);
}

.glow-surface:hover::after,
.glow-card:hover::after,
.glow-surface:focus-visible::after,
.glow-card:focus-visible::after,
.glow-surface.glow-active::after,
.glow-card.glow-active::after {
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .glow-surface,
  .glow-card,
  .glow-surface::before,
  .glow-surface::after,
  .glow-card::before,
  .glow-card::after {
    transition: none;
    transform: none;
  }
}

.glow-blue {
  --glow-accent-primary: rgba(59, 130, 246, 0.8);
  --glow-accent-secondary: rgba(129, 140, 248, 0.55);
}

.glow-green {
  --glow-accent-primary: rgba(16, 185, 129, 0.75);
  --glow-accent-secondary: rgba(34, 197, 94, 0.45);
}

.glow-emerald {
  --glow-accent-primary: rgba(52, 211, 153, 0.85);
  --glow-accent-secondary: rgba(16, 185, 129, 0.45);
}

.glow-purple {
  --glow-accent-primary: rgba(168, 85, 247, 0.85);
  --glow-accent-secondary: rgba(129, 140, 248, 0.4);
}

.glow-amber {
  --glow-accent-primary: rgba(251, 191, 36, 0.75);
  --glow-accent-secondary: rgba(251, 146, 60, 0.45);
}

.glow-slate {
  --glow-accent-primary: rgba(148, 163, 184, 0.6);
  --glow-accent-secondary: rgba(71, 85, 105, 0.45);
}

.glow-card {
  border-radius: 1rem;
}

.glow-borderless {
  --glow-border-width: 0px;
}

/* Logo adapta cor conforme tema (claro = preto, escuro = branco) */
img[src*="xf9WpWE_d.webp"],
img.logo-auto-invert {
  filter: grayscale(1) brightness(0) contrast(1.25);
  transition: filter 0.2s ease;
}
html.dark img[src*="xf9WpWE_d.webp"],
html.dark img.logo-auto-invert {
  filter: grayscale(1) brightness(12) contrast(1.1);
}

/* Designi logo: texto segue o tema, ícone mantém gradiente original */
:root {
  --designi-text-color: #0f172a;
}
html.dark {
  --designi-text-color: #f8fafc;
}
.designi-logo {
  display: inline-flex;
  align-items: center;
  height: 50px;
}
.designi-logo svg {
  height: 100%;
  width: auto;
  color: var(--designi-text-color);
}

/* Envato logo: ícone verde do PNG base + texto re-colorido via mask */
:root {
  --envato-text-color: #111827; /* claro: texto preto */
}
html.dark {
  --envato-text-color: #ffffff; /* escuro: texto branco */
}
.envato-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  color: var(--envato-text-color);
}
.envato-logo-base {
  display: block;
  height: 100%;
  width: auto;
  position: relative;
  z-index: 1;
}
.envato-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  mask-image: url("/assets/img/Envato-Logo-New-mask.png");
  -webkit-mask-image: url("/assets/img/Envato-Logo-New-mask.png");
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  mask-size: contain;
  -webkit-mask-size: contain;
  pointer-events: none;
  z-index: 2;
}
