/*===========================
=        GERAL             =
===========================*/

body {
  background: #0d0d0d;
  color: #33ff33;
  font-family: monospace;
  padding: 2rem;
  font-size: 1.2rem;
}

* {
  user-select: none;
}

/* Terminal principal */
#terminal {
  display: block;
  max-width: 800px;
  margin: auto;
  white-space: pre-wrap;
}

/*============================
=        TERMINAL            =
============================*/

.input-line {
  display: flex;
}

.prompt {
  margin-right: 0.5rem;
}

.cmd-input {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  outline: none;
  width: 100%;
}

/* Cursor piscando */
@keyframes blink {
  50% { opacity: 0; }
}

.cursor {
  animation: blink 1s step-start infinite;
}

/*===============================
=          RESPONSIVO           =
===============================*/

@media (max-width: 600px) {
  body {
    font-size: 0.9rem;
    padding: 1rem;
  }

  .about-container {
    flex-direction: column;
    align-items: center;
    text-align: justify;
    gap: 16px;
  }

  .about-img {
    width: 100%;
    max-width: 250px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: auto;
  }

  .about-text-terminal {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0;
  }

  .project-img {
    width: 100%;
    max-width: 300px;
  }

  .project-text {
    font-size: 0.95rem;
    line-height: 1.5;
  }

    .contact-container {
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
  }

  .contact-input, .contact-textarea {
    width: 100%;
    font-size: 0.9rem;
    padding: 6px 8px;
  }

  .contact-btn {
    width: 100%;
    padding: 8px;
    font-size: 0.95rem;
  }

  .char-count {
    font-size: 0.8rem;
    text-align: right;
  }
}

/*===============================
=      ANIMAÇÕES GERAIS         =
===============================*/

/* Efeito de glitch */
.glitch-out {
  animation: glitchFade 0.3s ease-out forwards;
}

@keyframes glitchFade {
  0% {
    opacity: 1;
    transform: translate(0, 0);
    filter: blur(0);
  }
  50% {
    opacity: 0.5;
    transform: translate(-2px, 1px);
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: translate(2px, -1px);
    filter: blur(2px);
  }
}

/* Animação de entrada (fade + leve subida) */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Classe para aplicar a animação de entrada */
.fade-in {
  animation: fadeInUp 0.6s ease-out both;
}

/*===============================
=         HOVER ZOOM            =
===============================*/

/* Efeito hover com brilho verde no contorno e zoom */
img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px 5px #00ff00; /* Glow verde mais forte no hover */
  transition: all 0.3s ease-in-out;
  cursor: zoom-in;
  z-index: 2;
}

/*===============================
=          MODAL ZOOM           =
===============================*/

/* Overlay para modal de imagem ao clicar */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px); /* Desfoca fundo */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Imagem dentro do modal */
.image-modal-overlay img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 30px #00ff00;
  border-radius: 10px;
  border: 2px solid #00ff00;
  animation: fadeInZoom 0.3s ease-out;
}

/* Animação de entrada do modal (zoom e fade) */
@keyframes fadeInZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/*==================================
=        COMPONENTES VARIADOS       =
===================================*/

/* Submenus de terminal */
.submenu-entry {
  color: #00ffff;
  margin-left: 1rem;
}

/* Canal do projeto */
.project-channel {
  color: #ff9933;
  font-weight: bold;
  margin-top: 0.5rem;
}

/* Entrada de projeto (estilo terminal) */
.project-entry {
  margin-left: 2rem;
  color: #66ff66;
  margin-bottom: 0.3rem;
}

/* Garante empilhamento correto do histórico e da linha de input */
#history {
  position: relative;
  z-index: 1;
}

.input-line {
  position: relative;
  z-index: 2;
}

/*===============================
=          ABOUT SECTION        =
===============================*/

.about-container {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.about-img {
  width: 180px;
  border: 2px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 10px 2px #00ff0077;
  transition: all 0.3s ease-in-out;
}

.about-text-terminal {
  pointer-events: auto;
  max-width: 500px;
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.6;
  color: #00ff00;
  margin-top: 20px;
}

.about-text-terminal a {
  color: #00ff00;
  transition: color 0.2s ease-in-out;
  text-decoration: none;
}

.about-text-terminal a:hover {
  color: #00ffcc;
  border-bottom: 1px solid #00ffcc;
  text-shadow: 0 0 8px #00ffcc;
}

.copy-btn {
  margin-left: 8px;
  padding: 4px 10px;
  font-family: monospace;
  background-color: #000;
  color: #00ff00;
  border: 1px solid #00ff00;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background-color: #00ff00;
  color: #000;
}

/*===============================
=         PROJETOS SECTION      =
===============================*/

.project-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
  gap: 16px;
}

