/* table-settings.css */
/* Table settings modal: column visibility, drag-drop reorder */

/* ==========================================
   НАСТРОЙКИ ТАБЛИЦЫ - МОДАЛЬНОЕ ОКНО
   ========================================== */

.table-settings-modal {
    max-width: 500px;
    width: 90%;
}

.table-settings-hint {
    color: var(--label-color);
    font-size: var(--font-size-sm);
    margin-bottom: 1.5rem;
    line-height: var(--line-height-normal);
}

.columns-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
}

.columns-config-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.column-config-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    transition: background-color 0.2s ease;
    cursor: move;
}

.column-config-item:last-child {
    border-bottom: none;
}

.column-config-item:hover {
    background-color: var(--bg-secondary);
}

.column-config-item.dragging {
    opacity: 0.4;
    background-color: rgba(var(--brand-primary-rgb), 0.1);
}

.column-config-item.drag-over {
    border-top: 3px solid var(--primary-color);
}

.column-config-item.locked {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: var(--bg-tertiary);
}

.column-config-item.locked .column-drag-handle {
    opacity: 0.3;
    cursor: not-allowed;
}

.column-drag-handle {
    color: var(--label-color);
    font-size: 20px;
    cursor: grab;
    flex-shrink: 0;
}

.column-drag-handle:active {
    cursor: grabbing;
}

.column-checkbox,
#show-single-date-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 20px !important;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--border-secondary, #4a4a4a) !important;
    border-radius: 4px;
    background-color: transparent;
    position: relative;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.column-checkbox:checked,
#show-single-date-checkbox:checked {
    background-color: var(--brand-primary, #6366f1);
    border-color: var(--brand-primary, #6366f1) !important;
}

.column-checkbox:checked::after,
#show-single-date-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg);
}

.column-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.column-label {
    flex-grow: 1;
    font-size: var(--font-size-base);
    color: var(--text-color);
    user-select: none;
}

.column-lock-icon {
    color: var(--label-color);
    font-size: 18px;
    flex-shrink: 0;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .table-settings-modal {
        max-width: 95%;
    }

    .columns-list-container {
        max-height: 300px;
    }

    .column-config-item {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }

    .column-label {
        font-size: var(--font-size-sm);
    }
}
