/* ===== Mobile Performance & Fixes ===== */

/* Efeitos de circuito APENAS no navbar no mobile */
@media (max-width: 767px) {
  /* Remove efeitos FORA do navbar no mobile */
  .animated-bg,
  .particles-container,
  .floating-shapes,
  section .circuit-line,
  section .circuit-pulse,
  section .circuit-node {
    display: none !important;
    animation: none !important;
  }

  /* MANTÉM os efeitos de circuito DENTRO do navbar no mobile */
  .navbar .navbar-circuit-bg,
  .navbar .circuit-line,
  .navbar .circuit-pulse,
  .navbar .data-particle,
  .navbar .energy-pulse,
  .navbar .vertical-line,
  .navbar .tech-grid,
  .navbar .circuit-node {
    display: block !important;
  }

  /* Reduz a quantidade de elementos animados no navbar mobile para performance */
  .navbar .circuit-node:nth-child(n + 4),
  .navbar .data-particle:nth-child(n + 2),
  .navbar .vertical-line:nth-child(n + 2),
  .navbar .energy-pulse:nth-child(n + 2) {
    display: none !important;
  }

  /* Animações mais leves no navbar mobile */
  .navbar .circuit-line,
  .navbar .circuit-pulse,
  .navbar .tech-grid {
    animation-duration: 20s !important;
  }

  .navbar .circuit-node {
    animation-duration: 3s !important;
  }

  .navbar .data-particle {
    animation-duration: 8s !important;
  }

  /* Navbar com fundo escuro */
  .navbar {
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(10px) !important;
  }

  /* Remove animações pesadas FORA do navbar */
  section *,
  .hero *,
  .services *,
  .projects *,
  .testimonials *,
  .blog *,
  .contact *,
  .footer * {
    animation-duration: 0.3s !important;
  }

  /* Permite transições essenciais */
  .btn,
  .card,
  a,
  .service-card-tech {
    transition-duration: 0.2s !important;
  }

  /* Footer links - área de toque maior */
  .footer-link-mobile {
    display: block;
    padding: 12px 16px;
    margin: -8px -16px;
    min-height: 44px;
    line-height: 1.4;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    touch-action: manipulation;
  }

  .footer-link-mobile:active {
    background: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
  }

  .footer-links {
    gap: 0 !important;
  }

  .footer-links li {
    padding: 4px 0;
  }

  /* Social links maiores */
  .social-link-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    touch-action: manipulation;
  }

  .social-link-mobile:active {
    background: rgba(37, 99, 235, 0.15);
    border-radius: 50%;
  }

  .social-link-mobile .icon {
    width: 24px;
    height: 24px;
  }

  /* Footer grid responsivo */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 1rem;
  }

  /* Hero section mais leve */
  .hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  /* Reduz tamanho de fontes no hero */
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Cards de serviço otimizados - sem animações */
  .service-card-tech {
    padding: 1.5rem;
  }

  .service-card-circuit {
    display: none !important;
  }

  .service-card-tech {
    animation: none !important;
  }

  .service-card-tech:active {
    transform: scale(0.98);
    border-color: rgba(6, 182, 212, 0.4);
  }

  /* Scroll suave nativo */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Previne zoom indesejado em inputs */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Simplifica ícones no mobile */
  .service-icon-tech {
    width: 3.5rem;
    height: 3.5rem;
  }

  .service-icon-tech svg {
    width: 2rem;
    height: 2rem;
  }

  /* Remove animações dos ícones de serviço */
  .service-icon-tech .icon-pulse,
  .service-icon-tech .icon-scan,
  .service-icon-tech .icon-line,
  .service-icon-tech .icon-line-2,
  .service-icon-tech .icon-gear,
  .service-icon-tech .icon-core {
    animation: none !important;
  }

  .icon-ring {
    display: none !important;
  }

  /* Blog cards otimizados */
  .blog-card {
    margin-bottom: 1rem;
  }

  .blog-image-wrapper {
    height: 180px;
  }
}

