/* === HOME PAGE TERMINAL BOX === */

.terminal-page {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  /* FIX ALTEZZA: Sottrae l'altezza della navbar (4rem = circa 64px) + footer */
  min-height: calc(100vh - 140px); 
  
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* Canvas DNA: FORZATO DIETRO */
#dnaCanvas {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  z-index: 0 !important; /* Forza lo sfondo dietro */
  pointer-events: none;
}

/* Profile photo + name */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  z-index: 11; /* Sopra al resto */
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 0.8rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  background: #1e1e1e; /* Evita trasparenze strane */
}

.profile-name {
  font-size: 1.8rem;
  color: #e6edf3;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8); /* Leggibilità sopra l'animazione */
}

/* === TERMINAL CONTAINER === */
.terminal-container {
  position: relative;
  background: rgba(20, 20, 20, 0.9); /* Più opaco per staccare dallo sfondo */
  border-radius: 10px;
  
  /* RESPONSIVE FIX */
  width: 100%;           
  max-width: 900px;      
  height: auto;          
  min-height: 220px;     
  
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;      
  margin: 0 auto;
  z-index: 12;
  
  animation: fadeInStable 0.8s ease-out;
}

@keyframes fadeInStable {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header del terminale */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(30, 30, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap; 
  gap: 10px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.terminal-dots .dot { width: 9px; height: 9px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

/* Tabs */
.terminal-tabs {
  display: flex;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: #8b949e;
  white-space: nowrap;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.tab { transition: color 0.2s; }
.tab.active { color: #00d400; font-weight: 600; text-decoration: underline; cursor: default; }
.tab:hover { color: #00d400; cursor: pointer; }

/* === TERMINAL BODY === */
.terminal-body {
  flex: 1;
  padding: 1.5rem;
  text-align: left;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px; 
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.2); border-radius: 3px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }

.typing {
  font-family: "JetBrains Mono", monospace;
  color: #e6edf3;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.typing::after {
  content: '▋';
  color: #00d400;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* === MOBILE SPECIFIC === */
@media (max-width: 600px) {
  /* 1. Riattiva i tab, ma rendili più piccoli e su più righe */
  .terminal-tabs {
    display: flex;         /* Riattiva la visualizzazione */
    flex-wrap: wrap;       /* Permetti di andare a capo */
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;    /* Testo più piccolo */
    padding-bottom: 0.5rem;
  }
  
  .tab {
    padding: 2px 5px;      /* Hit area leggermente più grande */
  }

  /* 2. Adatta il contenitore */
  .terminal-container { 
    width: 95%; 
    min-height: 200px; /* Un po' meno alto su mobile */
  } 

  /* 3. Aggiusta header */
  .terminal-header {
    flex-direction: column; /* Pallini sopra, tab sotto */
    gap: 0.8rem;
    align-items: center;
  }
}