.project-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  border: 2px solid #00ff00;
  border-radius: 8px;
  box-shadow: 0 0 10px 2px #00ff0077;
  transition: all 0.3s ease-in-out;
}

.project-text {
  max-width: 700px;
  font-size: 1rem;
  line-height: 1.6;
  color: #00ff00;
  text-align: justify;
  white-space: pre-wrap;
}

.project-video {
  display: block;
  max-width: 100%;
  margin-top: 16px;
  box-shadow: 0 0 10px #00ff0077;
  border: 2px solid #00ff00;
  border-radius: 8px;
}

/*===============================
=        IMAGENS GENÉRICAS      =
===============================*/

/* Imagens adicionais fora de projeto/about */
.project-image {
  display: inline-block;
  margin-top: 0.5rem;
  border: 1px solid #33ff33;
  padding: 0.25rem;
  max-width: 90%;
  background-color: #000;
  color: #33ff33;
  font-size: 0.9rem;
  font-style: italic;
}

/*===============================
=            Pop Up            =
===============================*/

#copyPopup {
  visibility: hidden;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #33ff33;
  color: #141414;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: monospace;
  font-weight: bold;
  box-shadow: 0 0 10px #33ff33aa;
  z-index: 9999;
  transition: visibility 0s linear 0.3s, opacity 0.3s ease;
  opacity: 0;
}

#copyPopup.show {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

/*===============================
=            Contact           =
===============================*/

.contact-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  max-width: 550px;
}

.contact-input, .contact-textarea {
  background: #000;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: monospace;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s ease;
}

.contact-input:focus, .contact-textarea:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 6px #00ffcc;
}

.contact-textarea {
  resize: none; /* ✅ não pode redimensionar */
  min-height: 100px;
  max-height: 100px;
}

.contact-btn {
  align-self: flex-start;
  padding: 6px 14px;
  font-family: monospace;
  background: #000;
  border: 1px solid #33ff33;
  color: #33ff33;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.contact-btn:hover {
  background: #33ff33;
  color: #000;
  box-shadow: 0 0 10px #33ff33;
}

.contact-feedback {
  font-size: 0.9rem;
  margin-top: 4px;
}

.char-count {
  font-size: 0.85rem;
  color: #999;
  margin-top: -8px;
}

.contact-input.invalid, .contact-textarea.invalid {
  border-color: red;
}

.contact-input.valid, .contact-textarea.valid {
  border-color: #33ff33;
}

/*===============================
=   LINK PORTFÓLIO + TOOLTIP    =
===============================*/

.portfolio-link {
  position: relative;
  color: #00ff00;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  display: inline-block;
  animation: glitch 2s infinite; /* aumento da duração para glitch mais lento */
}

.portfolio-link:hover {
  color: #00ffcc;
  text-shadow: 0 0 6px #00ffcc;
}

/* Tooltip */
.tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-5px) rotate(-3deg);
  position: absolute;
  bottom: 120%;
  left: 50%;
  background: #000;
  color: #00ff00;
  padding: 6px 10px;
  border: 1px solid #00ff00;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 0 8px #00ff00aa;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #000;
  border-left: 1px solid #00ff00;
  border-bottom: 1px solid #00ff00;
}

/* GLITCH EFFECT */

@keyframes glitch {
  0% {
    text-shadow: 1px 0 #00ff00, -1px 0 #ff00ff;
  }
  25% {
    text-shadow: -1px 1px #00ff00, 1px -1px #ff00ff;
  }
  50% {
    text-shadow: 1px -1px #00ff00, -1px 1px #ff00ff;
  }
  75% {
    text-shadow: -1px 0 #00ff00, 1px 0 #ff00ff;
  }
  100% {
    text-shadow: 1px 0 #00ff00, -1px 0 #ff00ff;
  }
}