/* ===== Tablet - efeitos reduzidos ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  .circuit-node:nth-child(n + 4),
  .data-particle:nth-child(n + 3),
  .vertical-line:nth-child(n + 2) {
    display: none;
  }

  .navbar-circuit-bg,
  .circuit-line,
  .circuit-pulse {
    animation-duration: 15s !important;
  }
}

/* ===== Desktop - efeitos completos ===== */
@media (min-width: 1024px) {
  /* Todos os efeitos funcionam normalmente no desktop */
  .navbar-circuit-bg,
  .circuit-line,
  .circuit-pulse,
  .data-particle,
  .energy-pulse,
  .vertical-line,
  .tech-grid,
  .circuit-node {
    display: block;
  }
}

/* ===== Service Cards - Efeito Tecnológico (Desktop) ===== */

.service-card-tech {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Circuitos dentro do card */
.service-card-circuit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service-card-tech:hover .service-card-circuit,
.service-card-tech.active .service-card-circuit {
  opacity: 1;
}

.service-card-circuit .circuit-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent);
  height: 1px;
}

.service-card-circuit .circuit-line-1 {
  top: 20%;
  left: 0;
  right: 0;
  animation: circuitScan 3s ease-in-out infinite;
}

.service-card-circuit .circuit-line-2 {
  bottom: 30%;
  left: 0;
  right: 0;
  animation: circuitScan 3s ease-in-out infinite 1.5s;
}

.service-card-circuit .circuit-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 10px #06b6d4, 0 0 20px #06b6d4;
  animation: nodePulse 2s ease-in-out infinite;
}

.service-card-circuit .circuit-node-1 {
  top: 20%;
  right: 15%;
  animation-delay: 0s;
}

.service-card-circuit .circuit-node-2 {
  bottom: 30%;
  left: 20%;
  animation-delay: 0.5s;
}

.service-card-circuit .circuit-node-3 {
  top: 50%;
  right: 30%;
  animation-delay: 1s;
}

.service-card-circuit .circuit-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 50%;
  animation: cardPulseExpand 2s ease-out infinite;
}

