/* =============================================================================
   TAMU PROJECT - MAIN STYLESHEET
   Author: [Tuo Nome/Team]
   Theme: Noir Tech / Monolith
   ============================================================================= */

/* =========================================
   1. CONFIGURAZIONE COLORI E VARIABILI GLOBALI
   ========================================= */
:root {
    --primary: #ffffff;       /* Testo principale */
    --secondary: #888888;     /* Testo secondario / Labels */
    --bg-dark: #000000;       /* Sfondo */
    --line-color: rgba(255, 255, 255, 0.1); /* Linee divisorie */
    --accent: #ffffff;        /* Highlight */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--primary);
    font-family: 'Space Mono', monospace; 
    overflow-x: hidden;
    -ms-overflow-style: none;  /* Nasconde scrollbar IE/Edge */
    scrollbar-width: 0;        /* Nasconde scrollbar Firefox */
}

body::-webkit-scrollbar{
    display: none;             /* Nasconde scrollbar Chrome/Safari */
}

/* =========================================
   2. LOADER LUMINOSO (Original Drawing Animation)
   ========================================= */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000 !important; 
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-svg {
    width: 100px; 
    height: 100px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.9)) 
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
    overflow: visible;
}

.svg-path {
    fill: transparent;
    stroke: #ffffff;
    stroke-width: 20;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    animation: drawChase 4s ease-in-out infinite;
}

/* Lunghezza path specifica per il tuo logo */
.svg-path:nth-child(1) { --len: 3597; animation-delay: 0s; }
.svg-path:nth-child(2) { --len: 11584; animation-delay: 0.4s; }
.svg-path:nth-child(3) { --len: 5962; animation-delay: 0.8s; }

@keyframes drawChase {
    0% { stroke-dashoffset: var(--len); fill: transparent; }
    40% { stroke-dashoffset: 0; fill: transparent; }
    50% { stroke-dashoffset: 0; fill: #ffffff; opacity: 1; }
    60% { stroke-dashoffset: 0; fill: #ffffff; opacity: 1; }
    90% { stroke-dashoffset: calc(var(--len) * -1); fill: transparent; opacity: 0; }
    100% { stroke-dashoffset: calc(var(--len) * -1); fill: transparent; opacity: 0; }
}

/* =========================================
   3. LAYOUT PRINCIPALE (Canvas e Struttura)
   ========================================= */

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    background: #000000;
    opacity: 1; 
    pointer-events: none;
}

/* NAVIGAZIONE GLASSMORPHISM */
nav {
    position: fixed;
    top: 0;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    width: 100%;
}

@font-face { font-family: Astroneer; src: url('fonts/ndastroneer.ttf'); } 

.logo {
    font-family: Astroneer;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image { background-color: var(--secondary); }
.logo:hover { color: var(--primary); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)); }
.logo:hover .logo-image{ background-color: var(--accent); }

.nav-links a {
    color: var(--secondary);
    text-decoration: none;
    margin-left: 30px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
    font-size: 0.9rem;
    letter-spacing: 1px;
}
.nav-links a:hover { color: var(--accent); text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }

#login-btn:hover { color: var(--accent); background: rgba(255, 255, 255, 0.5); }

/* MAIN CONTAINER */
main {
    position: relative;
    z-index: 1;
    width: 100%;
    padding-top: 100vh; /* Spazio per la intro 3D iniziale */
}

/* =========================================
   4. INDICATORE SCROLL (Freccia Animata)
   ========================================= */
.landing-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; 
    height: 100vh; height: 100dvh; 
    pointer-events: none; z-index: 10;
}

.scroll-indicator {
    position: absolute;
    bottom: 35px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 20; opacity: 0.8; pointer-events: auto;
}

.scroll-indicator span {
    font-size: 0.7rem; letter-spacing: 0.2em; color: white;
    margin-bottom: 10px; text-transform: uppercase;
}

.arrow-box { animation: arrowFall 1.7s cubic-bezier(0.65, 0, 0.35, 1) infinite; }

.arrow-chevron {
    width: 12px; height: 12px;
    border-bottom: 2px solid white; border-right: 2px solid white;
    transform: rotate(45deg); margin-top: -6px;
}

