/**
 * @file assets/css/style.css
 * 
 * =======================================================================================
 * == 🎨 ТИП ФАЙЛА: СТИЛИ ==
 * == 📜 НАЗВАНИЕ: Глобальные кастомные стили проекта ==
 * =======================================================================================
 * 
 * @package Brutalist
 * @subpackage UI
 * @author double_SWAG
 * @copyright 2025 Brutalist
 * @version 1.0.0
 * @access public
 * 
 * НАЗНАЧЕНИЕ:
 * Файл содержит глобальные кастомные CSS-стили, которые дополняют или изменяют 
 * стандартные стили UI-фреймворка Tabler. Здесь определяются стили для общих 
 * компонентов, таких как загрузчик страниц, кастомные утилиты, а также 
 * специфичные стили для отдельных модулей, которые не вынесены в собственные файлы.
 * 
 * СТРУКТУРА ФАЙЛА (РАЗДЕЛЫ):
 * 
 *   1. ГЛОБАЛЬНЫЕ ЭЛЕМЕНТЫ
 *      - Логотипы
 *      - Загрузчик страниц (Page Loader)
 * 
 *   2. СПЕЦИФИЧЕСКИЕ КОМПОНЕНТЫ
 *      - Редактор технологических маршрутов
 * 
 *   3. УТИЛИТЫ И ИСПРАВЛЕНИЯ
 *      - Утилиты отступов
 *      - Сортируемые заголовки таблиц
 *      - Исправления для компонентов
 * 
 * =======================================================================================
 * 
 * @variables ["--tblr-bg-surface"]
 * @ai-priority 3
 */

/* ========================================================================= */
/* === 🧱 1. ГЛОБАЛЬНЫЕ ЭЛЕМЕНТЫ === */
/* ========================================================================= */

/* --- Логотипы --- */
.cstm-p-login-logo {
	height: 36px;
}

/* --- Управление навыками пользователей --- */
.user-search-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.user-search-dropdown .dropdown-item .user-info {
    flex: 1;
    min-width: 0;
}

.user-search-dropdown .dropdown-item .user-name {
    font-weight: 500;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-search-dropdown .dropdown-item .user-username {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cst-h-logo {
	height: 34px;
}

.cst-h-logo.sibar {
	margin-top: 4px;
	height: 32px;
}

/* Стили для темной темы - автоматическая замена логотипов */
[data-bs-theme="dark"] .navbar-brand img.cst-h-logo:not(.sibar) {
	content: url("../../files/ui/logo-brutalist-white.png");
}

[data-bs-theme="dark"] .navbar-brand img.cst-h-logo.sibar {
	content: url("../../files/ui/logo-sibar-white.png");
}

/* --- Загрузчик страниц (Page Loader) --- */
.page-loader {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--tblr-bg-surface);
    z-index: 9999;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.page-loader.opacity-0 {
    opacity: 0;
}

/* Progress bar indeterminate animation */
.progress-bar-indeterminate {
    width: 100%;
    animation: progress-indeterminate 2s linear infinite;
}

@keyframes progress-indeterminate {
    from { transform: translateX(-100%) }
    to { transform: translateX(100%) }
}

/* ========================================================================= */
/* === 🧱 2. СПЕЦИФИЧЕСКИЕ КОМПОНЕНТЫ === */
/* ========================================================================= */

/* --- Редактор технологических маршрутов --- */
.editor-canvas {
    position: relative;
    min-height: 600px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.drag-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.draggable-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: move;
}

.canvas-item {
    position: absolute;
    padding: 0.5rem;
    min-width: 120px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    z-index: 1;
    user-select: none;
}

.canvas-item.node {
    background-color: #c5e8f2;
}

.canvas-item.buffer {
    background-color: #d1f2c5;
}

.canvas-item.material {
    background-color: #f2e2c5;
}

.canvas-item.part {
    background-color: #e2c5f2;
}

.canvas-item.kit {
    background-color: #c5f2d1;
}

.canvas-item.component {
    background-color: #c5d1f2;
}

.canvas-item.selected {
    border: 2px solid #206bc4;
    box-shadow: 0 0 0 4px rgba(32, 107, 196, 0.25);
}

.canvas-item.start-node {
    border-left: 4px solid #2fb344;
}

.canvas-item.end-node {
    border-right: 4px solid #d63939;
}

.canvas-item .delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #d63939;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.canvas-item .settings-btn {
    position: absolute;
    top: -10px;
    right: 15px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #206bc4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.connection {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* ========================================================================= */
/* === 🧱 3. УТИЛИТЫ И ИСПРАВЛЕНИЯ === */
/* ========================================================================= */

/* --- Утилиты отступов --- */
.py-2-5 {
    padding-top: 0.63rem !important; 
    padding-bottom: 0.63rem !important;
}

/* --- Сортируемые заголовки таблиц --- */
.th-sortable {
    cursor: pointer;
}

.sort-icon-container {
    align-items: center;
}

.sort-icon-container .icon {
    width: 1rem;
    height: 1rem;
}

/* --- Исправления для компонентов --- */

/* Fix for icon buttons not being clickable on the entire area */
.btn-icon .icon {
    pointer-events: none;
}

/* Улучшенный letter-spacing для русских шрифтов в бейджах (Tabler UI override) */
.badge {
    letter-spacing: .02em;
}

/* Стиль для пустой строки в таблице */
.cstm-table-empty-row {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-size: smaller;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* Карточки: overflow hidden чтобы таблицы не ломали скругления */
.card {
    overflow: hidden;
}

/* Убираем двойной бордер: последняя строка таблицы + низ карточки (только когда нет футера после) */
.card > .table-responsive:last-child .table tbody tr:last-child td,
.card > .table-responsive:last-child .table tbody tr:last-child th,
.card > .table:last-child tbody tr:last-child td,
.card > .table:last-child tbody tr:last-child th,
.card > .card-body:last-child .table tbody tr:last-child td,
.card > .card-body:last-child .table tbody tr:last-child th {
    border-bottom: none;
}

/* =============================== */
/* === Настройки плейсхолдеров === */
/* =============================== */
::placeholder {
    font-style: italic;
    opacity: 1; /* Сохраняем читаемость */
}

input::placeholder, textarea::placeholder {
    font-style: italic;
    opacity: 1;
}

/* ===================================== */
/* === Стили для многострочных тултипов === */
/* ===================================== */
.cstm-tooltip-multiline .tooltip-inner {
    white-space: pre-line;
    text-align: left;
    max-width: 300px;
}

/* Курсор помощи для ячеек с данными */
.cstm-data-cell-help {
    cursor: help !important;
}

/* ======================================== */
/* === Стили для редактора элементов === */
/* ======================================== */

/* Кастомная ширина для колонки с чекбоксом - делаем её уже */
.cstm-checkbox-col {
    width: 5.33333333% !important;
    max-width: 5.33333333% !important;
    flex: 0 0 5.33333333% !important;
}

/* Кастомная ширина для последней колонки в ряду - делаем её шире */
.cstm-checkbox-last-col {
    width: 36.33333333% !important;
    max-width: 36.33333333% !important;
    flex: 0 0 36.33333333% !important;
}

/* Кастомная ширина для единственной колонки после чекбокса - на всю оставшуюся ширину */
.cstm-checkbox-full-col {
    width: 94.66666667% !important;
    max-width: 94.66666667% !important;
    flex: 0 0 94.66666667% !important;
}

/* Кастомный размер для очень маленьких аватарок */
.cstm-avatar-xxs {
    --tblr-avatar-size: 0.74rem;
}
}