:root {
  --color-primary-rgb: 13 148 136; /* Tailwind teal-600 */
  --color-primary-hover-rgb: 15 118 110; /* Tailwind teal-700 */
  --color-primary-light-rgb: 240 253 250; /* Tailwind teal-50 */

  --color-main-bg-rgb: 221 234 238; /* Ваш цвет rgb(221 234 238) */
}

/* Можно добавить другие общие стили здесь, если нужно */
body {
    /* Пример: можно установить базовый шрифт */
    /* font-family: 'Inter', sans-serif; */
}

/* Класс для основного фона, использующий переменную */
.bg-main-content {
    background-color: rgb(var(--color-main-bg-rgb));
}

/* Стили для Select2 */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 0.75rem;
    color: #374151;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d9488;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.select2-container--default .select2-selection--single:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
    outline: none;
} 

/* Стили для изменения размеров колонок таблиц */
.resizable-table {
    table-layout: fixed; /* Фиксированная разметка предотвращает перераспределение колонок */
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%; /* Минимальная ширина таблицы для обеспечения скролла */
}

.resizable-table th {
    position: relative;
    user-select: none;
    overflow: hidden;
    border-right: 1px solid #e5e7eb;
}

.resizable-table th:last-child {
    border-right: none;
}

.resizable-table th .header-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.resizable-table th .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    background: transparent;
    border-right: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.resizable-table th .resize-handle:hover {
    border-right-color: #0d9488;
    background-color: rgba(13, 148, 136, 0.1);
}

.resizable-table th.resizing .resize-handle {
    border-right-color: #0d9488;
    background-color: rgba(13, 148, 136, 0.2);
}

/* Стили для вертикальной линии при изменении размера */
.resize-line {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #0d9488;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(13, 148, 136, 0.5);
}

/* Стили для состояния изменения размера */
body.col-resizing {
    cursor: col-resize;
    user-select: none;
}

body.col-resizing * {
    cursor: col-resize !important;
}

/* Стили для ячеек таблицы */
.resizable-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid #e5e7eb;
}

.resizable-table td:last-child {
    border-right: none;
}

/* Стили для контейнера таблицы */
.resizable-table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Обеспечиваем правильный горизонтальный скроллинг для таблиц */
.overflow-x-auto {
    overflow-x: auto !important;
    overflow-y: hidden;
    width: 100%;
}

/* Принудительно делаем таблицу шире для появления скролла */
.overflow-x-auto table {
    min-width: 800px; /* Минимальная ширина для появления скролла */
    width: 100%;
}

/* Дополнительные стили для обеспечения скролла */
.overflow-x-auto table.resizable-table {
    min-width: 900px; /* Еще большая минимальная ширина для таблиц с изменяемыми столбцами */
}

/* Убеждаемся, что таблица может быть шире контейнера */
.resizable-table {
    min-width: 100%;
}

/* Убираем конфликтующие классы Tailwind */
.resizable-table.min-w-full {
    min-width: 100% !important;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .resizable-table th .resize-handle {
        width: 15px; /* Увеличиваем область для сенсорных устройств */
    }
}

/* Стили для кнопки сброса размеров (опционально) */
.table-reset-button {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-reset-button:hover {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

.table-reset-button i {
    margin-right: 0.25rem;
}

/* ===== СТИЛИ ДЛЯ ГРАФИКОВ ===== */

/* Панель параметров */
.parameters-panel {
    height: calc(100vh - 200px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.parameters-select {
    flex-grow: 1;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
}

.parameters-select option {
    padding: 4px;
    margin: 2px 0;
}

.parameters-select option:checked {
    background-color: #3B82F6;
    color: white;
}

/* Контейнер графика */
.graph-wrapper {
    position: relative;
    width: 100%;
    height: 450px !important;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
    overflow: hidden;
}

.graph-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: none;
}

/* Сообщения и оверлеи */
.message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    z-index: 10;
    text-align: center;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

/* Элементы управления масштабом - теперь используются Tailwind классы напрямую в HTML */