@keyframes arrowFall {
  0% { opacity: 0; transform: translateY(0px); }
  10%{ opacity: 0; transform: translate(0px); }
  60% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(20px); }
}

/* =========================================
   5. STILE DELLE SEZIONI GENERALI
   ========================================= */
.section {
    min-height: 80vh;
    padding: 100px 10%;
    display: flex; flex-direction: column; justify-content: center;
    border-top: 1px solid var(--line-color); 
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.8)); 
    backdrop-filter: blur(15px);
}

.section-tag {
    font-size: 0.8rem; color: var(--secondary); display: block;
    margin-bottom: 20px; font-family: 'Space Mono', monospace;
}

h2 {
    font-family: 'Rajdhani', sans-serif; font-size: 3.5rem; font-weight: 300;
    margin-bottom: 30px; text-transform: uppercase; color: white; line-height: 1.1;
}

p {
    font-size: 1.1rem; line-height: 1.8; color: #cccccc;
    max-width: 650px; margin-bottom: 20px;
}

.highlight { color: white; border-bottom: 1px solid white; }

/* Reveal Animation (Apparizione dal basso) */
.reveal {
    opacity: 0; transform: translateY(60px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* Griglia Dati Generica */
.data-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px; margin-top: 50px; max-width: 800px;
}
.data-item h3 {
    font-size: 0.8rem; color: var(--secondary); margin-bottom: 10px;
    text-transform: uppercase; font-family: 'Space Mono', monospace;
}
.data-item .value {
    font-family: 'Rajdhani', sans-serif; font-size: 3.5rem;
    font-weight: 500; color: white;
}

/* Pulsante Tecnico Generico */
.tech-button {
    background: transparent; border: 1px solid var(--secondary); color: var(--primary);
    padding: 10px 20px; font-family: 'Space Mono', monospace; cursor: pointer;
    font-size: 0.8rem; letter-spacing: 1px; transition: all 0.3s ease; margin: 0;
}
.tech-button:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }

/* =========================================
   6. ELEMENTI INTERATTIVI SPECIFICI
   ========================================= */

/* --- TEXT FLICKER (Sezione Architettura) --- */
.char-wrapper { display: inline-block; min-width: 4px; transition: color 0.5s ease, opacity 0.5s ease; }
.noisy { animation: signalNoise 0.8s infinite; color: var(--secondary); }
.resolved { opacity: 1; color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }

@keyframes signalNoise {
    0% { opacity: 1; } 10% { opacity: 0.2; } 20% { opacity: 1; } 30% { opacity: 0.5; } 40% { opacity: 1; }
    50% { opacity: 0.1; } 60% { opacity: 1; } 70% { opacity: 0.3; } 80% { opacity: 1; } 90% { opacity: 0.8; } 100% { opacity: 1; }
}

.action-container { display: flex; align-items: center; gap: 20px; margin-top: 20px; margin-bottom: 10px; }
.side-hint { display: flex; align-items: center; gap: 15px; opacity: 0.7; transition: opacity 0.5s ease; }
.side-hint span { font-size: 0.7rem; letter-spacing: 0.15em; color: var(--secondary); text-transform: uppercase; white-space: nowrap; }
.h-arrow-box { animation: arrowPointLeft 2s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.h-arrow-chevron { width: 10px; height: 10px; border-top: 1px solid white; border-left: 1px solid white; transform: rotate(-45deg); }
.fade-out { opacity: 0; pointer-events: none; }

@keyframes arrowPointLeft {
  0% { opacity: 0; transform: translateX(15px); }
  30% { opacity: 1; } 70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(0); }
}

/* --- SEZIONE TECNOLOGIA (Simulazione Termica) --- */

.tech-layout { 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: space-between; 
    gap: 40px; 
    width: 100%; 
}

.tech-text { 
    flex: 1; 
    max-width: 600px; 
}

/* Contenitore Visuale (Dimensioni fisse per mantenere posizionamento stabile) */
.tech-visual { 
    flex: 0 0 auto; 
    position: relative; 
    width: 350px; 
    height: 350px; 
    display: flex; 
    justify-content: center; 
    align-items: center;
}

