/* ================= INPUT CONTAINER ================= */
/* WELCOME MODE: абсолютное позиционирование по центру */
.input-container-wrapper.welcome-mode {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 100px));
    width: calc(100% - 160px); /* Отступы по 80px с каждой стороны */
    max-width: 650px;
    padding: 0 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    z-index: 1;
}

.input-container-wrapper.welcome-mode .input-container {
    width: 100%;
    min-height: 53px;
}

/* CHAT MODE: фиксированное позиционирование внизу */
.input-container-wrapper.chat-mode {
    position: absolute;
    left: 0;
    right: 60px; /* Учитываем right-panel */
    bottom: 30px;
    /* transition добавляется через .ready на sidebar */
    display: flex;
    justify-content: center;
    padding: 0 40px;
    box-sizing: border-box;
}

.input-container-wrapper.chat-mode .input-container {
    width: 100%;
    max-width: 800px;
    min-height: 53px;
}

/* Базовые стили input container.
   Единый блок: input-row сверху, разделитель и quick-commands снизу.
   Контейнер растёт по высоте при наличии quick-commands и/или файла. */
.input-container {
    background:#FFFFFF;
    border: 3px solid #ECEEFF;
    border-radius: 20px;
    display:flex;
    flex-direction: column;
    padding: 0;
    transition: width 0.3s ease, border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

/* Разделитель между input-row и quick-commands.
   По умолчанию скрыт; отображается когда контейнер имеет класс
   .has-commands (его ставит quick-commands.js при show()). */
.input-divider {
    height: 1px;
    background: #ECEEFF;
    margin: 0 13px;
    display: none;
    flex-shrink: 0;
}

.input-container.has-commands .input-divider {
    display: block;
}

/* Визуальная индикация при перетаскивании файла */
.input-container.drag-over {
    border: 2px dashed #3F3FE6;
    background-color: rgba(63, 63, 230, 0.05);
    box-shadow: 0 2px 8px rgba(63, 63, 230, 0.15);
}

/* Внутренний контейнер для кнопок и текстового поля */
.input-container > .attach-button,
.input-container > .text-input,
.input-container > .send-button {
    order: 2;
}

.input-container > .file-attachment-in-input {
    order: 1;
}

.input-row {
    display: flex;
    align-items: center;
    padding: 9px 11px 9px 22px;
    gap: 17px;
    width: 100%;
    min-height: 53px;
    box-sizing: border-box;
}

.attach-button {
    background: none;
    width: 18px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
}

.attach-button img {
    width: 100%;
    height: 100%;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.attach-button:hover img {
    opacity: 1;
}

.text-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 17px;
    color: #000;
    font-family: "Manrope", sans-serif;
    font-weight: 500;
    resize: none;
    overflow-y: hidden;
    min-height: 24px;
    max-height: 312px;
    line-height: 24px;
    padding: 0;
    transition: height 0.1s ease;
    align-self: flex-start;
    padding-top: 4px;
}

.text-input.scrollable {
    overflow-y: auto;
}

/* Кастомный скроллбар для textarea */
.text-input::-webkit-scrollbar {
    width: 6px;
}

.text-input::-webkit-scrollbar-track {
    background: transparent;
}

.text-input::-webkit-scrollbar-thumb {
    background: #D0D0D0;
    border-radius: 3px;
}

.text-input::-webkit-scrollbar-thumb:hover {
    background: #B0B0B0;
}

.text-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 17px;
}

.send-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
    overflow: visible;
    transition: transform 0.2s ease;
}

.send-button img {
    width: 36px;
    height: 36px;
    max-width: none;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.1);
}

.send-button:disabled {
    cursor: not-allowed;
}

/* Кнопка-STOP во время активного стриминга LLM.
   Тот же фирменный фиолетовый что у Send (#3F3FE6), без пульсации —
   визуально идентична Send, но иконка меняется на квадрат (stop). */
.send-button.stop {
    cursor: pointer;
}

.send-button.stop:hover {
    transform: scale(1.1);
}

/* Мигающая каретка в конце печатающегося сообщения — как у claude.ai.
   Символ Unicode ▍ (или можно заменить на |). Сам символ статичный,
   мигает только его opacity через CSS-анимацию. */
.stream-caret {
    display: inline-block;
    margin-left: 1px;
    color: currentColor;
    animation: stream-caret-blink 1s steps(2, start) infinite;
    font-weight: 400;
    vertical-align: baseline;
    line-height: 1;
}

@keyframes stream-caret-blink {
    to { visibility: hidden; }
}

/* Контейнер file-preview'ов ВНУТРИ .input-container (над .input-row).
   Сами плитки оформлены в file-tile.css (.file-tile.file-tile--preview).
   Контейнер задаёт только отступы и горизонтальный скролл если плиток
   больше одной. */
.files-container-in-input {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15.5px 15.5px 0 15.5px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Quick command button */
.quick-command-btn-inline {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s ease;
}

.quick-command-btn-inline:hover {
    background: rgba(63, 63, 230, 0.1);
}

.quick-command-btn-inline:active {
    background: rgba(63, 63, 230, 0.2);
}

/* ================= COLLAPSED SIDEBAR STYLES ================= */
/* Когда sidebar свернут (60px) и right-panel (60px) - симметрия */
aside#sidebar.collapsed ~ .main-content .input-container-wrapper .input-container {
    max-width: 1000px; /* Больше места при свёрнутом sidebar */
}
