/* ========================================
   SANDRO PRIOLO AI - TERMINAL STYLE
   terminal.css
   Stile terminale hacker per Lab e Automazioni
   ======================================== */

/* Sfondo e Base del Sito */
.terminal-page {
    background-color: #050505 !important;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace !important;
    min-height: 100vh;
}

.terminal-page * {
    font-family: 'Courier New', Courier, monospace !important;
}

/* Effetto Scanline (Righe sottili tipiche dei monitor CRT) */
.terminal-page::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Container del Terminale */
.terminal-container {
    border: 1px solid #333;
    background: rgba(10, 10, 10, 0.95);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 200, 0.15);
    margin: 2rem auto;
    max-width: 900px;
}

/* Header del Terminale con pulsanti */
.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
    margin-bottom: 1.5rem;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-btn--close {
    background: #ff5f56;
}

.terminal-btn--minimize {
    background: #ffbd2e;
}

.terminal-btn--maximize {
    background: #27c93f;
}

.terminal-title {
    margin-left: auto;
    color: #666;
    font-size: 0.85rem;
}

/* Testo che "pulsa" (Effetto Glow) */
.terminal-text {
    color: #00ffcc;
    text-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
    line-height: 1.8;
    margin: 0.5rem 0;
}

.terminal-text--success {
    color: #22ff22;
}

.terminal-text--warning {
    color: #ffbd2e;
}

.terminal-text--error {
    color: #ff5f56;
}

.terminal-text--purple {
    color: #8a2be2;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

/* Prompt */
.terminal-prompt {
    color: #00ffcc;
    font-weight: bold;
}

.terminal-prompt::before {
    content: "> ";
    color: #888;
}

/* Cursore Lampeggiante */
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #00ffcc;
    margin-left: 5px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Effetto Glitch per le intestazioni */
.glitch {
    position: relative;
    font-weight: bold;
    font-size: 2rem;
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.8);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 20px, 0);
        transform: skew(0.5deg);
    }

    5% {
        clip: rect(50px, 9999px, 60px, 0);
        transform: skew(0.5deg);
    }

    10% {
        clip: rect(80px, 9999px, 90px, 0);
        transform: skew(-0.5deg);
    }

    15% {
        clip: rect(20px, 9999px, 30px, 0);
        transform: skew(0.5deg);
    }

    20% {
        clip: rect(70px, 9999px, 80px, 0);
        transform: skew(-0.5deg);
    }

    25% {
        clip: rect(30px, 9999px, 40px, 0);
        transform: skew(0.5deg);
    }

    30% {
        clip: rect(60px, 9999px, 70px, 0);
        transform: skew(-0.5deg);
    }

    35% {
        clip: rect(40px, 9999px, 50px, 0);
        transform: skew(0.5deg);
    }

    40% {
        clip: rect(90px, 9999px, 100px, 0);
        transform: skew(-0.5deg);
    }

    45% {
        clip: rect(15px, 9999px, 25px, 0);
        transform: skew(0.5deg);
    }

    50% {
        clip: rect(55px, 9999px, 65px, 0);
        transform: skew(-0.5deg);
    }

    55% {
        clip: rect(25px, 9999px, 35px, 0);
        transform: skew(0.5deg);
    }

    60% {
        clip: rect(75px, 9999px, 85px, 0);
        transform: skew(-0.5deg);
    }

    65% {
        clip: rect(35px, 9999px, 45px, 0);
        transform: skew(0.5deg);
    }

    70% {
        clip: rect(65px, 9999px, 75px, 0);
        transform: skew(-0.5deg);
    }

    75% {
        clip: rect(5px, 9999px, 15px, 0);
        transform: skew(0.5deg);
    }

    80% {
        clip: rect(85px, 9999px, 95px, 0);
        transform: skew(-0.5deg);
    }

    85% {
        clip: rect(45px, 9999px, 55px, 0);
        transform: skew(0.5deg);
    }

    90% {
        clip: rect(95px, 9999px, 105px, 0);
        transform: skew(-0.5deg);
    }

    95% {
        clip: rect(8px, 9999px, 18px, 0);
        transform: skew(0.5deg);
    }

    100% {
        clip: rect(78px, 9999px, 88px, 0);
        transform: skew(-0.5deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 75px, 0);
        transform: skew(0.5deg);
    }

    100% {
        clip: rect(25px, 9999px, 35px, 0);
        transform: skew(-0.5deg);
    }
}

/* Cards stile terminale */
.terminal-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #333;
    border-left: 3px solid #00ffcc;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.terminal-card:hover {
    border-left-color: #8a2be2;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.2);
    transform: translateX(5px);
}

.terminal-card__title {
    color: #00ffcc;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.terminal-card__text {
    color: #888;
    font-size: 0.9rem;
}

/* Input stile terminale */
.terminal-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    color: #00ffcc;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    width: 100%;
    border-radius: 4px;
    outline: none;
}

.terminal-input:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.terminal-input::placeholder {
    color: #555;
}

/* Bottoni stile terminale */
.terminal-btn-action {
    background: transparent;
    border: 1px solid #00ffcc;
    color: #00ffcc;
    padding: 0.75rem 1.5rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.terminal-btn-action:hover {
    background: #00ffcc;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.terminal-btn-action--purple {
    border-color: #8a2be2;
    color: #8a2be2;
}

.terminal-btn-action--purple:hover {
    background: #8a2be2;
    color: #fff;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
}

/* Grid per le features */
.terminal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* ASCII Art container */
.ascii-art {
    color: #00ffcc;
    font-size: 0.6rem;
    line-height: 1.2;
    text-align: center;
    margin: 2rem 0;
    white-space: pre;
}

/* Log output */
.terminal-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.terminal-log__line {
    color: #888;
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.terminal-log__line::before {
    content: "[" attr(data-time) "] ";
    color: #555;
}

/* Typing effect */
.typing {
    overflow: hidden;
    border-right: 2px solid #00ffcc;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #00ffcc;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-container {
        margin: 1rem;
        padding: 1rem;
    }

    .glitch {
        font-size: 1.5rem;
    }

    .ascii-art {
        font-size: 0.4rem;
    }
}

/* Variante viola per sottodominio automazioni */
.terminal-page--automazioni .terminal-text {
    color: #8a2be2;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

.terminal-page--automazioni .terminal-container {
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.15);
}

.terminal-page--automazioni .glitch {
    color: #8a2be2;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8);
}

.terminal-page--automazioni .cursor {
    background-color: #8a2be2;
}

.terminal-page--automazioni .terminal-card {
    border-left-color: #8a2be2;
}

.terminal-page--automazioni .terminal-input:focus {
    border-color: #8a2be2;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}