/* IL CANVAS (Sfondo Trasparente) */
#thermal-sim-canvas { 
    background: transparent !important; /* RIMOSSO IL GRIGIO */
    border: none !important;            /* RIMOSSO IL BORDO CSS (lo fa il JS) */
    display: block; 
    width: 100%;
    height: 100%;
}

/* HUD (Scritte in basso a destra, come prima) */
.vector-hud { 
    position: absolute; 
    bottom: 60px; /* Posizionato dentro l'area del cerchio */
    right: 40px; 
    text-align: right; 
    pointer-events: none; 
    z-index: 10;
}

.hud-row { 
    display: block; 
    font-size: 0.65rem; 
    color: var(--secondary); 
    margin-bottom: 4px; 
    font-family: 'Space Mono', monospace; 
    letter-spacing: 1px;
}

.hud-val { 
    color: white; 
    font-weight: bold; 
    margin-left: 8px; 
    display: inline-block; 
    min-width: 50px;
}

/* Pulsante Controllo Simulazione */
.sim-btn {
    position: absolute;
    bottom: -50px;         /* Posizionato in basso al centro */
    left: 50%;
    transform: translateX(-50%);
    
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    z-index: 20;
    text-transform: uppercase;
}

.sim-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.sim-btn.active {
    border-color: #ffffff; /* Verde quando attivo */
    color: #ffffff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* =========================================
   7. SEZIONE DATI (Mission Timer & Ghost Log)
   ========================================= */
.mission-control-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; width: 100%; }
.left-col { display: flex; flex-direction: column; justify-content: center; }
.right-col { position: relative; height: 300px; display: flex; align-items: center; }

