/* Базовые стили для всего документа */
body {
    margin: 0;
    padding: 20px;
    background-color: #000; /* Черный фон */
    display: flex; /* Для центрирования терминала */
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Минимальная высота для центрирования */
    font-family: 'Cascadia Code', 'Fira Code', 'monospace', monospace; /* Моноширинный шрифт */
    color: #0f0; /* Основной "зеленый" цвет текста */
    overflow: hidden; /* Скрыть возможные полосы прокрутки */
    position: relative;
}

/* Эффект мерцания фона (неоновая сетка) */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to right, rgba(0,255,0,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,255,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    animation: background-glow 10s infinite alternate; /* Анимация мерцания фона */
    z-index: -1;
}

@keyframes background-glow {
    0% { opacity: 0.2; }
    100% { opacity: 0.6; }
}


/* Стили для окна терминала */
.terminal-window {
    width: 90%;
    max-width: 800px;
    border: 1px solid #0f0; /* Зеленая рамка */
    border-radius: 8px; /* Скругленные углы */
    box-shadow: 0 0 20px rgba(0,255,0,0.7), inset 0 0 10px rgba(0,255,0,0.3); /* Неоновое свечение */
    background-color: rgba(10, 10, 10, 0.9); /* Полупрозрачный темный фон */
    overflow: hidden; /* Чтобы скругленные углы работали */
    position: relative;
    padding-bottom: 20px; /* Отступ снизу для красоты */
}

/* Эффект старого монитора (scanlines) */
.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0px,
        rgba(0,0,0,0.2) 1px,
        transparent 2px
    );
    pointer-events: none; /* Не блокировать клики */
    opacity: 0.3;
}

/* Заголовок окна терминала */
.terminal-header {
    background-color: #333;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #0f0;
    box-shadow: 0 0 8px rgba(0,255,0,0.5);
    position: relative;
    z-index: 1;
}

/* Кнопки "закрыть/свернуть" */
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #555;
    box-shadow: 0 0 5px rgba(255,255,255,0.5);
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

/* Заголовок с путем */
.terminal-title {
    color: #eee;
    font-size: 0.9em;
    flex-grow: 1;
    text-align: center;
    text-shadow: 0 0 5px rgba(0,255,0,0.8);
}

/* Тело терминала (где команды и вывод) */
.terminal-body {
    padding: 15px;
    font-size: 1.1em;
    line-height: 1.5;
    max-height: 60vh; /* Ограничить высоту для прокрутки */
    overflow-y: auto; /* Добавить прокрутку при переполнении */
    scrollbar-width: thin; /* Тонкий скроллбар */
    scrollbar-color: #0f0 transparent; /* Цвет скроллбара */
}

/* Стилизация скроллбара для Webkit (Chrome, Safari) */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}
.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb {
    background-color: #0f0;
    border-radius: 4px;
    border: 2px solid transparent;
}

/* Каждая строка в терминале */
.line {
    margin-bottom: 5px;
    position: relative;
    padding-left: 10px; /* Отступ для курсора */
}
.line:not(.blinking-cursor)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background-color: rgba(0,255,0,0.7);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,255,0,0.8);
}


/* Промпт (sxdqw@archlinux ~$) */
.prompt {
    color: #0f0;
    text-shadow: 0 0 5px rgba(0,255,0,0.5);
}
.prompt::after {
    content: ' ';
}

/* Введенная команда */
.command {
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.7);
}

/* Вывод команды */
.output {
    color: #eee;
    text-shadow: 0 0 3px rgba(238,238,238,0.5);
    margin-left: 20px; /* Отступ для вывода */
    font-size: 0.95em;
    opacity: 0.9;
}

/* Анимированный мигающий курсор */
.blinking-cursor .cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background-color: #0f0;
    vertical-align: middle;
    margin-left: 5px;
    animation: blink-caret 0.75s step-end infinite;
    box-shadow: 0 0 8px rgba(0,255,0,0.7);
}

@keyframes blink-caret {
    from, to { background-color: transparent }
    50% { background-color: #0f0; }
}

/* Стили для ссылок */
a {
    color: #4dc2ff; /* Голубой цвет для ссылок */
    text-decoration: none;
    text-shadow: 0 0 5px rgba(77,194,255,0.7);
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: #88eeff;
    text-shadow: 0 0 10px rgba(136,238,255,1);
    transform: scale(1.02);
}
