/* =========================================================
   🛰️ PWA INSTALL BANNER - MISSION CONTROL EDITION
   Paleta: Corporate Tech / Military Ops
   ========================================================= */

.install-banner.cyber-banner {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  width: min(92%, 540px);
  background: 
    linear-gradient(135deg, 
      rgba(61, 82, 102, 0.98) 0%,   /* #3d5266 base */
      rgba(93, 120, 145, 0.95) 100% /* #5d7891 slate */
    );
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(120, 165, 206, 0.4); /* #78a5ce */
  border-radius: 4px;
  padding: 0;
  z-index: 9999;
  display: none;
  opacity: 0;
  overflow: hidden;
  font-family: 'Space Grotesk', 'Courier New', monospace;
  box-shadow: 
    0 0 0 1px rgba(141, 153, 164, 0.2),
    0 10px 40px rgba(61, 82, 102, 0.5),
    0 0 60px rgba(93, 120, 145, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: 
    transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
    opacity 0.5s ease-out;
}

/* Animação de Entrada "System Boot" */
.install-banner.cyber-banner.show {
  display: block;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  animation: bootSequence 0.8s ease-out;
}

@keyframes bootSequence {
  0% {
    transform: translateX(-50%) translateY(150px) scale(0.95);
    opacity: 0;
    filter: brightness(1.5) contrast(1.2);
  }
  50% {
    filter: brightness(1.1) contrast(1.05);
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
}

/* ===== SCANLINES (Efeito sutil de monitor profissional) ===== */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 2;
  animation: scanFlicker 0.15s infinite;
}

@keyframes scanFlicker {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.4; }
}

/* ===== MATRIX GRID (Grade tática) ===== */
.matrix-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(120, 165, 206, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 165, 206, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* ===== GLOW EXTERNO (Brilfo sutil) ===== */
.cyber-glow {
  position: absolute;
  inset: -2px;
  border-radius: 4px;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(120, 165, 206, 0.25) 50%, 
    transparent 70%);
  background-size: 200% 200%;
  animation: glowSlide 4s linear infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

@keyframes glowSlide {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ===== STATUS BAR (Barra de status profissional) ===== */
.status-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #2d4a64;
  border-bottom: 1px solid rgba(120, 165, 206, 0.25);
  font-size: 0.7rem;
  color: #8d99a4;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.red { 
  background: #c86b6b; 
  box-shadow: 0 0 6px rgba(200, 107, 107, 0.6); 
}
.status-dot.yellow { 
  background: #d4a862; 
  box-shadow: 0 0 6px rgba(212, 168, 98, 0.6); 
}
.status-dot.green { 
  background: #78a5ce; 
  box-shadow: 0 0 8px rgba(120, 165, 206, 0.7); 
}
.status-dot.pulse {
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.25); }
}

.status-text {
  flex: 1;
  color: #fff;
  font-weight: 600;
  letter-spacing: 2px;
}

.status-tag {
  padding: 2px 8px;
  background: rgba(120, 165, 206, 0.15);
  color: #78a5ce;
  border: 1px solid rgba(120, 165, 206, 0.5);
  border-radius: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  animation: tagBlink 4s infinite;
}

@keyframes tagBlink {
  0%, 92%, 100% { opacity: 1; }
  96% { opacity: 0.4; }
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.install-content {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 22px 18px 16px;
}

/* ===== LOGO HOLOGRÁFICO (Versão corporativa) ===== */
.cyber-logo-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.cyber-logo {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(120, 165, 206, 0.5);
  box-shadow: 
    0 4px 20px rgba(61, 82, 102, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  filter: drop-shadow(0 0 8px rgba(120, 165, 206, 0.3));
  animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { 
    transform: translateY(0);
    filter: drop-shadow(0 0 8px rgba(120, 165, 206, 0.3));
  }
  50% { 
    transform: translateY(-3px);
    filter: drop-shadow(0 0 15px rgba(120, 165, 206, 0.5));
  }
}

.logo-glitch {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(45deg, 
    transparent 40%, 
    rgba(120, 165, 206, 0.08) 50%, 
    transparent 60%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: glitchShine 4s infinite;
}

@keyframes glitchShine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    #78a5ce, 
    transparent);
  box-shadow: 0 0 8px rgba(120, 165, 206, 0.6);
  animation: scanMove 3s linear infinite;
  opacity: 0.6;
}

@keyframes scanMove {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ===== TERMINAL TEXT (Versão corporativa) ===== */
.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', monospace;
}

.prompt {
  color: #78a5ce;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 0 6px rgba(120, 165, 206, 0.5);
}

.glitch-text {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  position: relative;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Glitch mais sutil — usa tons da paleta em vez de magenta/ciano */
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch-text::before {
  color: #5d7891;
  animation: glitch1 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  opacity: 0.6;
}

.glitch-text::after {
  color: #78a5ce;
  animation: glitch2 3.5s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  opacity: 0.6;
}

@keyframes glitch1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(-1px, -1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(1px, -1px); }
}

@keyframes glitch2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(1px, -1px); }
  40% { transform: translate(1px, 1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(-1px, 1px); }
}