.timer-wrapper {
    font-family: 'Space Mono', monospace; color: var(--secondary); font-size: 0.8rem;
    margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.03); padding: 8px 12px; border-radius: 2px; width: fit-content;
    border-left: 1px solid rgba(255,255,255,0.1);
}
.status-dot { width: 6px; height: 6px; background-color: #fff; border-radius: 50%; box-shadow: 0 0 8px rgba(255,255,255,0.5); animation: pulseDot 3s infinite; }
#mission-timer { color: var(--primary); font-weight: 700; }
@keyframes pulseDot { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }

.log-terminal-wrapper {
    width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    border-right: 2px solid rgba(255,255,255,0.1); padding-right: 20px;
}
.log-stream { font-family: 'Space Mono', monospace; text-align: right; font-size: 0.7rem; color: #444; display: flex; flex-direction: column; gap: 6px; }
.log-line { opacity: 0; transform: translateY(10px); animation: floatUpLog 0.8s ease-out forwards; white-space: nowrap; transition: color 0.3s; }
.log-line.active { color: #888; }
@keyframes floatUpLog { to { opacity: 1; transform: translateY(0); } }

/* =========================================
   8. SEZIONE PRODOTTO (Tabella & Download)
   ========================================= */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }

.download-btn {
    display: inline-flex; align-items: center; gap: 15px; margin-top: 30px; padding: 12px 25px;
    border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; text-decoration: none;
    font-family: 'Space Mono', monospace; font-size: 0.8rem; letter-spacing: 1px;
    transition: all 0.3s ease; background: rgba(255,255,255,0.02); max-width: 650px;
}
.download-btn .icon { font-size: 1.2rem; font-weight: bold; }
.download-btn:hover { background: #fff; color: #000; border-color: #fff; }

.prod-specs { font-family: 'Space Mono', monospace; width: 100%; margin-top: 10px; }
.table-header {
    font-size: 0.7rem; color: var(--secondary); margin-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.1); padding-bottom: 5px; display: block;
}
.spec-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.spec-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.spec-table tr:hover { background: rgba(255, 255, 255, 0.05); }
.spec-table td { padding: 12px 0; }
.spec-table td:first-child { color: var(--secondary); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; width: 40%; }
.spec-table td:last-child { color: #fff; text-align: right; font-weight: 400; }

/* =========================================
   9. SEZIONE CONTATTI (Uplink Terminal)
   ========================================= */
.uplink-section {
    width: 100%;        /* Occupa tutto lo schermo */
    max-width: none;    /* Rimuove limiti larghezza */
    display: grid;
    grid-template-columns: 1fr 500px; /* Colonna SX fluida, Colonna DX fissa */
    gap: 80px;
    align-items: start;
    box-sizing: border-box;
}

.terminal-form {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px; position: relative;
}
.terminal-form::before { content: ''; position: absolute; top: -1px; left: -1px; width: 10px; height: 10px; border-top: 2px solid white; border-left: 2px solid white; }
.terminal-form::after { content: ''; position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-bottom: 2px solid white; border-right: 2px solid white; }

.cmd-group { margin-bottom: 20px; position: relative; }
.cmd-label { display: block; font-size: 0.7rem; color: var(--secondary); margin-bottom: 8px; text-transform: uppercase; font-family: 'Space Mono', monospace; }

.input-wrapper { display: flex; align-items: center; border-bottom: 1px solid #333; transition: border-color 0.3s; }
.input-wrapper.error { border-bottom-color: #ff3333; }
.input-wrapper.error .prefix, .input-wrapper.error .cmd-input { color: #ff3333; }
.input-wrapper.valid { border-bottom-color: #00ff00; }
.input-wrapper.valid .prefix { color: #00ff00; }
.prefix { color: var(--secondary); margin-right: 10px; font-weight: bold; transition: color 0.3s; font-family: 'Space Mono', monospace; }
.cmd-input { width: 100%; background: transparent; border: none; color: white; font-family: 'Space Mono', monospace; font-size: 1rem; padding: 10px 0; outline: none; transition: color 0.3s; }
textarea.cmd-input { resize: none; min-height: 80px; }
.input-wrapper:focus-within { border-bottom-color: white; }
.input-wrapper:focus-within .prefix { color: #fff; text-shadow: 0 0 5px #fff; }

.transmit-container { margin-top: 40px; position: relative; width: 100%; height: 50px; }
.transmit-btn { width: 100%; height: 100%; background: transparent; border: 1px solid #444; color: white; font-family: 'Space Mono', monospace; font-size: 0.9rem; letter-spacing: 2px; cursor: pointer; position: relative; overflow: hidden; outline: none; transition: border-color 0.3s; }
.btn-text { position: relative; z-index: 2; pointer-events: none; mix-blend-mode: difference; }
.progress-bar { position: absolute; top: 0; left: 0; width: 0%; height: 100%; background-color: white; z-index: 1; transition: width 0.1s linear; }
.transmit-btn.charging .progress-bar { width: 100%; transition: width 2s linear; }
.transmit-btn.sent { border-color: white; background: white; }
.transmit-btn.sent .btn-text { color: black; mix-blend-mode: normal; }
.transmit-btn.sent .progress-bar { display: none; }

.status-msg { font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--secondary); margin-top: 10px; text-align: right; height: 1em; opacity: 0; transition: opacity 0.3s, color 0.3s; }
.status-msg.visible { opacity: 1; }
.status-msg.error-txt { color: #ff3333; }
.status-msg.success-txt { color: #00ff00; }

/* =========================================
   10. RESPONSIVE & FOOTER
   ========================================= */
footer { width: 100%; height: 100px; display: flex; justify-content: center; align-items: center; background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid rgba(255, 255, 255, 0.05); }
footer p { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); letter-spacing: 1px; text-transform: uppercase; text-align: center; font-weight: 400; }

@media (max-width: 1200px) {
    .uplink-section { grid-template-columns: 1fr; gap: 50px;}
    .terminal-form { width: 100%; }
}

@media (max-width: 1024px) {
    .tech-visual, .vector-scope-wrapper { display: none !important; } /* Nasconde grafico su tablet */
    .tech-text { max-width: 100%; }
}

@media (max-width: 900px) {
    .mission-control-layout, .product-layout { grid-template-columns: 1fr; gap: 40px; }
    .right-col { height: 150px; margin-top: 30px; border-left: none; }
    .log-terminal-wrapper { border-left: 2px solid rgba(255,255,255,0.1); border-right: none; padding-left: 20px; }
    .log-stream { text-align: left !important; }
    .prod-specs { margin-top: 0; }
}

@media (max-width: 965px) {
    .nav-links a { display: none; }
    .alwaysVisible {display: inline-block !important; margin-left: 10px !important; /* O il colore originale */}
    nav { padding: 20px; }
}

@media (max-width: 677px) {
    h2 { font-size: 2.2rem; }
    .section { padding: 80px 20px !important; }
}