
/* Общие стили */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    padding: 0;
    background-color: black;
    color: green;
    font-family: 'Courier New', Courier, monospace;
}

/* Эффект матрицы - на заднем плане */
canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}


/* Контейнер для чата */
#chat-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 80vh;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Сообщения в чате */
#chat-container p {
    margin: 5px 0;
}

/* Контейнер для ввода */
#input-container {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column; /* Изменено для выпадающего списка */
    padding: 10px;
    background-color: black;
    border-top: 1px solid green;
}

.input-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: relative; /* Добавлено для позиционирования зеркала */
}

/* Выпадающий список команд */
#command-suggestions {
    position: absolute;
    bottom: 100%; /* Прямо над полем ввода */
    left: 0;
    width: 90%;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid green;
    border-bottom: none;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

#command-suggestions.hidden {
    display: none;
}

.command-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.command-item:hover, .command-item.selected {
    background-color: rgba(0, 255, 0, 0.2);
}

.command-name {
    font-weight: bold;
    color: #0F0;
}

.command-desc {
    font-size: 12px;
    color: rgba(0, 255, 0, 0.7);
}

/* Слой-зеркало для отображения текста с маскировкой пароля */
#input-mirror {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 90%;
    padding: 11px; /* Чуть больше паддинг для точного наложения */
    color: #0F0; /* Ярко-зеленый */
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    pointer-events: none; /* Клики проходят сквозь него */
    z-index: 1;
    overflow: hidden;
    line-height: normal;
    background-color: black; /* Гарантируем черный фон под зеркалом */
}

/* Поле для ввода - максимально прозрачное, чтобы не мешать зеркалу */
#input-container input#user-input {
    width: 90%;
    padding: 10px;
    background-color: transparent !important;
    color: transparent !important;
    caret-color: #0F0 !important; /* Зеленый курсор */
    border: 1px solid green;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    z-index: 2;
    outline: none;
}

/* Убираем стандартные стили браузера для паролей и автозаполнения */
#input-container input#user-input:-webkit-autofill,
#input-container input#user-input:-webkit-autofill:hover, 
#input-container input#user-input:-webkit-autofill:focus {
    -webkit-text-fill-color: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Стили для яркого placeholder */
#input-container input#user-input::placeholder {
    color: rgba(0, 255, 0, 0.4);
    opacity: 1;
}

/* Кнопка отправки */
#input-container input[type="submit"] {
    width: 8%;
    background-color: green;
    color: black;
    border: 1px solid green;
    cursor: pointer;
}

#input-container input[type="submit"]:hover {
    background-color: black;
    color: green;
}

/* Кнопка новой сессии */
#new-session-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(0, 255, 0, 0.1);
    color: green;
    border: 1px solid green;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.3s;
}

#new-session-btn:hover {
    background-color: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
}

.green-text {
    color: #0F0;
}

.chat-link {
    color: #7dff7d;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.chat-link:hover {
    color: #b8ffb8;
}

.osint-link {
    display: block;
    padding: 8px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
}

.osint-link:hover {
    background: rgba(0, 255, 0, 0.15);
    border-color: #00ff00;
}

@keyframes glitch-anim {
    0% {
        text-shadow: -1px 0 red, 1px 0 blue;
        transform: translate(2px, 0);
    }
    20% {
        text-shadow: 1px 0 red, -1px 0 blue;
        transform: translate(-2px, 0);
    }
    40% {
        text-shadow: 1px 0 green, -1px 0 yellow;
        transform: translate(1px, 0);
    }
    60% {
        text-shadow: -1px 0 yellow, 1px 0 green;
        transform: translate(-1px, 0);
    }
    80% {
        text-shadow: 2px 0 red, -2px 0 blue;
        transform: translate(2px, 0);
    }
    100% {
        text-shadow: -1px 0 red, 1px 0 blue;
        transform: translate(-2px, 0);
    }
}

.loading {
    display: inline-block;
    animation: bounce 0.6s infinite;
}

@keyframes bounce {
    0%, 100% { 
        transform: scaleY(1) translateY(0); 
    }
    50% { 
        transform: scaleY(1.2) translateY(-12px); 
    }
}

.hidden {
    display: none !important;
}

/* Специальный стиль для intro сообщения */
.intro-message {
    font-size: 0.9em !important;
    font-weight: bold !important;
    color: #00ff00 !important;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    padding: 10px 10px 10px 0;
    background-color: rgba(0, 255, 0, 0.08);
    margin: 10px 0 !important;
    line-height: 1.2;
    font-family: 'Courier New', Courier, monospace;
    animation: pulse-glow 2s ease-in-out infinite;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intro-message strong {
    font-size: 0.9em;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
}

.intro-message .warning-line {
    font-size: 0.9em;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00, 0 0 25px #00ff00;
    letter-spacing: 1px;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00ff00;
        opacity: 0.95;
    }
}