@keyframes circuitScan {
  0%,
  100% {
    opacity: 0;
    transform: scaleX(0);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

@keyframes cardPulseExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Ícone tecnológico */
.service-icon-tech {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.service-icon-tech svg {
  width: 2.5rem;
  height: 2.5rem;
  transition: all 0.4s ease;
}

/* Cores dos ícones */
.service-icon-tech.service-icon-cyan-blue {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.service-icon-tech.service-icon-cyan-blue svg {
  stroke: #06b6d4;
}

.service-icon-tech.service-icon-emerald-cyan {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.service-icon-tech.service-icon-emerald-cyan svg {
  stroke: #10b981;
}

.service-icon-tech.service-icon-purple-pink {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.service-icon-tech.service-icon-purple-pink svg {
  stroke: #a855f7;
}

.service-icon-tech.service-icon-orange-red {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(239, 68, 68, 0.15));
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.service-icon-tech.service-icon-orange-red svg {
  stroke: #f97316;
}

.service-icon-tech.service-icon-blue-cyan {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.service-icon-tech.service-icon-blue-cyan svg {
  stroke: #3b82f6;
}

.service-icon-tech.service-icon-yellow-orange {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.service-icon-tech.service-icon-yellow-orange svg {
  stroke: #eab308;
}

/* Anel de energia ao redor do ícone */
.icon-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid transparent;
  border-radius: 1.25rem;
  opacity: 0;
  transition: all 0.4s ease;
}

.service-card-tech:hover .icon-ring,
.service-card-tech.active .icon-ring {
  opacity: 1;
  border-color: currentColor;
  animation: ringRotate 3s linear infinite;
}

.service-icon-cyan-blue .icon-ring {
  border-color: rgba(6, 182, 212, 0.5);
}
.service-icon-emerald-cyan .icon-ring {
  border-color: rgba(16, 185, 129, 0.5);
}
.service-icon-purple-pink .icon-ring {
  border-color: rgba(168, 85, 247, 0.5);
}
.service-icon-orange-red .icon-ring {
  border-color: rgba(249, 115, 22, 0.5);
}
.service-icon-blue-cyan .icon-ring {
  border-color: rgba(59, 130, 246, 0.5);
}
.service-icon-yellow-orange .icon-ring {
  border-color: rgba(234, 179, 8, 0.5);
}

@keyframes ringRotate {
  0% {
    transform: rotate(0deg);
    border-width: 2px 2px 0 0;
  }
  25% {
    border-width: 0 2px 2px 0;
  }
  50% {
    transform: rotate(180deg);
    border-width: 0 0 2px 2px;
  }
  75% {
    border-width: 2px 0 0 2px;
  }
  100% {
    transform: rotate(360deg);
    border-width: 2px 2px 0 0;
  }
}

/* Animações nos ícones SVG */
.service-icon-tech .icon-pulse {
  animation: iconPulse 2s ease-in-out infinite;
  transform-origin: center;
}

.service-icon-tech .icon-scan {
  animation: iconScan 2s ease-in-out infinite;
}

.service-icon-tech .icon-line {
  animation: iconLineGrow 2s ease-in-out infinite;
}

.service-icon-tech .icon-line-2 {
  animation: iconLineGrow 2s ease-in-out infinite 0.3s;
}

.service-icon-tech .icon-gear {
  animation: iconGear 4s linear infinite;
  transform-origin: center;
}

.service-icon-tech .icon-core {
  animation: iconCore 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    r: 2;
    opacity: 0.5;
  }
  50% {
    r: 4;
    opacity: 1;
  }
}

@keyframes iconScan {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes iconLineGrow {
  0%,
  100% {
    stroke-dasharray: 0 20;
  }
  50% {
    stroke-dasharray: 20 0;
  }
}

@keyframes iconGear {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes iconCore {
  0%,
  100% {
    fill: transparent;
  }
  50% {
    fill: currentColor;
  }
}

/* Hover e Active states do card */
.service-card-tech:hover,
.service-card-tech.active {
  transform: translateY(-8px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 20px 40px rgba(6, 182, 212, 0.15), 0 0 30px rgba(6, 182, 212, 0.1), inset 0 1px 0
    rgba(255, 255, 255, 0.1);
}

.service-card-tech:hover .service-icon-tech,
.service-card-tech.active .service-icon-tech {
  transform: scale(1.1);
}

.service-card-tech:hover .service-icon-tech svg,
.service-card-tech.active .service-icon-tech svg {
  filter: drop-shadow(0 0 8px currentColor);
}

/* Indicador de destaque */
.service-highlight {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.service-card-tech:hover .service-highlight,
.service-card-tech.active .service-highlight {
  opacity: 1;
  transform: translateX(0);
}

.highlight-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: highlightPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px #10b981;
}

.highlight-text {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes highlightPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Auto-destaque rotativo (apenas desktop) */
@media (min-width: 1024px) {
  .service-card-tech[data-index="0"] {
    animation: cardHighlight 12s ease-in-out infinite 0s;
  }
  .service-card-tech[data-index="1"] {
    animation: cardHighlight 12s ease-in-out infinite 2s;
  }
  .service-card-tech[data-index="2"] {
    animation: cardHighlight 12s ease-in-out infinite 4s;
  }
  .service-card-tech[data-index="3"] {
    animation: cardHighlight 12s ease-in-out infinite 6s;
  }
  .service-card-tech[data-index="4"] {
    animation: cardHighlight 12s ease-in-out infinite 8s;
  }
  .service-card-tech[data-index="5"] {
    animation: cardHighlight 12s ease-in-out infinite 10s;
  }
}

@keyframes cardHighlight {
  0%,
  15%,
  100% {
    transform: translateY(0);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  5%,
  10% {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 15px 30px rgba(6, 182, 212, 0.1), 0 0 20px rgba(6, 182, 212, 0.05);
  }
}

/* ===== Article Pages Styles ===== */

.article-page {
  padding-top: 80px;
  min-height: 100vh;
  background: var(--background);
}

.article-header {
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
}

.article-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--primary);
}

.article-category {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.article-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.author-name {
  display: block;
  font-weight: 600;
  color: white;
}

.article-date {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.read-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.article-hero-image {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
}

.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  padding: 3rem 0;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
}

.article-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.article-content li {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-highlight {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
  border-left: 4px solid var(--primary);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.article-highlight p {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text-primary);
  margin: 0;
}

.code-block {
  background: #1e293b;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-header {
  background: #334155;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  font-family: monospace;
}

.code-block pre {
  padding: 1.5rem;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.info-box h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}

.info-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.info-box li {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.comparison-table {
  margin: 2rem 0;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-table td {
  color: var(--text-secondary);
}

.article-cta {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 0.75rem;
}
