/* GLIDE Engineering - Terminal CSS Completo */

/* Terminal container - auto height per contenere tutto */
.terminal {
    min-height: 14.5rem;
    height: 14.5rem; /* Altezza fissa per mostrare tutto */
    overflow-y: hidden; /* Hidden per evitare scrollbar */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Terminal lines */
.terminal-line {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.375rem; /* Ridotto da 0.5rem */
    min-height: 1.25rem; /* Ridotto */
    width: 100%;
}

/* Nascondi le linee inizialmente */
#running-line,
#result-line,
#suggestion-line,
#interactive-line {
    display: none;
    margin-top: 0.125rem; /* Ridotto */
}

/* Ultima linea senza margin bottom */
.terminal-line:last-child {
    margin-bottom: 0;
}

.terminal-prompt {
    color: #8BE9FD;
    margin-right: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.terminal-line-content {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    line-height: 1.4; /* Ridotto da 1.5 */
}

/* Colori comando */
.cmd-pink {
    color: #EB068C;
    font-weight: 500;
}

.cmd-white {
    color: #FFFFFF;
}

.cmd-accent {
    color: #EB068C;
    font-weight: 500;
}

/* Cursor animato */
.cursor {
    display: inline-block;
    width: 0.5rem;
    height: 1rem;
    background-color: #FFFFFF;
    margin-left: 0.2rem;
    animation: cursorBlink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Input interattivo */
.terminal-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-family: inherit;
    font-size: inherit;
    background: transparent;
    border: none;
    color: #FFFFFF;
    outline: none;
    caret-color: transparent;
}

#custom-input {
    display: inline;
    min-width: 0.5rem;
}

/* Link brochure */
[data-brochure="true"] {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.2em;
    transition: all 0.3s ease;
}

[data-brochure="true"]:hover {
    color: #FF60C0;
    text-shadow: 0 0 0.5rem rgba(235, 6, 140, 0.5);
    text-decoration-style: solid;
}

[data-brochure="true"]:active {
    transform: scale(0.95);
}

/* Notifiche terminal */
.terminal-notification {
    margin-top: 0.125rem; /* Ulteriormente ridotto */
    padding: 0.125rem 0; /* Ulteriormente ridotto */
    opacity: 0;
    animation: fadeInNotification 0.5s ease forwards;
    max-height: 2rem; /* Limita altezza */
    overflow: hidden; /* Nascondi overflow */
}

.terminal-notification .terminal-line-content {
    font-size: 0.75rem; /* Font più piccolo per notifiche */
}

.terminal-notification .cmd-accent {
    animation: pulseText 2s ease-in-out infinite;
    font-size: 0.75rem; /* Esplicitamente più piccolo */
}

.terminal-notification .cmd-accent {
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes fadeInNotification {
    to {
        opacity: 1;
    }
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Effetti aggiuntivi */
.pulse-effect {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Fix per mobile */
@media (max-width: 768px) {
    .terminal {
        min-height: 12rem;
        height: 12rem;
    }
    
    .terminal-line {
        margin-bottom: 0.25rem; /* Ulteriormente ridotto */
    }
    
    .terminal-prompt {
        font-size: 0.8125rem; /* Ridotto */
    }
    
    .terminal-line-content {
        font-size: 0.8125rem; /* Ridotto */
    }
    
    .cmd-pink,
    .cmd-white,
    .cmd-accent {
        font-size: inherit;
    }
}

@media (max-width: 480px) {
    .terminal {
        min-height: 10.5rem;
        height: 10.5rem;
    }
    
    .terminal-line-content {
        font-size: 0.75rem; /* Ridotto */
    }
    
    .cursor {
        width: 0.375rem;
        height: 0.875rem;
    }
}

/* Fix per altezze ridotte */
@media (max-height: 600px) {
    .terminal {
        min-height: 9.5rem;
        height: 9.5rem;
    }
    
    .terminal-line {
        margin-bottom: 0.2rem; /* Minimo spazio */
        min-height: 1.25rem;
    }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    .cursor,
    .terminal-notification .cmd-accent {
        animation: none;
    }
    
    .cursor {
        opacity: 1;
    }
}