.cursor-blink {
  color: #78a5ce;
  font-weight: 700;
  animation: blink 1.2s infinite;
  text-shadow: 0 0 6px rgba(120, 165, 206, 0.6);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ===== INFO ITEMS ===== */
.cyber-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.info-item {
  color: #8d99a4;
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-icon {
  filter: drop-shadow(0 0 3px rgba(120, 165, 206, 0.4));
}

/* ===== STATS ===== */
.cyber-stats {
  display: flex;
  gap: 6px;
  font-size: 0.65rem;
  color: rgba(120, 165, 206, 0.7);
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.divider {
  color: rgba(141, 153, 164, 0.3);
}

/* ===== BOTÃO TACTICAL (Estilo comando militar) ===== */
.cyber-btn {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(120, 165, 206, 0.15) 0%, 
    rgba(93, 120, 145, 0.25) 100%);
  border: 1px solid #78a5ce;
  color: #fff;
  padding: 12px 22px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 
    0 0 15px rgba(120, 165, 206, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  clip-path: polygon(
    8px 0, 100% 0, 100% calc(100% - 8px), 
    calc(100% - 8px) 100%, 0 100%, 0 8px
  );
}

.cyber-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(120, 165, 206, 0.25), 
    transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.cyber-btn:hover {
  background: linear-gradient(135deg, #78a5ce 0%, #5d7891 100%);
  color: #fff;
  border-color: #fff;
  box-shadow: 
    0 0 25px rgba(120, 165, 206, 0.6),
    0 0 50px rgba(120, 165, 206, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cyber-btn:hover::before {
  transform: translateX(100%);
}

.cyber-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 0 15px rgba(120, 165, 206, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-glitch {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d7891;
  opacity: 0;
  pointer-events: none;
  animation: btnGlitch 5s infinite;
}

@keyframes btnGlitch {
  0%, 97%, 100% { opacity: 0; transform: translate(0); }
  98% { opacity: 0.5; transform: translate(-1px, 1px); }
  99% { opacity: 0.5; transform: translate(1px, -1px); }
}

.btn-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  font-size: 0.9rem;
  color: #78a5ce;
  transition: color 0.3s;
}

.cyber-btn:hover .btn-icon {
  color: #fff;
}

/* ===== BOTÃO FECHAR (Estilo tactical abort) ===== */
.cyber-close {
  background: transparent;
  border: 1px solid rgba(141, 153, 164, 0.4);
  color: #8d99a4;
  font-family: 'Space Grotesk', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s;
  line-height: 1;
}

.cyber-close:hover {
  background: rgba(141, 153, 164, 0.15);
  border-color: #8d99a4;
  color: #fff;
  box-shadow: 0 0 10px rgba(141, 153, 164, 0.3);
  transform: scale(1.05);
}

.close-bracket {
  color: rgba(141, 153, 164, 0.5);
  font-size: 0.9rem;
}

/* ===== BARRA DE PROGRESSO ===== */
.progress-bar {
  position: relative;
  z-index: 3;
  height: 3px;
  background: rgba(61, 82, 102, 0.6);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, 
    transparent, 
    #78a5ce, 
    transparent);
  animation: progressSlide 2.5s linear infinite;
  box-shadow: 0 0 8px rgba(120, 165, 206, 0.6);
}

@keyframes progressSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress-text {
  position: absolute;
  right: 10px;
  font-size: 0.6rem;
  color: #78a5ce;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 1.5px;
  opacity: 0.7;
  text-transform: uppercase;
}

/* ===== CÓDIGO BINÁRIO ===== */
.binary-bg {
  position: absolute;
  bottom: 8px;
  left: 14px;
  font-size: 0.55rem;
  color: rgba(120, 165, 206, 0.25);
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 2px;
  z-index: 3;
  pointer-events: none;
  animation: binaryFlicker 6s infinite;
}

@keyframes binaryFlicker {
  0%, 95%, 100% { opacity: 0.4; }
  97% { opacity: 0.9; }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 600px) {
  .install-banner.cyber-banner {
    width: calc(100% - 24px);
    bottom: 12px;
  }
  
  .install-content {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 18px 14px 14px;
  }
  
  .cyber-logo-wrapper {
    width: 50px;
    height: 50px;
    grid-row: 1;
    grid-column: 1;
  }
  
  .install-text {
    grid-row: 1;
    grid-column: 2;
  }
  
  .glitch-text {
    font-size: 0.95rem;
  }
  
  .cyber-info,
  .cyber-stats {
    font-size: 0.6rem;
  }
  
  .cyber-btn {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 14px;
  }
  
  .cyber-close {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    align-self: start;
    margin-top: -4px;
    margin-right: -4px;
  }
  
  .binary-bg {
    display: none;
  }
  
  .status-bar {
    font-size: 0.6rem;
    padding: 6px 10px;
  }
  
  .status-text {
    font-size: 0.6rem;
  }
  
  .progress-text {
    display: none;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .install-banner.cyber-banner,
  .scanlines,
  .logo-glitch,
  .scan-line,
  .cyber-glow,
  .glitch-text::before,
  .glitch-text::after,
  .btn-glitch,
  .progress-fill,
  .status-dot.pulse,
  .cursor-blink {
    animation: none !important;
  }
  
  .scanlines { opacity: 0.2; }
  .logo-glitch { display: none; }
}